Skip to content

Commit

Permalink
[zype] fix uplynk id extraction(closes ytdl-org#27956)
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine authored and ThirumalaiK committed Jan 28, 2021
1 parent a428d31 commit db65294
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions youtube_dl/extractor/zype.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,16 @@ def _real_extract(self, url):
r'(["\'])(?P<url>(?:(?!\1).)+\.m3u8(?:(?!\1).)*)\1',
body, 'm3u8 url', group='url', default=None)
if not m3u8_url:
source = self._parse_json(self._search_regex(
r'(?s)sources\s*:\s*\[\s*({.+?})\s*\]', body,
'source'), video_id, js_to_json)
if source.get('integration') == 'verizon-media':
m3u8_url = 'https://content.uplynk.com/%s.m3u8' % source['id']
source = self._search_regex(
r'(?s)sources\s*:\s*\[\s*({.+?})\s*\]', body, 'source')

def get_attr(key):
return self._search_regex(
r'\b%s\s*:\s*([\'"])(?P<val>(?:(?!\1).)+)\1' % key,
source, key, group='val')

if get_attr('integration') == 'verizon-media':
m3u8_url = 'https://content.uplynk.com/%s.m3u8' % get_attr('id')
formats = self._extract_m3u8_formats(
m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls')
text_tracks = self._search_regex(
Expand Down

0 comments on commit db65294

Please sign in to comment.