mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 17:02:30 +00:00
[animeondemand] Extract teaser when no full episode available (#8923)
This commit is contained in:
parent
5c69f7a479
commit
85c637b737
@ -225,16 +225,18 @@ def _real_extract(self, url):
|
|||||||
})
|
})
|
||||||
entries.append(f)
|
entries.append(f)
|
||||||
|
|
||||||
m = re.search(
|
# Extract teaser only when full episode is not available
|
||||||
r'data-dialog-header=(["\'])(?P<title>.+?)\1[^>]+href=(["\'])(?P<href>.+?)\3[^>]*>Teaser<',
|
if not formats:
|
||||||
episode_html)
|
m = re.search(
|
||||||
if m:
|
r'data-dialog-header=(["\'])(?P<title>.+?)\1[^>]+href=(["\'])(?P<href>.+?)\3[^>]*>Teaser<',
|
||||||
f = common_info.copy()
|
episode_html)
|
||||||
f.update({
|
if m:
|
||||||
'id': '%s-teaser' % f['id'],
|
f = common_info.copy()
|
||||||
'title': m.group('title'),
|
f.update({
|
||||||
'url': compat_urlparse.urljoin(url, m.group('href')),
|
'id': '%s-teaser' % f['id'],
|
||||||
})
|
'title': m.group('title'),
|
||||||
entries.append(f)
|
'url': compat_urlparse.urljoin(url, m.group('href')),
|
||||||
|
})
|
||||||
|
entries.append(f)
|
||||||
|
|
||||||
return self.playlist_result(entries, anime_id, anime_title, anime_description)
|
return self.playlist_result(entries, anime_id, anime_title, anime_description)
|
||||||
|
Loading…
Reference in New Issue
Block a user