diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-04-24 23:53:01 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-04-24 23:55:06 +0700 |
commit | 0ff51adae6feab7386874eddc0d61dbeaf063bf2 (patch) | |
tree | 8b80ab324b53919cf57302273a9e4a172f201f7e /youtube_dl/extractor/twitch.py | |
parent | 1cc47c667419e0eadc0a6989256ab7b276852adf (diff) |
[twitch] Extract is_live according to status (closes #16259)
Diffstat (limited to 'youtube_dl/extractor/twitch.py')
-rw-r--r-- | youtube_dl/extractor/twitch.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py index f736283e9..4c11fd3c3 100644 --- a/youtube_dl/extractor/twitch.py +++ b/youtube_dl/extractor/twitch.py @@ -168,6 +168,13 @@ class TwitchItemBaseIE(TwitchBaseIE): return self.playlist_result(entries, info['id'], info['title']) def _extract_info(self, info): + status = info.get('status') + if status == 'recording': + is_live = True + elif status == 'recorded': + is_live = False + else: + is_live = None return { 'id': info['_id'], 'title': info.get('title') or 'Untitled Broadcast', @@ -178,6 +185,7 @@ class TwitchItemBaseIE(TwitchBaseIE): 'uploader_id': info.get('channel', {}).get('name'), 'timestamp': parse_iso8601(info.get('recorded_at')), 'view_count': int_or_none(info.get('views')), + 'is_live': is_live, } def _real_extract(self, url): |