From b466ffb5473eb98e33414fcdf38863b7842a0621 Mon Sep 17 00:00:00 2001 From: Wang Date: Tue, 21 Apr 2020 01:19:01 +0800 Subject: [PATCH] Added fix for issue #10687 in abc.py --- youtube_dl/extractor/abc.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py index 6637f4f35..f659fdd7d 100644 --- a/youtube_dl/extractor/abc.py +++ b/youtube_dl/extractor/abc.py @@ -17,7 +17,6 @@ from ..utils import ( update_url_query, ) - class ABCIE(InfoExtractor): IE_NAME = 'abc.net.au' _VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P\d+)' @@ -58,7 +57,11 @@ class ABCIE(InfoExtractor): }, { 'url': 'http://www.abc.net.au/news/2015-10-19/6866214', '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): video_id = self._match_id(url) @@ -67,8 +70,16 @@ class ABCIE(InfoExtractor): mobj = re.search( r'inline(?PVideo|Audio|YouTube)Data\.push\((?P[^)]+)\);', 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: expired = self._html_search_regex(r'(?s)class="expired-(?:video|audio)".+?(.+?)', webpage, 'expired', None) + + if expired: raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True) raise ExtractorError('Unable to extract video urls') @@ -79,6 +90,7 @@ class ABCIE(InfoExtractor): if not isinstance(urls_info, list): urls_info = [urls_info] + if mobj.group('type') == 'YouTube': return self.playlist_result([ self.url_result(url_info['url']) for url_info in urls_info])