Closed solisinvictum closed 5 months ago
And the Documentation says, if --birate disable is set, it would result in a opus/m4a file. wich isnt true, because it stills outputs a mp3 file.
you have to set the output format manually to m4a or opus, --bitrate
flag only manipulates the bitrate option, because changing the output format is not really intuitive
but --bitrate disable dont work, because it converts everything to 256kbit mp3.
looks like spotDL is getting the 256kbit m4a file correctly
I found out that the only way to get the better format is to use the OPUS file format. I heard somewhere that YouTube does not support MPEG audio format, so using m4A would not work and it would get converted by spotdl. Using OPUS gives me the highest kbps. You just have to convert it afterwards to have it play anywhere.
Dont work either sadly.
you have to set the output format manually to m4a or opus, --bitrate flag only manipulates the bitrate option, because changing the output format is not really intuitive
tried that with m4a and opus. still dont download the highest quality (wich yt-dlp do).
looks like spotDL is getting the 256kbit m4a file correctly
How you verify this? Because it dont matter what i give spotdl to download, everything gets to 256kbit mp3 converted, even if the source file is much lower quality.
Okay I got this to work, and you can confirm using Spek. When you download the cookies, you need to make sure you are downloading all the cookies from your browser. Cookies extension gives you the option to download "All" cookies or just for the "Current Site." After you download them, then you need to make sure you are referencing the file location as well. When you are referencing the file, always use the double slashes (put the backslash symbol twice wherever you see it). That it is how I got it to work. (make sure you are also using the m4a file format and bitrate disable options.)
is any new information available about what goes wrong? The Test Month of Youtube Music Premium is ending soon.
And if this indeed dont work, i have no needs for the subscription.
is any new information available about what goes wrong? The Test Month of Youtube Music Premium is ending soon.
And if this indeed dont work, i have no needs for the subscription.
Logout from YouTube music, login again, change quality in settings to highest and while being on www.music.youtube.com get new cookies.
make sure that you either use --format m4a
or opus. and --bitrate disable
Again, when you click new cookies, you have to click ALL and not Current Site Only. That was my mistake.
is any new information available about what goes wrong? The Test Month of Youtube Music Premium is ending soon.
And if this indeed dont work, i have no needs for the subscription.
Spotdl's YT premium cookie high quality 141 m4a stream download works fine, just try fiddling with the prompt till it works. Bitrate disable needs format to be specified as either m4a or opus to work. It will download either stream 141 m4a or 251 opus without touching it [no conversion]. [*See below] Here's the log so that you can figure things out.
spotdl --format m4a --bitrate disable --cookie-file m.txt --only-verified-results --log-level DEBUG https://music.youtube.com/watch?v=IGuY2HM6Yb0
[15:13:03] DEBUG MainThread - Downloader settings: {'audio_providers': ['youtube-music'], downloader.py:130
'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}
[15:13:03] DEBUG MainThread - FFmpeg path: ffmpeg downloader.py:148
[15:13:03] DEBUG MainThread - Found 0 known songs downloader.py:183
[15:13:06] DEBUG MainThread - Archive: 0 urls downloader.py:230
[15:13:06] DEBUG MainThread - Downloader initialized downloader.py:232
[15:13:06] INFO MainThread - Processing query: https://music.youtube.com/watch?v=IGuY2HM6Yb0 search.py:132
[3:13:08 PM] DEBUG MainThread - Found 1 songs in 0 lists search.py:322
[3:13:08 PM] DEBUG MainThread - Downloading 1 songs downloader.py:279
[3:13:15 PM] DEBUG asyncio_0 - Found lyrics for Tate McRae - greedy on Genius downloader.py:399
[3:13:15 PM] DEBUG asyncio_0 - Downloading Tate McRae - greedy using downloader.py:639
https://music.youtube.com/watch?v=IGuY2HM6Yb0
[3:13:25 PM] INFO asyncio_0 - Downloaded "Tate McRae - greedy": downloader.py:802
https://music.youtube.com/watch?v=IGuY2HM6Yb0
[3:13:25 PM] DEBUG MainThread - Took 18 seconds entry_point.py:151
Here's the file media info:
General
Complete name : Z:\Tate McRae - greedy.m4a
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 4.25 MiB
Duration : 2 min 11 s
Overall bit rate mode : Constant
Overall bit rate : 270 kb/s
Album : greedy
Album/Performer : Tate McRae
Part/Position : 1
Part/Total : 1
Track name : greedy
Track name/Position : 1
Track name/Total : 1
Performer : Tate McRae
Genre : Alt Z
Recorded date : 2023-09-15
Writing application : RCA Records Label
Copyright : (P) 2023 RCA Records, a division of Sony Music Entertainment
Cover : Yes
Lyrics : [Intro] / (Woo) / / [Verse 1] / He said, "Are you serious? I've tried, but I can't figure out / I've been next to you all night and still don't know what you're about / You keep ta- (Ta-ta-), talkin', but not much comin' out your mouth / Can't you tell that I want you?", I say, yeah / [Chorus] / I would want myself / Baby, please believe me / I'll put you through hell / Just to know me, yeah, yeah / So sure of yourself / Baby, don't get greedy / That shit won't end well / (No, it won't) End well / / [Post-Chorus] / (Uh-uh, uh-uh-uh, uh-uh, woo) / / [Verse 2] / I see you eyein' me down, but you'll never know much past my name / Or how I'm runnin' this room around and that I'm still half your age / Yeah, you're loo- (Loo-loo-), lookin' at me like I'm some sweet escape / Obvious that you want me, but I said / / [Chorus] / I would want myself / Baby, please believe me / I'll put you through hell / Just to know me, yeah, yeah / So sure of yourself / Baby, don't get greedy / That shit won't end well / (No, it won't) End well / / [Bridge] / He said, "I'm just curious, is this for real or just an act? / Can't tell if you love or hate me, never met someone like that / Drive me so (So, so) crazy, did you know you got that effect?" / I said, "Lemme check, yeah" / [Chorus] / I would want myself / Baby, please believe me / I'll put you through hell / Just to know me, yeah, yeah / So sure of yourself / Baby, don't get greedy / That shit won't end well / (No, it won't) End well / / [Outro] / (I would want myself) / (I would want myself) / I would want myself / (I would want myself) / (I would want myself) / (Uh-uh, uh-uh-uh, uh)
Comment : https://music.youtube.com/watch?v=IGuY2HM6Yb0
Rating : Explicit
WOAS : https://open.spotify.com/track/3rUGC1vUpkDG9CZFHMur1t
Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 2 min 11 s
Source duration : 2 min 11 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 : 4.02 MiB (95%)
Source stream size : 4.03 MiB (95%)
Title : ISO Media file produced by Google Inc.
Default : Yes
Alternate group : 1
Spek:
Btw, if the cookie file works, then you should see a new higher quality 256 kbps m4a stream ID 141 when you use a YTM link with yt-dlp which is what spotdl downloads if --bitrate disable
and --format m4a
are specified:
yt-dlp -F https://music.youtube.com/watch?v=IGuY2HM6Yb0
ID EXT RESOLUTION FPS CH │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3 mhtml 48x27 1 │ mhtml │ images storyboard
sb2 mhtml 45x45 1 │ mhtml │ images storyboard
sb1 mhtml 90x90 1 │ mhtml │ images storyboard
sb0 mhtml 180x180 1 │ mhtml │ images storyboard
233 mp4 audio only │ m3u8 │ audio only unknown Default, IOS
234 mp4 audio only │ m3u8 │ audio only unknown Default, IOS
599 m4a audio only 2 │ 497.19KiB 31k https │ audio only mp4a.40.5 31k 22k ultralow, ANDR, m4a_dash
600 webm audio only 2 │ 575.64KiB 36k https │ audio only opus 36k 48k ultralow, ANDR, webm_dash
139 m4a audio only 2 │ 787.13KiB 49k https │ audio only mp4a.40.5 49k 22k low, IOS, m4a_dash
249 webm audio only 2 │ 839.51KiB 52k https │ audio only opus 52k 48k low, ANDR, webm_dash
250 webm audio only 2 │ 1.08MiB 69k https │ audio only opus 69k 48k low, ANDR, webm_dash
140 m4a audio only 2 │ 2.04MiB 130k https │ audio only mp4a.40.2 130k 44k medium, IOS, m4a_dash
251 webm audio only 2 │ 2.13MiB 136k https │ audio only opus 136k 48k medium, ANDR, webm_dash
141 m4a audio only 2 │ 4.05MiB 258k https │ audio only mp4a.40.2 258k 44k high, IOS-M, m4a_dash
597 mp4 144x144 13 │ 190.73KiB 12k https │ avc1.4d400a 12k video only 144p, ANDR, mp4_dash
269 mp4 144x144 25 │ ~ 1.20MiB 75k m3u8 │ avc1.4D400B 75k video only IOS
160 mp4 144x144 25 │ 275.33KiB 17k https │ avc1.4D400B 17k video only 144p, IOS, mp4_dash
229 mp4 240x240 25 │ ~ 1.63MiB 101k m3u8 │ avc1.4D400C 101k video only IOS
133 mp4 240x240 25 │ 582.41KiB 36k https │ avc1.4D400C 36k video only 240p, IOS, mp4_dash
230 mp4 360x360 25 │ ~ 4.00MiB 248k m3u8 │ avc1.4D4015 248k video only IOS
134 mp4 360x360 25 │ 1.36MiB 86k https │ avc1.4D4015 86k video only 360p, IOS, mp4_dash
18 mp4 360x360 25 2 │ 2.84MiB 180k https │ avc1.42001E mp4a.40.2 44k 360p, ANDR
231 mp4 480x480 25 │ ~ 5.59MiB 347k m3u8 │ avc1.4D401E 347k video only IOS
135 mp4 480x480 25 │ 2.56MiB 163k https │ avc1.4D401E 163k video only 480p, IOS, mp4_dash
22 mp4 720x720 25 2 │ ≈ 8.76MiB 543k https │ avc1.64001F mp4a.40.2 44k 720p, ANDR
232 mp4 720x720 25 │ ~ 11.87MiB 737k m3u8 │ avc1.64001F 737k video only IOS
136 mp4 720x720 25 │ 6.52MiB 415k https │ avc1.64001F 415k video only 720p, IOS, mp4_dash
270 mp4 1080x1080 25 │ ~ 25.27MiB 1568k m3u8 │ avc1.640020 1568k video only IOS
137 mp4 1080x1080 25 │ 17.23MiB 1097k https │ avc1.640020 1097k video only 1080p, IOS, mp4_dash
602 mp4 144x144 13 │ ~ 1.15MiB 71k m3u8 │ vp09.00.10.08 71k video only IOS
598 webm 144x144 13 │ 242.09KiB 15k https │ vp9 15k video only 144p, ANDR, webm_dash
603 mp4 144x144 25 │ ~ 1.28MiB 79k m3u8 │ vp09.00.11.08 79k video only IOS
278 webm 144x144 25 │ 353.02KiB 22k https │ vp09.00.11.08 22k video only 144p, IOS, webm_dash
604 mp4 240x240 25 │ ~ 1.64MiB 102k m3u8 │ vp09.00.20.08 102k video only IOS
242 webm 240x240 25 │ 618.70KiB 38k https │ vp09.00.20.08 38k video only 240p, IOS, webm_dash
605 mp4 360x360 25 │ ~ 3.86MiB 240k m3u8 │ vp09.00.21.08 240k video only IOS
243 webm 360x360 25 │ 1.19MiB 75k https │ vp09.00.21.08 75k video only 360p, IOS, webm_dash
606 mp4 480x480 25 │ ~ 5.74MiB 356k m3u8 │ vp09.00.30.08 356k video only IOS
244 webm 480x480 25 │ 2.49MiB 159k https │ vp09.00.30.08 159k video only 480p, IOS, webm_dash
609 mp4 720x720 25 │ ~ 12.48MiB 774k m3u8 │ vp09.00.31.08 774k video only IOS
247 webm 720x720 25 │ 7.57MiB 481k https │ vp09.00.31.08 481k video only 720p, IOS, webm_dash
614 mp4 1080x1080 25 │ ~ 29.15MiB 1809k m3u8 │ vp09.00.40.08 1809k video only IOS
248 webm 1080x1080 25 │ 18.99MiB 1208k https │ vp09.00.40.08 1208k video only 1080p, IOS, webm_dash
Again, when you click new cookies, you have to click ALL and not Current Site Only. That was my mistake.
It does not require to download all cookies for me. Extension used is: https://chrome.google.com/webstore/detail/cclelndahbckbenkjhflpdbgdldlbecc
I click on "Export" option that's all. The "Export all" option adds all cookies, even unnecessary ones from other websites.
Again, when you click new cookies, you have to click ALL and not Current Site Only. That was my mistake.
It does not require to download all cookies for me. Extension used is: https://chrome.google.com/webstore/detail/cclelndahbckbenkjhflpdbgdldlbecc
I click on "Export" option that's all. The "Export all" option adds all cookies, even unnecessary ones from other websites.
Odd. I was using a different extension (cookies.txt for Firefox) When I clicked for this site only, it didn’t work.
Odd. I was using a different extension (cookies.txt for Firefox) When I clicked for this site only, it didn’t work.
I don't know why it would require all cookies, but you can try this one if it works. If someone gets a hold of it, the additional info can be a security risk.
https://addons.mozilla.org/en-US/firefox/addon/get-cookies-txt-locally/
This issue has been automatically marked stale because there hasn't been any activity for the last 30 days.
System OS
Linux
Python Version
3.7 (CPython)
Install Source
pip / PyPi
Install version / commit hash
4.2.1
Expected Behavior vs Actual Behavior
spotdl should download the best quality available.
--preserve-original-audio wich i found in the commits got sadly removed and replaced with --bitrate disable
but --bitrate disable dont work, because it converts everything to 256kbit mp3.
but for example for: yt-dlp -F https://music.youtube.com/watch?v=IGuY2HM6Yb0&feature=shared
the best audio quality would be opus 136kbit
And the Documentation says, if --birate disable is set, it would result in a opus/m4a file. wich isnt true, because it stills outputs a mp3 file.
yt-dlp alone (with cookie set), is able to download the best available quality (in this case opus, id 251).
Steps to reproduce - Ensure to include actual links!
spotdl --output "/home/eva/{list-name}/{artist} - {title}.{output-ext}" --cookie-file /home/eva/cookies.txt --audio youtube-music --bitrate disable --only-verified-results https://music.youtube.com/watch?v=IGuY2HM6Yb0 --log-level DEBUG
Traceback
Other details
It would be nice, if the conversion could be disable all together. Every device since Android 1.0 (or the last 13 years) can play opus natively.