mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-22 07:43:08 +00:00
[footyroom] Fix extraction and update _TESTS (closes #10810)
This commit is contained in:
parent
555787d717
commit
c452e69d3d
2 changed files with 20 additions and 13 deletions
|
@ -4,6 +4,7 @@ Core
|
||||||
* [Makefile] Support for GNU make < 4 is fixed; BSD make dropped (#9387)
|
* [Makefile] Support for GNU make < 4 is fixed; BSD make dropped (#9387)
|
||||||
|
|
||||||
Extractors
|
Extractors
|
||||||
|
* [footyroom] Fix extraction (#10810)
|
||||||
* [abc.net.au:iview] Fix for standalone (non series) videos (#10895)
|
* [abc.net.au:iview] Fix for standalone (non series) videos (#10895)
|
||||||
+ [hbo] Add support for episode pages (#10892)
|
+ [hbo] Add support for episode pages (#10892)
|
||||||
* [allocine] Fix extraction (#10860)
|
* [allocine] Fix extraction (#10860)
|
||||||
|
|
|
@ -2,25 +2,27 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from .streamable import StreamableIE
|
||||||
|
|
||||||
|
|
||||||
class FootyRoomIE(InfoExtractor):
|
class FootyRoomIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://footyroom\.com/(?P<id>[^/]+)'
|
_VALID_URL = r'https?://footyroom\.com/matches/(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://footyroom.com/schalke-04-0-2-real-madrid-2015-02/',
|
'url': 'http://footyroom.com/matches/79922154/hull-city-vs-chelsea/review',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'schalke-04-0-2-real-madrid-2015-02',
|
'id': '79922154',
|
||||||
'title': 'Schalke 04 0 – 2 Real Madrid',
|
'title': 'VIDEO Hull City 0 - 2 Chelsea',
|
||||||
},
|
},
|
||||||
'playlist_count': 3,
|
'playlist_count': 2,
|
||||||
'skip': 'Video for this match is not available',
|
'add_ie': [StreamableIE.ie_key()],
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://footyroom.com/georgia-0-2-germany-2015-03/',
|
'url': 'http://footyroom.com/matches/75817984/georgia-vs-germany/review',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'georgia-0-2-germany-2015-03',
|
'id': '75817984',
|
||||||
'title': 'Georgia 0 – 2 Germany',
|
'title': 'VIDEO Georgia 0 - 2 Germany',
|
||||||
},
|
},
|
||||||
'playlist_count': 1,
|
'playlist_count': 1,
|
||||||
|
'add_ie': ['Playwire']
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -28,9 +30,8 @@ class FootyRoomIE(InfoExtractor):
|
||||||
|
|
||||||
webpage = self._download_webpage(url, playlist_id)
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
|
|
||||||
playlist = self._parse_json(
|
playlist = self._parse_json(self._search_regex(
|
||||||
self._search_regex(
|
r'DataStore\.media\s*=\s*([^;]+)', webpage, 'media data'),
|
||||||
r'VideoSelector\.load\((\[.+?\])\);', webpage, 'video selector'),
|
|
||||||
playlist_id)
|
playlist_id)
|
||||||
|
|
||||||
playlist_title = self._og_search_title(webpage)
|
playlist_title = self._og_search_title(webpage)
|
||||||
|
@ -40,11 +41,16 @@ class FootyRoomIE(InfoExtractor):
|
||||||
payload = video.get('payload')
|
payload = video.get('payload')
|
||||||
if not payload:
|
if not payload:
|
||||||
continue
|
continue
|
||||||
playwire_url = self._search_regex(
|
playwire_url = self._html_search_regex(
|
||||||
r'data-config="([^"]+)"', payload,
|
r'data-config="([^"]+)"', payload,
|
||||||
'playwire url', default=None)
|
'playwire url', default=None)
|
||||||
if playwire_url:
|
if playwire_url:
|
||||||
entries.append(self.url_result(self._proto_relative_url(
|
entries.append(self.url_result(self._proto_relative_url(
|
||||||
playwire_url, 'http:'), 'Playwire'))
|
playwire_url, 'http:'), 'Playwire'))
|
||||||
|
|
||||||
|
streamable_url = StreamableIE._extract_url(payload)
|
||||||
|
if streamable_url:
|
||||||
|
entries.append(self.url_result(
|
||||||
|
streamable_url, StreamableIE.ie_key()))
|
||||||
|
|
||||||
return self.playlist_result(entries, playlist_id, playlist_title)
|
return self.playlist_result(entries, playlist_id, playlist_title)
|
||||||
|
|
Loading…
Reference in a new issue