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

Downloading music from youtube just doesn't work for me recently, no matter what. #19

Open
Qerkuu opened this issue Feb 9, 2025 · 49 comments
Assignees

Comments

@Qerkuu
Copy link

Qerkuu commented Feb 9, 2025

$ ERROR: unable to download video data: HTTP Error 403: Forbidden
[ERROR 22:04:04] Failed to download "Shine a Light (Flight Facilities Remix)"
(track 1/1 from URL 1/1)
[ERROR 22:04:04]
Traceback (most recent call last):
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3489, in process_info
success, real_download = self.dl(temp_filename, info_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3209, in dl
return fd.download(name, new_info, subtitle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\downloader\common.py", line 464, in download
ret = self.real_download(filename, info_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\downloader\http.py", line 367, in real_download
establish_connection()
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\downloader\http.py", line 118, in establish_connection
ctx.data = self.ydl.urlopen(request)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 4172, in urlopen
return self._request_director.send(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\networking\common.py", line 117, in send
response = handler.send(request)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\networking_helper.py", line 208, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\networking\common.py", line 340, in send
return self._send(request)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\networking_requests.py", line 365, in _send
raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\shira\shiradl\cli.py", line 178, in cli
dl.download(track["id"], temp_location)
File "C:\Users\shira\shiradl\dl.py", line 221, in download
ydl.download("music.youtube.com/watch?v=" + video_id)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3615, in download
self.__download_wrapper(self.extract_info)(
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3588, in wrapper
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1623, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extr
a_info, process)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1634, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1790, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1869, in process_ie_result
return self.extract_info(
^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1623, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extr
a_info, process)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1634, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1790, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1849, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3021, in process_video_result
self.process_info(new_info)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 177, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 3498, in process_info
self.report_error(f'unable to download video data: {err}')
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1092, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *
args, **kwargs)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages
\yt_dlp\YoutubeDL.py", line 1031, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: unable to download video data: HTTP Error 403
: Forbidden

@marriedtopython
Copy link

might just be youtube blocking your IP address:

What i did was:

  1. have a alternate or old google account, (has to be like atleast 8 months due to google thinking your a bot)
  2. Get the cookie extension, then enable it in incognito
  3. In incoginto, sign into that google account and extract that cookie file using the extension
  4. In shira, use the -c flag to enable cookie file and just point to where you save it
    It should work then

@KraXen72
Copy link
Owner

can you please post the URL?
also, update your yt-dlp:

pip install --upgrade yt-dlp

alternatively:

python3 -m pip install --upgrade yt-dlp

@Qerkuu
Copy link
Author

Qerkuu commented Feb 11, 2025

Updating yt-dlp didn't work and my URL is https://music.youtube.com/watch?v=T6_Bvdc_dFU.

So I didn't understand the first reply at first and I digged into debuging myself, now I know it was right all along, here's what I know now:
The error happens due to lack of Proof of Origin (PO) Token wich is a parameter that YouTube requires to be sent with requests from some clients. Without it, requests for the affected clients' format URLs may return HTTP Error 403, or result in your account or IP address being blocked.

Like the first reply suggested you need to get your cookies files and the official yt-dlp documentations suggest using a browser extension for that. The cookies need to be exported from a fresh bowser session (within the past 30 minutes) and you need to get them every time you want to use the tool if they weren't exported in the past 30 minutes.

And at the end I noticed that there is no config file in shiradl folder? It doesn't create at all for me maybe that's why it's not working because yt-dlp doesn't get the cookies through shira?

When I downloaded the song using yt-dlp with --cookies cookies.txt it works, just not using shira :/

Idk if what I just wrote makes any sense and sorry if it doesn't :D

@marriedtopython
Copy link

it works with shira

I think the command is:
'python3 m shiradl -c pathtocookie LINK'

im not on my computer so when I am I'll confirm or just post it again

@KraXen72
Copy link
Owner

i haven't tested the cookie option, that was implemented by the previous developer Glomatico, but it should work.

@marriedtopython
Copy link

python -m shiradl -c cookies.txt https://music.youtube.com/playlist?list=PLC1og_v3eb4jE0bmdkWtizrSQ4zt86-3D

Should be like that, if that doesn't work just use yt-dl. Working on a CLI application that should do what shira does

@Qerkuu
Copy link
Author

Qerkuu commented Feb 11, 2025

$ python -m shiradl -c m_cookies.txt https://music.youtube.com/watch?v=T6_Bvdc_dFU
[INFO 22:00:09] Downloading "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
ERROR: [youtube:tab] None: Playlists that require authentication may not extract correctly without a s
uccessful webpage download. If you are not downloading private content, or your cookies are only for t
he first account and channel, pass "--extractor-args youtubetab:skip=authcheck" to skip this check
[ERROR 22:00:12] Failed to download "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1
/1)
[ERROR 22:00:12]
Traceback (most recent call last):
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1637, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1772, in __extract_info
ie_result = ie.extract(url)
^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\comm
on.py", line 742, in extract
ie_result = self._real_extract(url)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\yout
ube.py", line 5167, in wrapper
info_dict = func(self, url, smuggled_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\yout
ube.py", line 7143, in _real_extract
data, ytcfg = self._extract_data(url, display_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\yout
ube.py", line 5931, in _extract_data
self._report_playlist_authcheck(ytcfg, fatal=fatal)
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\yout
ube.py", line 5909, in _report_playlist_authcheck
raise ExtractorError(
yt_dlp.utils.ExtractorError: [youtube:tab] None: Playlists that require authentication may not extract
correctly without a successful webpage download. If you are not downloading private content, or your
cookies are only for the first account and channel, pass "--extractor-args youtubetab:skip=authcheck"
to skip this check

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\stasi\shira\shiradl\cli.py", line 161, in cli
tags = dl.get_tags(ytmusic_watch_playlist, track)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\shira\shiradl\dl.py", line 125, in get_tags
return self.__collect_tags(ytmusic_watch_playlist, track)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\shira\shiradl\dl.py", line 151, in __collect_tags
for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(y
tmusic_album["audioPlaylistId"])}')["entries"]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\shira\shiradl\dl.py", line 60, in get_ydl_extract_info
info = ydl.extract_info(url, download=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1626, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1655, in wrapper
self.report_error(str(e), e.format_traceback())
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1095, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "C:\Users\stasi\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py",
line 1034, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Playlists that require authentication may not e
xtract correctly without a successful webpage download. If you are not downloading private content, or
your cookies are only for the first account and channel, pass "--extractor-args youtubetab:skip=authc
heck" to skip this check
[INFO 22:00:13] Done (1 error(s))

:////////

@marriedtopython
Copy link

that's weird. didn't do that for me, how recent are your cookies?
also did you export them in a incognito page?
thanks

@Qerkuu
Copy link
Author

Qerkuu commented Feb 11, 2025

just now and yes I exported them using incognito :/

@marriedtopython
Copy link

must be a issue with how the code handles the cookie file, that sucks. Can you use yt-dl w / metadata or not? Might publish my cli application that should work tbh

@Qerkuu
Copy link
Author

Qerkuu commented Feb 11, 2025

using yt-dl work with metadata but it's not the same ://// It's WEBM and the meta is only the song cover :<

@marriedtopython
Copy link

marriedtopython commented Feb 11, 2025 via email

@Qerkuu
Copy link
Author

Qerkuu commented Feb 11, 2025

yeah, thanks for trying to help :D

@marriedtopython
Copy link

No problem :)

@KraXen72
Copy link
Owner

i don't really know who exactly i'm supposed to fix this since it does not occur for everybody.
I can try testing it myself with a cookie file of my own later, but no promises on the ETA.
are you trying to download a private playlist, @Qerkuu ? or just a public one and it's still not working?

if anybody can reproduce this, i'd appreicate any pointers as to why it might be happening or better yet, a pull request with a fix :)
Thank you.

@KraXen72
Copy link
Owner

@marriedtopython if you're interested, since you said you're working on something similar to shira, just know that shira is open to contributions, so feel free to open feature requests / pull requests for features/functionality you're missing and i'll very likely merge them

@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

@KraXen72 I'm trying to download a publicly avalaible song under this link https://music.youtube.com/watch?v=T6_Bvdc_dFU

@marriedtopython
Copy link

@marriedtopython if you're interested, since you said you're working on something similar to shira, just know that shira is open to contributions, so feel free to open feature requests / pull requests for features/functionality you're missing and i'll very likely merge them

Sure, I'll see. Don't mind helping

@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

@KraXen72 also I noticed that the %USERPROFILE%.shiradl\config.json file doesn't generate for me automatically, I just don't have it at all????, don't know if this changes anything

@marriedtopython
Copy link

@KraXen72 I'm trying to download a publicly avalaible song under this link https://music.youtube.com/watch?v=T6_Bvdc_dFU

Try use YouTube not yt music and see what happens?

@KraXen72
Copy link
Owner

@Qerkuu

  1. a config file not being generated is silghtly concerning but it doesen't matter since there are defaults in the program so it works anyway

  2. i tried your link and i'm getting an error as well, but i think it's a different one. anyway, i'll investigate it, just can't promise when.

yt_dlp.utils.ExtractorError: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/media/win/coding/python/shira/shiradl/cli.py", line 161, in cli
    tags = dl.get_tags(ytmusic_watch_playlist, track)
  File "/media/win/coding/python/shira/shiradl/dl.py", line 126, in get_tags
    return self.__collect_tags(ytmusic_watch_playlist, track)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/win/coding/python/shira/shiradl/dl.py", line 152, in __collect_tags
    for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(ytmusic_album["audioPlaylistId"])}')["entries"]):
                              ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/win/coding/python/shira/shiradl/dl.py", line 60, in get_ydl_extract_info
    info = ydl.extract_info(url, download=False)
  File "/home/nex/.local/lib/python3.13/site-packages/yt_dlp/YoutubeDL.py", line 1626, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nex/.local/lib/python3.13/site-packages/yt_dlp/YoutubeDL.py", line 1655, in wrapper
    self.report_error(str(e), e.format_traceback())
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nex/.local/lib/python3.13/site-packages/yt_dlp/YoutubeDL.py", line 1095, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nex/.local/lib/python3.13/site-packages/yt_dlp/YoutubeDL.py", line 1034, in trouble
    raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[INFO     09:42:39] Done (1 error(s))

this is the error i'm getting (for anyone else who might need it)

@KraXen72 KraXen72 self-assigned this Feb 12, 2025
@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

@KraXen72 I'm on a different PC that's almost clean, installed python, shiradl,
ffmpeg, added everything to PATH and installed the requirements. First of all I got this error:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\USER3\shira\shiradl_main
.py", line 1, in
from .cli import cli
File "C:\Users\USER3\shira\shiradl\cli.py", line 9, in
from mbtag.musicbrainz import musicbrainz_enrich_tags
File "C:\Users\USER3\shira\mbtag\musicbrainz.py", line 8, in
from shiradl.metadata import clean_title, parse_datestring
File "C:\Users\USER3\shira\shiradl\metadata.py", line 9, in
from .tagging import Tags, get_1x1_cover
File "C:\Users\USER3\shira\shiradl\tagging.py", line 10, in
from dateutil import parser
ModuleNotFoundError: No module named 'dateutil'
And yeah you just need to do python -m pip install python-dateutil, but it's a thing you should maybe also add to the tutorial? idk

About the error I got the exact same trying to download this song from youtube music, so like @marriedtopython suggested I downloaded the song but using youtube (https://youtu.be/K57dVZ4oHtQ?feature=shared) and it works!!! So it's something with youtube music ://

@marriedtopython
Copy link

marriedtopython commented Feb 12, 2025 via email

@KraXen72
Copy link
Owner

KraXen72 commented Feb 12, 2025

i'll add dateutil to requirement.txt
and add a check where if it fails using youtube music, it'll retry using a normal youtube link / youtube shorturl like you did (more testing required on my side)

@marriedtopython
Copy link

i'll add dateutil to requirement.txt
and add a check where if it fails using youtube music, it'll retry using a normal youtube link / youtube shorturl like you did (more testing required on my side)

I can test when I get home but that wouldn't be dor like the next 4/5 hours or so

@KraXen72
Copy link
Owner

likely won't be today, but we'll see. i'll mention you when it's added

@marriedtopython
Copy link

likely won't be today, but we'll see. i'll mention you when it's added

Cool, I'll try to help with the downloading thing with my fork of shira

@2V3EvG4LMJFdRe
Copy link

2V3EvG4LMJFdRe commented Feb 12, 2025

Started happening to me as well a couple of days ago. It broke gytmdl as well.

@marriedtopython
Copy link

could be how yt-dlp tries to structure YTMUSIC playlists, I investiaged the error and it seems like yt-dlp is asking for a specific format, (could be due to a api error) and if one isnt specified then it just bugs out.
my suggestion would be in dl.py it should specify what format and bitrate ytmusic should use.
i am kinda free now so I'll try to fix the bug aswell

@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

Back on my PC and downloading using youtube doesn't work too 😭

$ python -m shiradl https://youtu.be/T6_Bvdc_dFU?si=8x1_pUGrUrrsSGJ4
[INFO 23:32:28] Downloading "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[ERROR 23:32:30] Failed to download "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[INFO 23:32:30] Done (1 error(s))

@marriedtopython
Copy link

Is there any more errors or is it just like that?

btw does it ask about formats?
thanks

@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

don't see anything about formats, this is the whole error messeage:

$ python -m shiradl https://youtu.be/T6_Bvdc_dFU?si=8x1_pUGrUrrsSGJ4
[INFO 23:32:28] Downloading "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[ERROR 23:32:30] Failed to download "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
[ERROR 23:32:30]
Traceback (most recent call last):
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 898, in _request_webpage
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query, extensions))
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 4175, in urlopen
return self._request_director.send(req)
File "C:\Users...\Lib\site-packages\yt_dlp\networking\common.py", line 117, in send
response = handler.send(request)
File "C:\Users...\Lib\site-packages\yt_dlp\networking_helper.py", line 208, in wrapper
return func(self, *args, **kwargs)
File "C:\Users...\Lib\site-packages\yt_dlp\networking\common.py", line 340, in send
return self._send(request)
File "C:\Users...\Lib\site-packages\yt_dlp\networking_requests.py", line 365, in _send
raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1637, in wrapper
return func(self, *args, **kwargs)
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1772, in __extract_info
ie_result = ie.extract(url)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 742, in extract
ie_result = self._real_extract(url)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5167, in wrapper
info_dict = func(self, url, smuggled_data)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 7143, in _real_extract
data, ytcfg = self._extract_data(url, display_id)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5932, in _extract_data
data = self._extract_tab_endpoint(url, item_id, ytcfg, fatal=fatal, default_client=default_client)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5937, in _extract_tab_endpoint
resolve_response = self._extract_response(
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1145, in _extract_response
next(main_retries)
File "C:\Users...\Lib\site-packages\yt_dlp\utils_utils.py", line 5254, in iter
self.error_callback(self.error, self.attempt, self.retries)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 3909, in _error_or_warning
RetryManager.report_retry(
File "C:\Users...\Lib\site-packages\yt_dlp\utils_utils.py", line 5262, in report_retry
raise e
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1118, in _extract_response
response = self._call_api(
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\youtube.py", line 717, in _call_api
return self._download_json(
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 1152, in download_content
res = getattr(self, download_handle.name)(url_or_request, video_id, **kwargs)
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 1112, in download_handle
res = self._download_webpage_handle(
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 962, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data,
File "C:\Users...\Lib\site-packages\yt_dlp\extractor\common.py", line 911, in _request_webpage
raise ExtractorError(errmsg, cause=err)
yt_dlp.utils.ExtractorError: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users...\shiradl\cli.py", line 161, in cli
tags = dl.get_tags(ytmusic_watch_playlist, track)
File "C:\Users...\shiradl\dl.py", line 125, in get_tags
return self.__collect_tags(ytmusic_watch_playlist, track)
File "C:\Users...\shiradl\dl.py", line 151, in __collect_tags
for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(ytmusic_album["audioPlaylistId"])}')["entries"]):
File "C:\Users...\shiradl\dl.py", line 60, in get_ydl_extract_info
info = ydl.extract_info(url, download=False)
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1626, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1655, in wrapper
self.report_error(str(e), e.format_traceback())
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1095, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "C:\Users...\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1034, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[INFO 23:32:30] Done (1 error(s))

Also this is the error messeage I get when trying to use the program with cookies:

$ python -m shiradl -c cukies.txt https://youtu.be/T6_Bvdc_dFU?si=8x1_pUGrUrrsSGJ4
[INFO 23:35:41] Downloading "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
ERROR: [youtube:tab] None: Playlists that require authentication may not extract correctly without a successful webpage download. If you are not downloading private content, or your cookies are only for
the first account and channel, pass "--extractor-args youtubetab:skip=authcheck" to skip this check
[ERROR 23:35:43] Failed to download "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)
[ERROR 23:35:43]
Traceback (most recent call last):
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1637, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1772, in __extract_info
ie_result = ie.extract(url)
^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\common.py", line 742, in extract
ie_result = self._real_extract(url)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5167, in wrapper
info_dict = func(self, url, smuggled_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\youtube.py", line 7143, in _real_extract
data, ytcfg = self._extract_data(url, display_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5931, in _extract_data
self._report_playlist_authcheck(ytcfg, fatal=fatal)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5909, in _report_playlist_authcheck
raise ExtractorError(
yt_dlp.utils.ExtractorError: [youtube:tab] None: Playlists that require authentication may not extract correctly without a successful webpage download. If you are not downloading private content, or your
cookies are only for the first account and channel, pass "--extractor-args youtubetab:skip=authcheck" to skip this check

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\shira\shiradl\cli.py", line 161, in cli
tags = dl.get_tags(ytmusic_watch_playlist, track)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\shira\shiradl\dl.py", line 125, in get_tags
return self.__collect_tags(ytmusic_watch_playlist, track)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\shira\shiradl\dl.py", line 151, in __collect_tags
for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(ytmusic_album["audioPlaylistId"])}')["entries"]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\shira\shiradl\dl.py", line 60, in get_ydl_extract_info
info = ydl.extract_info(url, download=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1626, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1655, in wrapper
self.report_error(str(e), e.format_traceback())
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1095, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1034, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Playlists that require authentication may not extract correctly without a successful webpage download. If you are not downloading private content, o
r your cookies are only for the first account and channel, pass "--extractor-args youtubetab:skip=authcheck" to skip this check
[INFO 23:35:43] Done (1 error(s))

@marriedtopython
Copy link

one error i keep seeing is this:
ERROR: [youtube:tab] None: Playlists that require authentication may not extract correctly without a successful webpage download. If you are not downloading private content, or your cookies are only for
the first account and channel, pass "--extractor-args youtubetab:skip=authcheck" to skip this check
[ERROR 23:35:43] Failed to download "Shine a Light (Flight Facilities Remix)" (track 1/1 from URL 1/1)

can you confirm that your playlist is privated / unlisted? if it is, try publicising it and try again?

@Qerkuu
Copy link
Author

Qerkuu commented Feb 12, 2025

The link is in my messeage, not a playlist nor a private video, public song. https://youtu.be/T6_Bvdc_dFU?si=8x1_pUGrUrrsSGJ4

@Qerkuu
Copy link
Author

Qerkuu commented Feb 13, 2025

So I'm back on the clean PC that worked yesterday

About the error I got the exact same trying to download this song from youtube music, so like @marriedtopython suggested I downloaded the song but using youtube (https://youtu.be/K57dVZ4oHtQ?feature=shared) and it works!!! So it's something with youtube music ://

I tried to download a txt file of link all from youtube, not youtube music and some of them work some of them don't, maybe they are on youtube but somehow using youtube music?

[INFO 08:45:17] Downloading "Jamiroquai - Virtual Insanity (Official Video)" (track 1/1 from URL 12/23)
[INFO 08:45:19] No results on YTMusic API, using Tigerv2 to extract metadata
[INFO 08:45:24] Downloading "King (2008 Remaster)" (track 1/1 from URL 13/23)
ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[ERROR 08:45:27] Failed to download "King (2008 Remaster)" (track 1/1 from URL 13/23)
[ERROR 08:45:27]
Traceback (most recent call last):
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 898, in _r
equest_webpage
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query, extensions))
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 4175, in urlopen
return self._request_director.send(req)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking\common.py", line 117, in s
end
response = handler.send(request)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking_helper.py", line 208, in
wrapper
return func(self, *args, **kwargs)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking\common.py", line 340, in s
end
return self._send(request)
~~~~~~~~~~^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking_requests.py", line 365, i
n _send
raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1637, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1772, in __extrac
t_info
ie_result = ie.extract(url)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 742, in ex
tract
ie_result = self._real_extract(url)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5167, in
wrapper
info_dict = func(self, url, smuggled_data)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 7143, in
_real_extract
data, ytcfg = self._extract_data(url, display_id)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5932, in
_extract_data
data = self._extract_tab_endpoint(url, item_id, ytcfg, fatal=fatal, default_client=default_client)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5937, in
_extract_tab_endpoint
resolve_response = self._extract_response(
item_id=item_id, query={'url': url}, check_get_keys='endpoint', headers=headers, ytcfg=ytcfg, fatal=fatal,
ep='navigation/resolve_url', note='Downloading API parameters API JSON', default_client=default_client)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1145, in
_extract_response
next(main_retries)
~~~~^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\utils_utils.py", line 5254, in ite
r

self.error_callback(self.error, self.attempt, self.retries)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 3909, in _
error_or_warning
RetryManager.report_retry(
~~~~~~~~~~~~~~~~~~~~~~~~~^
err, _count or int(fatal), _retries,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
info=self.to_screen, warn=self.report_warning, error=None if fatal else self.report_warning,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sleep_func=self.get_param('retry_sleep_functions', {}).get('extractor'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\utils_utils.py", line 5262, in repor
t_retry
raise e
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1118, in
_extract_response
response = self._call_api(
ep=ep, fatal=True, headers=headers,
video_id=item_id, query=query, note=note,
context=self._extract_context(ytcfg, default_client),
api_hostname=api_hostname, default_client=default_client)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 717, in _
call_api
return self._download_json(
~~~~~~~~~~~~~~~~~~~^
f'https://{self._select_api_hostname(api_hostname, default_client)}/youtubei/v1/{ep}',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
'prettyPrint': 'false',
^^^^^^^^^^^^^^^^^^^^^^^
}, cndn=lambda _, v: v))
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 1152, in d
ownload_content
res = getattr(self, download_handle.name)(url_or_request, video_id, **kwargs)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 1112, in d
ownload_handle
res = self._download_webpage_handle(
url_or_request, video_id, note=note, errnote=errnote, fatal=fatal, encoding=encoding,
data=data, headers=headers, query=query, expected_status=expected_status,
impersonate=impersonate, require_impersonation=require_impersonation)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 962, in _d
ownload_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data,
headers=headers, query=query, expected_status=expected_status,
impersonate=impersonate, require_impersonation=require_impersonation)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 911, in _r
equest_webpage
raise ExtractorError(errmsg, cause=err)
yt_dlp.utils.ExtractorError: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPErr
or 400: Bad Request>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\USER3\shira\shiradl\cli.py", line 161, in cli
tags = dl.get_tags(ytmusic_watch_playlist, track)
File "C:\Users\USER3\shira\shiradl\dl.py", line 125, in get_tags
return self.__collect_tags(ytmusic_watch_playlist, track)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\shira\shiradl\dl.py", line 151, in _collect_tags
for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(ytmusic_album["audioPlay
listId"])}')["entries"]):
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^
File "C:\Users\USER3\shira\shiradl\dl.py", line 60, in get_ydl_extract_info
info = ydl.extract_info(url, download=False)
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1626, in extract

info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1655, in wrapper
self.report_error(str(e), e.format_traceback())
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1095, in report_e
rror
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER3\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1034, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <H
TTPError 400: Bad Request>)
[INFO 08:45:27] Downloading "Daft Punk - Veridis Quo (Official Audio)" (track 1/1 from URL 14/23)
[INFO 08:45:28] No results on YTMusic API, using Tigerv2 to extract metadata

@Qerkuu
Copy link
Author

Qerkuu commented Feb 13, 2025

I guess one way for it to work is just to find the song you want to download not created by youtube music but uploaded to youtube as a full video, for example this:

https://www.youtube.com/watch?v=K57dVZ4oHtQ - works

https://www.youtube.com/watch?v=T6_Bvdc_dFU - doesn't work

I guess I didnt discover anything that we didn't know yet but this is some kind of a solution for now for anyone having this problem.

@marriedtopython
Copy link

I guess one way for it to work is just to find the song you want to download not created by youtube music but uploaded to youtube as a full video, for example this:

https://www.youtube.com/watch?v=K57dVZ4oHtQ - works

https://www.youtube.com/watch?v=T6_Bvdc_dFU - doesn't work

I guess I didnt discover anything that we didn't know yet but this is some kind of a solution for now for anyone having this problem.

That shouldn't be a problem though, because YouTube and yt music are still google but under 2 different branches (if you get what i mean) so it should still work regardless of it is on yt, i think the issue is that on dl.py it way it tries to handle links, something broke or a yt-dl update broke it. But with some trial and error i think i almost got it working.

@Qerkuu
Copy link
Author

Qerkuu commented Feb 13, 2025

Yeah I reckon it should work but it doesn't so.. yeah :d

@marriedtopython
Copy link

Yeah I reckon it should work but it doesn't so.. yeah :d

when i get home today, I'll test what I've done and if it works I'll pull request it, and also post it here

@ORANGE-OASIS
Copy link

I came here because I was having the exact same starting issue. I can corroborate @Qerkuu 's claim on how videos generated by YouTube are the problem.

I was able to download a regular video from YouTube using the tool, but a video I tried that was auto-generated-- it had the "[name] - Topic" channel name-- didn't work with the tool and gave the same error.

I don't know if this is helpful, but I thought it would be worth noting. I would love to see this fixed!

@marriedtopython
Copy link

I totally forgot about fixing this tbh, i will try but that is like at the bottom of my todo list, so dont expect it being fixed in the next week or 2 sorry if this is the reply you expected :(

@Qerkuu
Copy link
Author

Qerkuu commented Feb 16, 2025

@marriedtopython don't need to be sorry :D Take your time and don't worry

@marriedtopython
Copy link

@marriedtopython don't need to be sorry :D Take your time and don't worry

Thank you, yeah i have been really busy and feeling too tired to help issues on github so, dont worry will fix whenever i have a chance

@ORANGE-OASIS
Copy link

I totally forgot about fixing this tbh, i will try but that is like at the bottom of my todo list, so dont expect it being fixed in the next week or 2 sorry if this is the reply you expected :(

That's okay. It's not life changing. I can wait.

@ORANGE-OASIS
Copy link

ORANGE-OASIS commented Feb 17, 2025

To add a little, here's my error code when I try to download a video's "[name] - Topic" audio

[INFO 20:52:30] Downloading "PLACE" (track 1/1 from URL 1/1)
ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[ERROR 20:52:40] Failed to download "PLACE" (track 1/1 from URL 1/1)
[ERROR 20:52:40]
Traceback (most recent call last):
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 898, in _request_webpage
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query, extensions))
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 4175, in urlopen
return self._request_director.send(req)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking\common.py", line 117, in send
response = handler.send(request)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking_helper.py", line 208, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking\common.py", line 340, in send
return self._send(request)
~~~~~~~~~~^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\networking_requests.py", line 365, in _send
raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1637, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1772, in __extract_info
ie_result = ie.extract(url)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 742, in extract
ie_result = self._real_extract(url)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5167, in wrapper
info_dict = func(self, url, smuggled_data)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 7143, in _real_extract
data, ytcfg = self._extract_data(url, display_id)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5932, in _extract_data
data = self._extract_tab_endpoint(url, item_id, ytcfg, fatal=fatal, default_client=default_client)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 5937, in _extract_tab_endpoint
resolve_response = self._extract_response(
item_id=item_id, query={'url': url}, check_get_keys='endpoint', headers=headers, ytcfg=ytcfg, fatal=fatal,
ep='navigation/resolve_url', note='Downloading API parameters API JSON', default_client=default_client)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1145, in _extract_response
next(main_retries)
~~~~^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\utils_utils.py", line 5254, in iter
self.error_callback(self.error, self.attempt, self.retries)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 3909, in _error_or_warning
RetryManager.report_retry(
~~~~~~~~~~~~~~~~~~~~~~~~~^
err, _count or int(fatal), _retries,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
info=self.to_screen, warn=self.report_warning, error=None if fatal else self.report_warning,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sleep_func=self.get_param('retry_sleep_functions', {}).get('extractor'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\utils_utils.py", line 5262, in report_retry
raise e
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 1118, in _extract_response
response = self._call_api(
ep=ep, fatal=True, headers=headers,
video_id=item_id, query=query, note=note,
context=self._extract_context(ytcfg, default_client),
api_hostname=api_hostname, default_client=default_client)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\youtube.py", line 717, in _call_api
return self._download_json(
~~~~~~~~~~~~~~~~~~~^
f'https://{self._select_api_hostname(api_hostname, default_client)}/youtubei/v1/{ep}',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
'prettyPrint': 'false',
^^^^^^^^^^^^^^^^^^^^^^^
}, cndn=lambda _, v: v))
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 1152, in download_content
res = getattr(self, download_handle.name)(url_or_request, video_id, **kwargs)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 1112, in download_handle
res = self._download_webpage_handle(
url_or_request, video_id, note=note, errnote=errnote, fatal=fatal, encoding=encoding,
data=data, headers=headers, query=query, expected_status=expected_status,
impersonate=impersonate, require_impersonation=require_impersonation)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 962, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data,
headers=headers, query=query, expected_status=expected_status,
impersonate=impersonate, require_impersonation=require_impersonation)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\extractor\common.py", line 911, in _request_webpage
raise ExtractorError(errmsg, cause=err)
yt_dlp.utils.ExtractorError: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\fillerusername\shira\shiradl\cli.py", line 161, in cli
tags = dl.get_tags(ytmusic_watch_playlist, track)
File "C:\Users\fillerusername\shira\shiradl\dl.py", line 125, in get_tags
return self.__collect_tags(ytmusic_watch_playlist, track)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\shira\shiradl\dl.py", line 151, in __collect_tags
for i, video in enumerate(self.get_ydl_extract_info(f'https://www.youtube.com/playlist?list={str(ytmusic_album["audioPlaylistId"])}')["entries"]):
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\shira\shiradl\dl.py", line 60, in get_ydl_extract_info
info = ydl.extract_info(url, download=False)
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1626, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1655, in wrapper
self.report_error(str(e), e.format_traceback())
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1095, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fillerusername\AppData\Local\Programs\Python\Python313\Lib\site-packages\yt_dlp\YoutubeDL.py", line 1034, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube:tab] None: Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)
[INFO 20:52:40] Done (1 error(s))

I should have an updated yt-dlp, and I installed ffmpeg and added to path manually.

I had a bit of a conversation with Chappy (ChatGPT) and all the requirements should have been installed and updated. To reiterate one more time, the tool works fine with videos that aren't generated by YouTube (at least with the "[name] - Topic" origin). I've tried on YouTube Music and with copying the share link, and there has been no difference in the result.

Perhaps being able to handle metadata that isn't received properly by the tool would fix it?

@thegu5
Copy link

thegu5 commented Feb 17, 2025

The changes made in this PR fix the issue (http 400 errors): sigma67/ytmusicapi#744
It mentions how the youtube api change might not be fully rolled out, which would explain some of the confusion here (?)

For now, I got a working version installed by using pipx:

pipx install git+https://github.com/KraXen72/shira@1db905c73c8fd7f17fac5668357cafff3c58fefe (a version of shira before #5, which broke pipx - see #21)
pipx inject shiradl git+https://github.com/sigma67/ytmusicapi.git@c04ec8be48687268a7458d4e829292fc7930b572 --force (version of ytmusicapi with the PR)

It would probably make sense to close this issue when a new ytmusicapi release containing sigma67/ytmusicapi#744 is published.

@KraXen72
Copy link
Owner

KraXen72 commented Feb 17, 2025

hi thegu!l proper pipx support is planned for the future, i just haven't gotten to it yet.
i don't quite understand how it works though, so if you're more versed in pipx, feel free to (or anyone else) PR support for installing with pipx (if you do, please also add instructions in the readme)
thanks for pointing out the external issue with ytmusicapi.

@Qerkuu
Copy link
Author

Qerkuu commented Feb 17, 2025

@thegu5 bless you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants