From b4450ec4bb7cb12e09cb2cf5dc1e264080f23139 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 29 May 2020 15:34:33 -0700 Subject: Fix previously live videos labeled as live --- youtube/yt_data_extract/watch_extraction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'youtube/yt_data_extract/watch_extraction.py') 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')) -- cgit v1.2.3