aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-11-13 23:49:14 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-11-13 23:49:14 +0530
commit9ac24e235ea9ef91c711c35b0f793d17ea284a54 (patch)
tree69ad70e6165f7a3b44b70ee3ad2c702df84d4316
parent7c7f7161fc0d778cd74d8b89162ba9df3d4e5da8 (diff)
downloadhypervideo-pre-9ac24e235ea9ef91c711c35b0f793d17ea284a54.tar.lz
hypervideo-pre-9ac24e235ea9ef91c711c35b0f793d17ea284a54.tar.xz
hypervideo-pre-9ac24e235ea9ef91c711c35b0f793d17ea284a54.zip
[curiositystream] Add more metadata
Closes #1568
-rw-r--r--yt_dlp/extractor/common.py1
-rw-r--r--yt_dlp/extractor/curiositystream.py12
2 files changed, 11 insertions, 2 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 5c6e59901..6f0650296 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -342,6 +342,7 @@ class InfoExtractor(object):
series, programme or podcast:
series: Title of the series or programme the video episode belongs to.
+ series_id: Id of the series or programme the video episode belongs to, as a unicode string.
season: Title of the season the video episode belongs to.
season_number: Number of the season the video episode belongs to, as an integer.
season_id: Id of the season the video episode belongs to, as a unicode string.
diff --git a/yt_dlp/extractor/curiositystream.py b/yt_dlp/extractor/curiositystream.py
index 628c83631..286a4c6af 100644
--- a/yt_dlp/extractor/curiositystream.py
+++ b/yt_dlp/extractor/curiositystream.py
@@ -50,19 +50,23 @@ class CuriosityStreamBaseIE(InfoExtractor):
class CuriosityStreamIE(CuriosityStreamBaseIE):
IE_NAME = 'curiositystream'
_VALID_URL = r'https?://(?:app\.)?curiositystream\.com/video/(?P<id>\d+)'
- _TEST = {
+ _TESTS = [{
'url': 'https://app.curiositystream.com/video/2',
'info_dict': {
'id': '2',
'ext': 'mp4',
'title': 'How Did You Develop The Internet?',
'description': 'Vint Cerf, Google\'s Chief Internet Evangelist, describes how he and Bob Kahn created the internet.',
+ 'channel': 'Curiosity Stream',
+ 'categories': ['Technology', 'Interview'],
+ 'average_rating': 96.79,
+ 'series_id': '2',
},
'params': {
# m3u8 download
'skip_download': True,
},
- }
+ }]
def _real_extract(self, url):
video_id = self._match_id(url)
@@ -139,6 +143,10 @@ class CuriosityStreamIE(CuriosityStreamBaseIE):
'duration': int_or_none(media.get('duration')),
'tags': media.get('tags'),
'subtitles': subtitles,
+ 'channel': media.get('producer'),
+ 'categories': [media.get('primary_category'), media.get('type')],
+ 'average_rating': media.get('rating_percentage'),
+ 'series_id': str(media.get('collection_id') or '') or None,
}