Attempt to switch to video search instead of songs
All checks were successful
Deploy Service / deploy (push) Successful in 25s
All checks were successful
Deploy Service / deploy (push) Successful in 25s
This commit is contained in:
parent
8d71b9d0c2
commit
4a117805f0
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue