Upgrade yt_dlp and download script
This commit is contained in:
@@ -82,10 +82,10 @@ class IviIE(InfoExtractor):
|
||||
'params': [
|
||||
video_id, {
|
||||
'site': 's%d',
|
||||
'referrer': 'http://www.ivi.ru/watch/%s' % video_id,
|
||||
'contentid': video_id
|
||||
}
|
||||
]
|
||||
'referrer': f'http://www.ivi.ru/watch/{video_id}',
|
||||
'contentid': video_id,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
for site in (353, 183):
|
||||
@@ -98,7 +98,7 @@ class IviIE(InfoExtractor):
|
||||
self._LIGHT_URL, video_id,
|
||||
'Downloading timestamp JSON', data=json.dumps({
|
||||
'method': 'da.timestamp.get',
|
||||
'params': []
|
||||
'params': [],
|
||||
}).encode(), fatal=False) or {}).get('result')
|
||||
if not timestamp:
|
||||
continue
|
||||
@@ -158,7 +158,7 @@ class IviIE(InfoExtractor):
|
||||
compilation = result.get('compilation')
|
||||
episode = title if compilation else None
|
||||
|
||||
title = '%s - %s' % (compilation, title) if compilation is not None else title
|
||||
title = f'{compilation} - {title}' if compilation is not None else title
|
||||
|
||||
thumbnails = [{
|
||||
'url': preview['url'],
|
||||
@@ -219,9 +219,9 @@ class IviCompilationIE(InfoExtractor):
|
||||
def _extract_entries(self, html, compilation_id):
|
||||
return [
|
||||
self.url_result(
|
||||
'http://www.ivi.ru/watch/%s/%s' % (compilation_id, serie), IviIE.ie_key())
|
||||
f'http://www.ivi.ru/watch/{compilation_id}/{serie}', IviIE.ie_key())
|
||||
for serie in re.findall(
|
||||
r'<a\b[^>]+\bhref=["\']/watch/%s/(\d+)["\']' % compilation_id, html)]
|
||||
rf'<a\b[^>]+\bhref=["\']/watch/{compilation_id}/(\d+)["\']', html)]
|
||||
|
||||
def _real_extract(self, url):
|
||||
mobj = self._match_valid_url(url)
|
||||
@@ -230,8 +230,8 @@ class IviCompilationIE(InfoExtractor):
|
||||
|
||||
if season_id is not None: # Season link
|
||||
season_page = self._download_webpage(
|
||||
url, compilation_id, 'Downloading season %s web page' % season_id)
|
||||
playlist_id = '%s/season%s' % (compilation_id, season_id)
|
||||
url, compilation_id, f'Downloading season {season_id} web page')
|
||||
playlist_id = f'{compilation_id}/season{season_id}'
|
||||
playlist_title = self._html_search_meta('title', season_page, 'title')
|
||||
entries = self._extract_entries(season_page, compilation_id)
|
||||
else: # Compilation link
|
||||
@@ -239,15 +239,15 @@ class IviCompilationIE(InfoExtractor):
|
||||
playlist_id = compilation_id
|
||||
playlist_title = self._html_search_meta('title', compilation_page, 'title')
|
||||
seasons = re.findall(
|
||||
r'<a href="/watch/%s/season(\d+)' % compilation_id, compilation_page)
|
||||
rf'<a href="/watch/{compilation_id}/season(\d+)', compilation_page)
|
||||
if not seasons: # No seasons in this compilation
|
||||
entries = self._extract_entries(compilation_page, compilation_id)
|
||||
else:
|
||||
entries = []
|
||||
for season_id in seasons:
|
||||
season_page = self._download_webpage(
|
||||
'http://www.ivi.ru/watch/%s/season%s' % (compilation_id, season_id),
|
||||
compilation_id, 'Downloading season %s web page' % season_id)
|
||||
f'http://www.ivi.ru/watch/{compilation_id}/season{season_id}',
|
||||
compilation_id, f'Downloading season {season_id} web page')
|
||||
entries.extend(self._extract_entries(season_page, compilation_id))
|
||||
|
||||
return self.playlist_result(entries, playlist_id, playlist_title)
|
||||
|
Reference in New Issue
Block a user