Attempt to switch to video search instead of songs
All checks were successful
Deploy Service / deploy (push) Successful in 25s

This commit is contained in:
Mootfrost 2025-04-13 22:25:26 +03:00
parent 8d71b9d0c2
commit 4a117805f0

View file

@ -15,7 +15,7 @@ if config.proxy:
def name_to_youtube(name: str):
results = ytmusic.search(name, 'songs', limit=5)
results = ytmusic.search(name, 'videos', limit=5)
print(results[0])
return results[0]['videoId']
@ -24,7 +24,7 @@ def _download(yt_id: str, directory: str):
params = {
'format': 'bestaudio',
'quiet': True,
'outtmpl': os.path.join(directory, 'dl.%(ext)s'),
'outtmpl': os.path.join(directory, 'dl.%(ext)s')
}
if config.socks_proxy:
params['proxy'] = config.socks_proxy