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
15.68k stars 1.49k forks source link

Cookie file and bitrate arguments doesn't work. #1961

Closed bkdwt closed 7 months ago

bkdwt commented 8 months ago

System OS

Windows

Python Version

3.11 (CPython)

Install Source

pip / PyPi

Install version / commit hash

3.9.6

Expected Behavior vs Actual Behavior

No response

Steps to reproduce - Ensure to include actual links!

spotdl https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83 --cookie-file cookies.txt --bitrate disable

spotdl --cookie-file cookies.txt --bitrate disable https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83

Traceback

usage: spotdl [-h] [--version] [--debug-termination] [--output OUTPUT] [--output-format {ogg,flac,opus,wav,m4a,mp3}]
              [--user-auth] [--use-youtube] [--lyrics-provider {genius,musixmatch}] [-p PATH_TEMPLATE] [-f FFMPEG]
              [--ignore-ffmpeg-version] [--download-threads DOWNLOAD_THREADS] [--search-threads SEARCH_THREADS]
              [--generate-m3u]
              query [query ...]
spotdl: error: unrecognized arguments: --cookie-file cookies.txt --bitrate disable

Other details

Using Python 3.12.0. I have tried both commands to download but doesn't work.

supremeinspirit commented 8 months ago

i am having the exact same issue. cookies file is named right and placed in right folder. some commands don´t seem to exist or cannot be found.

jnxr commented 8 months ago

It is working exactly as it is supposed to for me > spotdl version 4.2.1(Win). PY version is 3.11.

Edit: You need to change format to m4a in order to get the untouched HQ m4a stream from ytm using the cookie file. If you specify --bitrate-disable without specifying the format as m4a, it should just give you the default file format which is mp3 at approximately 128kbps.

bkdwt commented 7 months ago

It is working exactly as it is supposed to for me > spotdl version 4.2.1(Win). PY version is 3.11.

Edit: You need to change format to m4a in order to get the untouched HQ m4a stream from ytm using the cookie file. If you specify --bitrate-disable without specifying the format as m4a, it should just give you the default file format which is mp3 at approximately 128kbps.

The problem persists:

spotdl https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83 --cookie-file cookies.txt --bitrate disable --format m4a
usage: spotdl [-h] [--version] [--debug-termination] [--output OUTPUT] [--output-format {wav,ogg,mp3,opus,m4a,flac}]
              [--user-auth] [--use-youtube] [--lyrics-provider {genius,musixmatch}] [-p PATH_TEMPLATE] [-f FFMPEG]
              [--ignore-ffmpeg-version] [--download-threads DOWNLOAD_THREADS] [--search-threads SEARCH_THREADS]
              [--generate-m3u]
              query [query ...]
spotdl: error: unrecognized arguments: --cookie-file cookies.txt --bitrate disable --format m4a 
jnxr commented 7 months ago

The problem persists:

spotdl https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83 --cookie-file cookies.txt --bitrate disable --format m4a
usage: spotdl [-h] [--version] [--debug-termination] [--output OUTPUT] [--output-format {wav,ogg,mp3,opus,m4a,flac}]
              [--user-auth] [--use-youtube] [--lyrics-provider {genius,musixmatch}] [-p PATH_TEMPLATE] [-f FFMPEG]
              [--ignore-ffmpeg-version] [--download-threads DOWNLOAD_THREADS] [--search-threads SEARCH_THREADS]
              [--generate-m3u]
              query [query ...]
spotdl: error: unrecognized arguments: --cookie-file cookies.txt --bitrate disable --format m4a 

It is working as it usually does for me on my win VM:

spotdl --format m4a --bitrate disable --cookie-file m.txt --only-verified-results --log-level DEBUG https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83

[05:21:02] DEBUG    MainThread - Downloader settings:               downloader.py:130
                    {'audio_providers': ['youtube-music'],
                    'lyrics_providers': ['genius', 'azlyrics',
                    'musixmatch'], 'playlist_numbering': False,
                    'scan_for_songs': False, 'm3u': None, 'output':
                    '{artists} - {title}.{output-ext}',
                    'overwrite': 'skip', 'search_query': None,
                    'ffmpeg': 'ffmpeg', 'bitrate': 'disable',
                    'ffmpeg_args': None, 'format': 'm4a',
                    'save_file': None, 'filter_results': True,
                    'threads': 4, 'cookie_file': 'm.txt',
                    'restrict': None, 'print_errors': False,
                    'sponsor_block': False, 'preload': False,
                    'archive': None, 'load_config': True,
                    'log_level': 'DEBUG', 'simple_tui': False,
                    'fetch_albums': False, 'id3_separator': '/',
                    'ytm_data': False, 'add_unavailable': False,
                    'generate_lrc': False, 'force_update_metadata':
                    False, 'only_verified_results': True,
                    'sync_without_deleting': False,
                    'max_filename_length': None, 'yt_dlp_args':
                    None, 'detect_formats': None, 'save_errors':
                    None, 'ignore_albums': None, 'proxy': None,
                    'skip_explicit': False, 'log_format': None,
                    'redownload': False}
[05:21:02] DEBUG    MainThread - FFmpeg path: ffmpeg                downloader.py:148
[05:21:02] DEBUG    MainThread - Found 0 known songs                downloader.py:183
[05:21:04] DEBUG    MainThread - Archive: 0 urls                    downloader.py:230
[05:21:04] DEBUG    MainThread - Downloader initialized             downloader.py:232
[05:21:04] INFO     MainThread - Processing query:                      search.py:132
                    https://open.spotify.com/intl-pt/track/5t8NXa2fugcT
                    PsTfhVILmS?si=4602cbf8ba6a4b83
[05:21:05] DEBUG    MainThread - Found 1 songs in 0 lists               search.py:322
[05:21:05] DEBUG    MainThread - Downloading 1 songs                downloader.py:279
[05:21:09] DEBUG    asyncio_0 - Found lyrics for Jinjer - Pisces on downloader.py:399
                    Genius
[05:21:09] DEBUG    asyncio_0 - [5t8NXa2fugcTPsTfhVILmS] Searching for    base.py:167
                    jinjer - pisces
[05:21:09] DEBUG    asyncio_0 - [5t8NXa2fugcTPsTfhVILmS] Found 1 results  base.py:180
                    for ISRC ATN261667709
[05:21:09] DEBUG    asyncio_0 - [5t8NXa2fugcTPsTfhVILmS] Filtered to 1    base.py:192
                    ISRC results
[05:21:09] DEBUG    asyncio_0 - [5t8NXa2fugcTPsTfhVILmS] Best ISRC result base.py:201
                    is https://music.youtube.com/watch?v=sq7DG1NFXAw with
                    score 100.0
[05:21:09] DEBUG    asyncio_0 - Downloading Jinjer - Pisces using   downloader.py:639
                    https://music.youtube.com/watch?v=sq7DG1NFXAw
[05:21:23] INFO     asyncio_0 - Downloaded "Jinjer - Pisces":       downloader.py:802
                    https://music.youtube.com/watch?v=sq7DG1NFXAw
[05:21:23] DEBUG    MainThread - Took 19 seconds                   entry_point.py:151
General
Complete name               : Jinjer - Pisces.m4a
Format                      : MPEG-4
Format profile              : Base Media
Codec ID                    : isom (isom/iso2/mp41)
File size                   : 9.51 MiB
Duration                    : 5 min 5 s
Overall bit rate mode       : Constant
Overall bit rate            : 261 kb/s
Album                       : King of Everything
Album/Performer             : Jinjer
Part/Position               : 1
Part/Total                  : 1
Track name                  : Pisces
Track name/Position         : 9
Track name/Total            : 10
Performer                   : Jinjer
Genre                       : Slayer
Recorded date               : 2016-07-29
Writing application         : Napalm Records
Copyright                   : (C) 2016 Napalm Records Handels GmbH
Cover                       : Yes
Lyrics                      : [Verse 1] / Step forward and meet a new sunrise / A coward is shivering inside / Today, I'll, I'll be a friend of mine / Who swallows suffering with smile / I drew a different reality / With unconditional loyalty / Ego hardly can be piqued / 'Cause I'm selfless /  / [Chorus] / Scale armour blaze / Virgin innocence / One being brings life / Another runs for death / Scale armour blaze / Virgin innocence / One being brings life / Another runs for death /  / [Verse 2] / No promises I ever give / Don't rely on me and I won't deceive / The beginning or the end, you can't tell / When I wave my fin and shake my tail / I grew in different normality / With unblamable morality / Hooks and nets are there for me / But I'm skittish /  / [Chorus] / Scale armour blaze / Virgin innocence / One being brings life / Another runs for death / Scale armour blaze / Virgin innocence / One being brings life / Another runs for death /  / [Verse 3] / Neptune's child shivering inside / Drowns in the liquid gold / Cherished his life to the underworld / Meet me flashing when the winter cries /  / [Outro] / Pisces swimming through the river / All their life against the stream / Searching for a hook to catch on / And see their sun beam / Then suffocate in painful tortures / On cutting tables of callous men / Under a knife of handsome butchers / Emeralds are ripped away / Emeralds are ripped away / Emeralds are ripped away / Emeralds are ripped away
Comment                     : https://music.youtube.com/watch?v=sq7DG1NFXAw
Rating                      : Clean
WOAS                        : https://open.spotify.com/track/5t8NXa2fugcTPsTfhVILmS

Audio
ID                          : 1
Format                      : AAC LC
Format/Info                 : Advanced Audio Codec Low Complexity
Codec ID                    : mp4a-40-2
Duration                    : 5 min 5 s
Source duration             : 5 min 5 s
Bit rate mode               : Constant
Bit rate                    : 256 kb/s
Channel(s)                  : 2 channels
Channel layout              : L R
Sampling rate               : 44.1 kHz
Frame rate                  : 43.066 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                 : 9.33 MiB (98%)
Source stream size          : 9.33 MiB (98%)
Title                       : ISO Media file produced by Google Inc.
Default                     : Yes
Alternate group             : 1

image

bkdwt commented 7 months ago

@jnxr

I really don't know what in the hell is happening here. Oo

spotdl --format m4a --bitrate disable --cookie-file music.youtube.com_cookies.txt --only-verified-results --log-level DEBUG https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83
usage: spotdl [-h] [--version] [--debug-termination] [--output OUTPUT] [--output-format {wav,ogg,m4a,mp3,flac,opus}]
              [--user-auth] [--use-youtube] [--lyrics-provider {genius,musixmatch}] [-p PATH_TEMPLATE] [-f FFMPEG]
              [--ignore-ffmpeg-version] [--download-threads DOWNLOAD_THREADS] [--search-threads SEARCH_THREADS]
              [--generate-m3u]
              query [query ...]
spotdl: error: unrecognized arguments: --format --bitrate disable --cookie-file music.youtube.com_cookies.txt --only-verified-results --log-level DEBUG https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83 

The funny thing is: with Instagram, works like a charm.

yt-dlp --cookies www.instagram.com_cookies.txt https://www.instagram.com/stories/_XXXXXX/3242461911396XXXXXX/
[instagram:story] Extracting URL: https://www.instagram.com/stories/_XXXXXXX/3242461911396XXXXXX/
[instagram:story] 324246191139XXXXXXX: Downloading webpage
[instagram:story] 3242461911396XXXXXX: Downloading JSON metadata
[download] Downloading playlist: Story by _XXXXXX
[instagram:story] Playlist Story by _XXXXXXXX: Downloading 2 items of 2
[download] Downloading item 1 of 2
[info] Cz958N7gr2G: Downloading 1 format(s): 1393083718279087v-2
[download] Destination: Video by None [Cz958N7gr2G].mp4
[download] 100% of    1.78MiB in 00:00:00 at 5.57MiB/s
[download] Downloading item 2 of 2
[info] Cz_ie3agI6P: Downloading 1 format(s): 1149368239373889v-2
[download] Destination: Video by None [Cz_ie3agI6P].mp4
[download] 100% of    2.74MiB in 00:00:00 at 6.49MiB/s
[download] Finished downloading playlist: Story by _XXXXXXXX
jnxr commented 7 months ago

@jnxr

I really don't know what in the hell is happening here. Oo

spotdl --format m4a --bitrate disable --cookie-file music.youtube.com_cookies.txt --only-verified-results --log-level DEBUG https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83
usage: spotdl [-h] [--version] [--debug-termination] [--output OUTPUT] [--output-format {wav,ogg,m4a,mp3,flac,opus}]
              [--user-auth] [--use-youtube] [--lyrics-provider {genius,musixmatch}] [-p PATH_TEMPLATE] [-f FFMPEG]
              [--ignore-ffmpeg-version] [--download-threads DOWNLOAD_THREADS] [--search-threads SEARCH_THREADS]
              [--generate-m3u]
              query [query ...]
spotdl: error: unrecognized arguments: --format --bitrate disable --cookie-file music.youtube.com_cookies.txt --only-verified-results --log-level DEBUG https://open.spotify.com/intl-pt/track/5t8NXa2fugcTPsTfhVILmS?si=4602cbf8ba6a4b83 

The funny thing is: with Instagram, works like a charm.

yt-dlp --cookies www.instagram.com_cookies.txt https://www.instagram.com/stories/_XXXXXX/3242461911396XXXXXX/
[instagram:story] Extracting URL: https://www.instagram.com/stories/_XXXXXXX/3242461911396XXXXXX/
[instagram:story] 324246191139XXXXXXX: Downloading webpage
[instagram:story] 3242461911396XXXXXX: Downloading JSON metadata
[download] Downloading playlist: Story by _XXXXXX
[instagram:story] Playlist Story by _XXXXXXXX: Downloading 2 items of 2
[download] Downloading item 1 of 2
[info] Cz958N7gr2G: Downloading 1 format(s): 1393083718279087v-2
[download] Destination: Video by None [Cz958N7gr2G].mp4
[download] 100% of    1.78MiB in 00:00:00 at 5.57MiB/s
[download] Downloading item 2 of 2
[info] Cz_ie3agI6P: Downloading 1 format(s): 1149368239373889v-2
[download] Destination: Video by None [Cz_ie3agI6P].mp4
[download] 100% of    2.74MiB in 00:00:00 at 6.49MiB/s
[download] Finished downloading playlist: Story by _XXXXXXXX

Uninstall it and then install the latest version and recreate the prompt exactly as mine and try what happens.

xnetcat commented 7 months ago

Downgrade your python to 3.11 or 3.10. Python 3.12 is not yet supported and it can't install spotdl V4

bkdwt commented 7 months ago

@xnetcat @jnxr Installed python 3.11.6 and reinstalled spotdl with pip. Now works! Thanks so much! \o