mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-06 18:20:02 +00:00
Added fix for issue #10687 in abc.py
This commit is contained in:
parent
8ff6324d65
commit
b466ffb547
@ -17,7 +17,6 @@ from ..utils import (
|
|||||||
update_url_query,
|
update_url_query,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class ABCIE(InfoExtractor):
|
class ABCIE(InfoExtractor):
|
||||||
IE_NAME = 'abc.net.au'
|
IE_NAME = 'abc.net.au'
|
||||||
_VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+)'
|
||||||
@ -58,7 +57,11 @@ class ABCIE(InfoExtractor):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'http://www.abc.net.au/news/2015-10-19/6866214',
|
'url': 'http://www.abc.net.au/news/2015-10-19/6866214',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}, {
|
||||||
|
'url': "https://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326",
|
||||||
|
'only_matching': True,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
@ -67,8 +70,16 @@ class ABCIE(InfoExtractor):
|
|||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
|
r'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
|
||||||
webpage)
|
webpage)
|
||||||
|
|
||||||
|
youtube_link = self._html_search_regex(r'(?s)a href="http://www.youtube.com/(.+?)"', webpage, 'youtube_link', None)
|
||||||
|
if youtube_link:
|
||||||
|
youtube_link = "http://www.youtube.com/"+youtube_link
|
||||||
|
return self.url_result(youtube_link)
|
||||||
|
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
expired = self._html_search_regex(r'(?s)class="expired-(?:video|audio)".+?<span>(.+?)</span>', webpage, 'expired', None)
|
expired = self._html_search_regex(r'(?s)class="expired-(?:video|audio)".+?<span>(.+?)</span>', webpage, 'expired', None)
|
||||||
|
|
||||||
|
|
||||||
if expired:
|
if expired:
|
||||||
raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True)
|
raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True)
|
||||||
raise ExtractorError('Unable to extract video urls')
|
raise ExtractorError('Unable to extract video urls')
|
||||||
@ -79,6 +90,7 @@ class ABCIE(InfoExtractor):
|
|||||||
if not isinstance(urls_info, list):
|
if not isinstance(urls_info, list):
|
||||||
urls_info = [urls_info]
|
urls_info = [urls_info]
|
||||||
|
|
||||||
|
|
||||||
if mobj.group('type') == 'YouTube':
|
if mobj.group('type') == 'YouTube':
|
||||||
return self.playlist_result([
|
return self.playlist_result([
|
||||||
self.url_result(url_info['url']) for url_info in urls_info])
|
self.url_result(url_info['url']) for url_info in urls_info])
|
||||||
|
Loading…
Reference in New Issue
Block a user