1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2025-01-07 13:47:54 +01:00

Update go to select brand.

This commit is contained in:
SpeakerEnder 2019-09-23 22:32:35 -04:00
parent f0ea1d96ee
commit e4e393b983

View File

@ -78,13 +78,17 @@ class GoIE(AdobePassIE):
def _extract_videos(self, brand, video_id='-1', show_id='-1'):
display_id = video_id if video_id != '-1' else show_id
foo = 'http://api.contents.watchabc.go.com/vp2/ws/contents/3000/videos/%s/001/-1/%s/-1/%s/-1/-1.json' % (brand, show_id, video_id)
print("Foo is:", foo)
return self._download_json(
'http://api.contents.watchabc.go.com/vp2/ws/contents/3000/videos/%s/001/-1/%s/-1/%s/-1/-1.json' % (brand, show_id, video_id),
display_id)['video']
def _real_extract(self, url):
sub_domain, video_id, display_id = re.match(self._VALID_URL, url).groups()
print("sub_domain:",sub_domain)
site_info = self._SITE_INFO.get(sub_domain, {})
print("site_info:", site_info)
brand = site_info.get('brand')
if not video_id or not site_info:
webpage = self._download_webpage(url, display_id or video_id)
@ -97,7 +101,8 @@ class GoIE(AdobePassIE):
brand = self._search_regex(
(r'data-brand=\s*["\']\s*(\d+)',
r'data-page-brand=\s*["\']\s*(\d+)'), webpage, 'brand',
default='004')
default='008')
print("Brand 100:", brand)
site_info = next(
si for _, si in self._SITE_INFO.items()
if si.get('brand') == brand)