Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when inserting YT Music cookie file via command line #2144

Closed
pcarmonac opened this issue Jul 25, 2024 · 13 comments
Closed

Error when inserting YT Music cookie file via command line #2144

pcarmonac opened this issue Jul 25, 2024 · 13 comments
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed

Comments

@pcarmonac
Copy link

System OS

MacOS

Python Version

3.11 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.2.5

Expected Behavior vs Actual Behavior

On several occasions I have tried to install the YT Music cookie file via command line, but it always gives me the same error. I looked for where the original cookie file should go but I did not find any file in the path.

SCR-20240724-rndg

Any guidance?

SpotDL version
SCR-20240724-rlyu

Thanls

Pablo

Steps to reproduce - Ensure to include actual links!

  1. download cookie files from YT Music
  2. on the command line enter
    spotdl --cookie-file cookie.txt
  3. delivery query error

Traceback

pcarmonac@MacBook-Pro-M1 Downloads % spotdl --cookie-file cookies.txt 
usage: spotdl [-h] [--audio [{youtube,youtube-music,slider-kz,soundcloud,bandcamp,piped} ...]] [--lyrics [{genius,musixmatch,azlyrics,synced} ...]] [--config]
              [--search-query SEARCH_QUERY] [--dont-filter-results] [--album-type {album,single}] [--only-verified-results] [--user-auth] [--client-id CLIENT_ID]
              [--client-secret CLIENT_SECRET] [--auth-token AUTH_TOKEN] [--cache-path CACHE_PATH] [--no-cache] [--max-retries MAX_RETRIES] [--headless] [--use-cache-file]
              [--ffmpeg FFMPEG] [--threads THREADS] [--bitrate {auto,disable,8k,16k,24k,32k,40k,48k,64k,80k,96k,112k,128k,160k,192k,224k,256k,320k,0,1,2,3,4,5,6,7,8,9}]
              [--ffmpeg-args FFMPEG_ARGS] [--format {mp3,flac,ogg,opus,m4a,wav}] [--save-file SAVE_FILE] [--preload] [--output OUTPUT] [--m3u [M3U]] [--cookie-file COOKIE_FILE]
              [--overwrite {metadata,force,skip}] [--restrict [{none,ascii,strict}]] [--print-errors] [--save-errors SAVE_ERRORS] [--sponsor-block] [--archive ARCHIVE]
              [--playlist-numbering] [--scan-for-songs] [--fetch-albums] [--id3-separator ID3_SEPARATOR] [--ytm-data] [--add-unavailable] [--generate-lrc]
              [--force-update-metadata] [--sync-without-deleting] [--max-filename-length MAX_FILENAME_LENGTH] [--yt-dlp-args YT_DLP_ARGS]
              [--detect-formats [{mp3,flac,ogg,opus,m4a,wav} ...]] [--redownload] [--skip-album-art] [--ignore-albums [IGNORE_ALBUMS ...]] [--skip-explicit] [--proxy PROXY]
              [--create-skip-file] [--respect-skip-file] [--host HOST] [--port PORT] [--keep-alive] [--allowed-origins [ALLOWED_ORIGINS ...]] [--web-use-output-dir]
              [--keep-sessions] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,MATCH,DEBUG,NOTSET}] [--simple-tui] [--log-format LOG_FORMAT] [--download-ffmpeg]
              [--generate-config] [--check-for-updates] [--profile] [--version]
              [{download,save,web,sync,meta,url}] query [query ...]
spotdl: error: the following arguments are required: query
pcarmonac@MacBook-Pro-M1 Downloads %

Other details

No response

@pcarmonac pcarmonac added the Bug Unexpected problem or unintended behavior that needs to be fixed label Jul 25, 2024
@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

Well you didn't provide any url to download. If you want to start web ui you have to run

spotdl web --cookie-file cookies.txt 

@pcarmonac
Copy link
Author

no I try update the cookie file, the line command

spotdl --cookie-file cookie.txt

I am understanding that every time I enter a download request from a play list I must enter the cookie file? something like this?

spotdl --cookie-file cookiefile.txt https://open.spotify.com/playlist/3rutp1PvPUWdkZ1ttEyWFB?si=ab3eb3be20bb4d0a

@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

I am understanding that every time I enter a download request from a play list I must enter the cookie file? something like this?

spotdl --cookie-file cookiefile.txt open.spotify.com/playlist/3rutp1PvPUWdkZ1ttEyWFB?si=ab3eb3be20bb4d0a

yes, or you can save the path to the cookie file in the config file so you won't have to do it again

@pcarmonac
Copy link
Author

Thanks, I try to download some song but send me new error

SCR-20240724-sefn

am I doing something wrong?

@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

Ok, few things

  1. Here's some info about getting the best audio quality . Note that YouTube Music's highest bitrate is 256kbps
  2. --audio youtube.music is wrong. youtube-music is the correct option
  3. zsh: no matches found since you are using zsh on mac you have to put link in quotes
    spotdl download "SpotifyLink" like that

@pcarmonac
Copy link
Author

Thanks, now work perfect by command line now, only YT Music, after 50 song send error and crash the download

image

You know what happend?

@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

Have you changed the number of threads?

Try installing dev version to resolve the YT-DLP errors

pip install -U https://codeload.github.com/spotDL/spotify-downloader/zip/dev

@pcarmonac
Copy link
Author

same error in the same amount of file (around 50 55 files)

image

This is with the dev version

@pcarmonac
Copy link
Author

and now break in another process

image

@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

and now break in another process

image

Follow instructions here: #2142

@xnetcat
Copy link
Member

xnetcat commented Jul 25, 2024

same error in the same amount of file (around 50 55 files)

image This is with the dev version

Can you upload logs with --log-level DEBUG

@pcarmonac
Copy link
Author

Apparently the maximum number of files to download is between 50 and 55, beyond that the link with YT Music becomes saturated (and I have YT Music Prime)

Using --log-level DEBUG

image

@xnetcat
Copy link
Member

xnetcat commented Jul 30, 2024

Follow this steps.

Quick Fix: Use Your Own Client ID and Secret

To avoid these issues, we recommend using your own client ID and secret from Spotify. Here’s how:

  1. Visit the Spotify Developer Dashboard: Go to Spotify Developer Dashboard.
  2. Log In: Sign in or create a Spotify account.
  3. Create a New App: Click "Create an App" and fill in the details. (Set APIs used to Web API and Redirect URIs to http://127.0.0.1:9900/ (or whatever you want to use))
  4. Get Your Credentials: Copy your client ID and secret.

Update Your Settings:

  1. Config File: Update your settings in the config file as described here.
  2. Command Line Options: Alternatively, use the following command line options:
    --client-id CLIENT_ID
    --client-secret CLIENT_SECRET
    

@xnetcat xnetcat closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants