diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-05-29 15:34:33 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-05-29 15:34:33 -0700 |
commit | b4450ec4bb7cb12e09cb2cf5dc1e264080f23139 (patch) | |
tree | 530a2b9d98a445fc783d2149d8b1f9fc5434adf0 /youtube/yt_data_extract | |
parent | bdac6a23028152c77e82716bdd82db9e80c2685b (diff) | |
download | yt-local-b4450ec4bb7cb12e09cb2cf5dc1e264080f23139.tar.lz yt-local-b4450ec4bb7cb12e09cb2cf5dc1e264080f23139.tar.xz yt-local-b4450ec4bb7cb12e09cb2cf5dc1e264080f23139.zip |
Fix previously live videos labeled as live
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r-- | youtube/yt_data_extract/watch_extraction.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index 514b9c8..0444fc8 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -480,7 +480,7 @@ def extract_watch_info(polymer_json): liberal_update(info, 'id', vd.get('videoId')) liberal_update(info, 'author', vd.get('author')) liberal_update(info, 'author_id', vd.get('channelId')) - liberal_update(info, 'live', vd.get('isLiveContent')) + info['was_live'] = vd.get('isLiveContent') conservative_update(info, 'unlisted', not vd.get('isCrawlable', True)) #isCrawlable is false on limited state videos even if they aren't unlisted liberal_update(info, 'tags', vd.get('keywords', [])) @@ -493,6 +493,8 @@ def extract_watch_info(polymer_json): conservative_update(info, 'description', extract_str(mf.get('description'), recover_urls=True)) conservative_update(info, 'author', mf.get('ownerChannelName')) conservative_update(info, 'author_id', mf.get('externalChannelId')) + conservative_update(info, 'live', deep_get(mf, 'liveBroadcastDetails', + 'isLiveNow')) liberal_update(info, 'unlisted', mf.get('isUnlisted')) liberal_update(info, 'category', mf.get('category')) liberal_update(info, 'time_published', mf.get('publishDate')) |