diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-04-14 19:38:26 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-05-06 14:31:19 -0500 |
commit | 53b274e35fcce58d29347ff3f01601c1fc97d47e (patch) | |
tree | 283b60d662420d40bd2ea04446519011571bf05b | |
parent | 0ee1aabc74c4ca200dc3bd56ccaa40dbc3ecab59 (diff) | |
download | yt-local-53b274e35fcce58d29347ff3f01601c1fc97d47e.tar.lz yt-local-53b274e35fcce58d29347ff3f01601c1fc97d47e.tar.xz yt-local-53b274e35fcce58d29347ff3f01601c1fc97d47e.zip |
Save uploader id in local playlists
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rw-r--r-- | youtube/util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube/util.py b/youtube/util.py index 1142c1d..8f359ba 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -517,11 +517,11 @@ def add_extra_html_info(item): item['url'] = (URL_ORIGIN + '/watch?v=' + item['id']) if item.get('id') else None video_info = {} - for key in ('id', 'title', 'author', 'duration'): + for key in ('id', 'title', 'author', 'duration', 'author_id'): try: video_info[key] = item[key] except KeyError: - video_info[key] = '' + video_info[key] = None item['video_info'] = json.dumps(video_info) @@ -536,6 +536,9 @@ def add_extra_html_info(item): elif item['type'] == 'channel': item['url'] = concat_or_none(URL_ORIGIN, "/channel/", item['id']) + if item.get('author_id') and 'author_url' not in item: + item['author_url'] = URL_ORIGIN + '/channel/' + item['author_id'] + def check_gevent_exceptions(*tasks): for task in tasks: |