diff options
author | Sergey M․ <dstftw@gmail.com> | 2019-01-08 10:02:49 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2019-01-08 10:02:49 +0700 |
commit | 440863ade10c70bec272c1ffe17b63c877e46ca7 (patch) | |
tree | 76176e7c3293fe388aea6049d54275c4a17d6f1d | |
parent | 391256dc0ee5e6ac8d3022455de207b8b02a5b10 (diff) |
[extractor/common] Use episode name as title in _json_ld
-rw-r--r-- | youtube_dl/extractor/common.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index f507400cc..9e7febcad 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1239,11 +1239,14 @@ class InfoExtractor(object): if expected_type is not None and expected_type != item_type: return info if item_type in ('TVEpisode', 'Episode'): + episode_name = unescapeHTML(e.get('name')) info.update({ - 'episode': unescapeHTML(e.get('name')), + 'episode': episode_name, 'episode_number': int_or_none(e.get('episodeNumber')), 'description': unescapeHTML(e.get('description')), }) + if not info.get('title') and episode_name: + info['title'] = episode_name part_of_season = e.get('partOfSeason') if isinstance(part_of_season, dict) and part_of_season.get('@type') in ('TVSeason', 'Season', 'CreativeWorkSeason'): info['season_number'] = int_or_none(part_of_season.get('seasonNumber')) |