Handling youtube usernames that are actually handles.

This commit is contained in:
Samuel Clay 2024-03-03 13:09:59 -05:00
parent 2f4d823303
commit 7d08632e9c

View file

@ -210,9 +210,11 @@ class YoutubeFetcher:
description = channel["items"][0]["snippet"]["description"]
uploads_list_id = channel["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
except (IndexError, KeyError):
return
uploads_list_id = None
if not uploads_list_id and username_key == "forUsername":
return self.fetch_user_videos(username, username_key="forHandle")
if not uploads_list_id:
if username_key == "forUsername":
return self.fetch_user_videos(username, username_key="forHandle")
return None, None, None
return self.fetch_playlist_videos(uploads_list_id, title, description)