spotDL / spotify-downloader

Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
https://spotdl.readthedocs.io/en/latest/
MIT License
16.9k stars 1.55k forks source link

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

Closed pcarmonac closed 1 week ago

pcarmonac commented 1 month ago

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

xnetcat commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

SCR-20240724-sefn

am I doing something wrong?

xnetcat commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

image

This is with the dev version

pcarmonac commented 1 month ago

and now break in another process

image
xnetcat commented 1 month ago

and now break in another process

image

Follow instructions here: https://github.com/spotDL/spotify-downloader/issues/2142

xnetcat commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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