]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/footyroom.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from .streamable
import StreamableIE
8 class FootyRoomIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://footyroom\.com/matches/(?P<id>\d+)'
11 'url': 'http://footyroom.com/matches/79922154/hull-city-vs-chelsea/review',
14 'title': 'VIDEO Hull City 0 - 2 Chelsea',
17 'add_ie': [StreamableIE
.ie_key()],
19 'url': 'http://footyroom.com/matches/75817984/georgia-vs-germany/review',
22 'title': 'VIDEO Georgia 0 - 2 Germany',
25 'add_ie': ['Playwire']
28 def _real_extract(self
, url
):
29 playlist_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, playlist_id
)
33 playlist
= self
._parse
_json
(self
._search
_regex
(
34 r
'DataStore\.media\s*=\s*([^;]+)', webpage
, 'media data'),
37 playlist_title
= self
._og
_search
_title
(webpage
)
40 for video
in playlist
:
41 payload
= video
.get('payload')
44 playwire_url
= self
._html
_search
_regex
(
45 r
'data-config="([^"]+)"', payload
,
46 'playwire url', default
=None)
48 entries
.append(self
.url_result(self
._proto
_relative
_url
(
49 playwire_url
, 'http:'), 'Playwire'))
51 streamable_url
= StreamableIE
._extract
_url
(payload
)
53 entries
.append(self
.url_result(
54 streamable_url
, StreamableIE
.ie_key()))
56 return self
.playlist_result(entries
, playlist_id
, playlist_title
)