mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 22:16:37 +00:00
channel_id is the only available key
This commit is contained in:
parent
25892388a1
commit
fb87b54300
@ -61,14 +61,15 @@ def get_channel_id(url):
|
||||
with yt_dlp.YoutubeDL(opts) as y:
|
||||
try:
|
||||
response = y.extract_info(url, download=False)
|
||||
|
||||
channel_id = response['channel_id']
|
||||
playlist_id = response['playlist_id']
|
||||
playlist_channel_id = response['playlist_channel_id']
|
||||
except yt_dlp.utils.DownloadError as e:
|
||||
raise YouTubeError(f'Failed to extract channel ID for "{url}": {e}') from e
|
||||
else:
|
||||
return playlist_channel_id or playlist_id or channel_id
|
||||
try:
|
||||
channel_id = response['channel_id']
|
||||
except Exception as e:
|
||||
raise YouTubeError(f'Failed to extract channel ID for "{url}": {e}') from e
|
||||
else:
|
||||
return channel_id
|
||||
|
||||
def get_channel_image_info(url):
|
||||
opts = get_yt_opts()
|
||||
|
Loading…
Reference in New Issue
Block a user