From 0589cfb8f76455ac76df91fca89ccf65e8f9beca Mon Sep 17 00:00:00 2001
From: James Taylor <user234683@users.noreply.github.com>
Date: Sun, 8 Nov 2020 10:08:20 -0800
Subject: 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
---
 youtube/yt_data_extract/watch_extraction.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'youtube')

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=',
-- 
cgit v1.2.3