Skip to content

Commit

Permalink
Fix error with non-channel-id urls
Browse files Browse the repository at this point in the history
Only update channel id based on the url if we have it
  • Loading branch information
user234683 committed Mar 13, 2023
1 parent 4020389 commit 291fa02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions youtube/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None):
info['header_playlist_names'] = local_playlist.get_playlist_names()
if tab in ('videos', 'playlists'):
info['current_sort'] = sort
info['channel_url'] = 'https://www.youtube.com/channel/' + channel_id
info['channel_id'] = channel_id
if channel_id:
info['channel_url'] = ('https://www.youtube.com/channel/'
+ channel_id)
info['channel_id'] = channel_id
elif tab == 'search':
info['search_box_value'] = query
info['header_playlist_names'] = local_playlist.get_playlist_names()
Expand Down

0 comments on commit 291fa02

Please sign in to comment.