projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1cc47c6
)
[twitch] Extract is_live according to status (closes #16259)
author
Sergey M․
<dstftw@gmail.com>
Tue, 24 Apr 2018 16:53:01 +0000
(23:53 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Tue, 24 Apr 2018 16:55:06 +0000
(23:55 +0700)
youtube_dl/extractor/twitch.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/twitch.py
b/youtube_dl/extractor/twitch.py
index f736283e905f081d10caf6afc133d6fa900c7463..4c11fd3c38abb88fb77baf199b47039b79c43458 100644
(file)
--- 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):
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',
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')),
'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):
}
def _real_extract(self, url):