diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-03-21 23:35:50 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-03-21 23:35:50 +0600 |
commit | 85c637b7376f0426e5e0a6812da2a72b2ca28680 (patch) | |
tree | a96259dc03373e1f6d312abebc4cfb02f0599a09 /youtube_dl/extractor/animeondemand.py | |
parent | 5c69f7a479936a8fc429228c8259dc5fcbf428b1 (diff) |
[animeondemand] Extract teaser when no full episode available (#8923)
Diffstat (limited to 'youtube_dl/extractor/animeondemand.py')
-rw-r--r-- | youtube_dl/extractor/animeondemand.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/youtube_dl/extractor/animeondemand.py b/youtube_dl/extractor/animeondemand.py index 81a843035..a47697738 100644 --- a/youtube_dl/extractor/animeondemand.py +++ b/youtube_dl/extractor/animeondemand.py @@ -225,16 +225,18 @@ class AnimeOnDemandIE(InfoExtractor): }) entries.append(f) - m = re.search( - r'data-dialog-header=(["\'])(?P<title>.+?)\1[^>]+href=(["\'])(?P<href>.+?)\3[^>]*>Teaser<', - episode_html) - if m: - f = common_info.copy() - f.update({ - 'id': '%s-teaser' % f['id'], - 'title': m.group('title'), - 'url': compat_urlparse.urljoin(url, m.group('href')), - }) - entries.append(f) + # Extract teaser only when full episode is not available + if not formats: + m = re.search( + r'data-dialog-header=(["\'])(?P<title>.+?)\1[^>]+href=(["\'])(?P<href>.+?)\3[^>]*>Teaser<', + episode_html) + if m: + f = common_info.copy() + f.update({ + 'id': '%s-teaser' % f['id'], + 'title': m.group('title'), + 'url': compat_urlparse.urljoin(url, m.group('href')), + }) + entries.append(f) return self.playlist_result(entries, anime_id, anime_title, anime_description) |