aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/yt_data_extract
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-11-08 10:08:20 -0800
committerJames Taylor <user234683@users.noreply.github.com>2020-11-08 10:08:20 -0800
commit0589cfb8f76455ac76df91fca89ccf65e8f9beca (patch)
treeb100e7f4b1e6fe6bf1b24a724c35ef86083b31e4 /youtube/yt_data_extract
parent2388b372aefaa6ff0ad4e8c6f29173ccf7b1ed56 (diff)
downloadyt-local-0589cfb8f76455ac76df91fca89ccf65e8f9beca.tar.lz
yt-local-0589cfb8f76455ac76df91fca89ccf65e8f9beca.tar.xz
yt-local-0589cfb8f76455ac76df91fca89ccf65e8f9beca.zip
yt_data_ext: watch playlist: Fix missing author_url if no author_id
Embedded playlist info was missing author_url key if author_id was None. This caused KeyError in watch.py when it expected that key Closes #37
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r--youtube/yt_data_extract/watch_extraction.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py
index 12a3bf8..aa7efa9 100644
--- a/youtube/yt_data_extract/watch_extraction.py
+++ b/youtube/yt_data_extract/watch_extraction.py
@@ -177,9 +177,8 @@ def _extract_watch_info_mobile(top_level):
author_id = deep_get(playlist, 'longBylineText', 'runs', 0,
'navigationEndpoint', 'browseEndpoint', 'browseId')
info['playlist']['author_id'] = author_id
- if author_id:
- info['playlist']['author_url'] = concat_or_none(
- 'https://www.youtube.com/channel/', author_id)
+ info['playlist']['author_url'] = concat_or_none(
+ 'https://www.youtube.com/channel/', author_id)
info['playlist']['id'] = playlist.get('playlistId')
info['playlist']['url'] = concat_or_none(
'https://www.youtube.com/playlist?list=',