diff options
author | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
commit | 5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e (patch) | |
tree | 65209bc739db35e31f1c9b5b868eb5df4fe12ae3 /hypervideo_dl/extractor/go.py | |
parent | 27fe903c511691c078942bef5ee9a05a43b15c8f (diff) | |
download | hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.lz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.xz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/go.py')
-rw-r--r-- | hypervideo_dl/extractor/go.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/hypervideo_dl/extractor/go.py b/hypervideo_dl/extractor/go.py index 878ba14..2ccc6df 100644 --- a/hypervideo_dl/extractor/go.py +++ b/hypervideo_dl/extractor/go.py @@ -9,6 +9,8 @@ from ..utils import ( int_or_none, determine_ext, parse_age_limit, + remove_start, + remove_end, try_get, urlencode_postdata, ExtractorError, @@ -48,15 +50,15 @@ class GoIE(AdobePassIE): } _VALID_URL = r'''(?x) https?:// - (?: - (?:(?P<sub_domain>%s)\.)?go| - (?P<sub_domain_2>abc|freeform|disneynow|fxnow\.fxnetworks) + (?P<sub_domain> + (?:%s\.)?go|fxnow\.fxnetworks| + (?:www\.)?(?:abc|freeform|disneynow) )\.com/ (?: (?:[^/]+/)*(?P<id>[Vv][Dd][Kk][Aa]\w+)| (?:[^/]+/)*(?P<display_id>[^/?\#]+) ) - ''' % '|'.join(list(_SITE_INFO.keys())) + ''' % r'\.|'.join(list(_SITE_INFO.keys())) _TESTS = [{ 'url': 'http://abc.go.com/shows/designated-survivor/video/most-recent/VDKA3807643', 'info_dict': { @@ -147,6 +149,9 @@ class GoIE(AdobePassIE): }, { 'url': 'https://disneynow.com/shows/minnies-bow-toons/video/happy-campers/vdka4872013', 'only_matching': True, + }, { + 'url': 'https://www.freeform.com/shows/cruel-summer/episode-guide/season-01/01-happy-birthday-jeanette-turner', + 'only_matching': True, }] def _extract_videos(self, brand, video_id='-1', show_id='-1'): @@ -156,8 +161,8 @@ class GoIE(AdobePassIE): display_id)['video'] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - sub_domain = mobj.group('sub_domain') or mobj.group('sub_domain_2') + mobj = self._match_valid_url(url) + sub_domain = remove_start(remove_end(mobj.group('sub_domain') or '', '.go'), 'www.') video_id, display_id = mobj.group('id', 'display_id') site_info = self._SITE_INFO.get(sub_domain, {}) brand = site_info.get('brand') @@ -262,7 +267,7 @@ class GoIE(AdobePassIE): if re.search(r'(?:/mp4/source/|_source\.mp4)', asset_url): f.update({ 'format_id': ('%s-' % format_id if format_id else '') + 'SOURCE', - 'preference': 1, + 'quality': 1, }) else: mobj = re.search(r'/(\d+)x(\d+)/', asset_url) |