]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[extractor/common] Add support for movies in _json_ld
authorSergey M․ <dstftw@gmail.com>
Tue, 8 Jan 2019 03:02:00 +0000 (10:02 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 8 Jan 2019 03:02:00 +0000 (10:02 +0700)
youtube_dl/extractor/common.py

index e5f8136fc1511d573978298393f5aba5d94d7af8..f507400cc34facb450015bd7254d4f98b85487a5 100644 (file)
@@ -1250,6 +1250,13 @@ class InfoExtractor(object):
                     part_of_series = e.get('partOfSeries') or e.get('partOfTVSeries')
                     if isinstance(part_of_series, dict) and part_of_series.get('@type') in ('TVSeries', 'Series', 'CreativeWorkSeries'):
                         info['series'] = unescapeHTML(part_of_series.get('name'))
+                elif item_type == 'Movie':
+                    info.update({
+                        'title': unescapeHTML(e.get('name')),
+                        'description': unescapeHTML(e.get('description')),
+                        'duration': parse_duration(e.get('duration')),
+                        'timestamp': unified_timestamp(e.get('dateCreated')),
+                    })
                 elif item_type in ('Article', 'NewsArticle'):
                     info.update({
                         'timestamp': parse_iso8601(e.get('datePublished')),