ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.95k stars 10.01k forks source link

Seems to break every few weeks. #32374

Closed geoidesic closed 1 year ago

geoidesic commented 1 year ago

Checklist

Verbose log

At first I was getting this:

 youtube-dl --verbose --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=pGw2ztHACxA
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--extract-audio', '--audio-format', 'mp3', 'https://www.youtube.com/watch?v=pGw2ztHACxA']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.6.8 (CPython 64bit) - Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-almalinux-8.8-Sapphire_Caracal (OpenSSL 1.1.1k  FIPS 25 Mar 2021, glibc 2.3.4)
[debug] exe versions: ffmpeg 4.2.9, ffprobe 4.2.9
[debug] Proxy map: {}
[youtube] pGw2ztHACxA: Downloading webpage
[youtube] pGw2ztHACxA: Downloading player 71547d26
WARNING: [youtube] Unable to decode n-parameter: download likely to be throttled (Unable to extract Initial JS player n function alias (Msa[0]); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1670, in _n_descramble
    self._player_cache[player_id] = self._extract_n_function(video_id, player_url)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1642, in _extract_n_function
    funcname = self._extract_n_function_name(jscode)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1627, in _extract_n_function_name
    'Initial JS player n function alias ({nfunc}[{idx}])'.format(**locals()))
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1013, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player n function alias (Msa[0]); please report this issue on https://yt-dl.org/bug . Make sure you
are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
)
[debug] Invoking downloader on 'https://rr4---sn-aigzrn7z.googlevideo.com/videoplayback?expire=1687966950&ei=hgCcZOygNJHZ1gaHyJ7oCg&ip=88.208.196.110&id=o-AAqLCt9FI2msPa8tdhkoh_VKKv7nxAsWCIKRxI-7E07N&itag=140&source=youtube&requiressl=yes&mh=ul&mm=31%2C26&mn=sn-aigzrn7z%2Csn-4g5edndl&ms=au%2Conr&mv=m&mvi=4&pl=20&initcwndbps=48750&spc=qEK7B6H5t1NwRAcir0d-1hJSjEreV-chbZuqkH8DVg&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=q7rlLbdBOR7ouIKMY_9mJSIN&gir=yes&clen=86854964&dur=5366.711&lmt=1622362903792786&mt=1687945063&fvip=3&keepalive=yes&fexp=24007246%2C24363393&c=WEB&txp=5432434&n=1iNPBXn8CRV5uxTL8d&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wQwIfEwiyGgIOgaKw99IFBoMdpm_X0HHPrJJB_1bWz9mF6wIgBQ4Y9gyjhIvLDPDvq9IGOUIqhB00PQs55ZELKXXRsvE%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgIGZIaRzpMMc-DzkP3nNZHL6wxn_3uPtuQikVFM0woXACIGK4pWkHinIj1XwdU2qArkMG0wDyiR-uW_z4d5y0mmgb'
[dashsegments] Total fragments: 9

Then I uninstalled and re-installed YouTube-dl and after that the error changed.

youtube-dl --verbose --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=pGw2ztHACxA

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--extract-audio', '--audio-format', 'mp3', 'https://www.youtube.com/watch?v=pGw2ztHACxA']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.6.8 (CPython) - Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-almalinux-8.8-Sapphire_Caracal
[debug] exe versions: ffmpeg 4.2.9, ffprobe 4.2.9
[debug] Proxy map: {}
[youtube] pGw2ztHACxA: Downloading webpage
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1794, in _real_extract
    'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1012, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

So it was working perfectly and quickly till today. Today, I tried it and it was being throttled. Normally this means it requires updating. So I deleted it and re-installed it and now it doesn't work at all.

dirkf commented 1 year ago

Review #30839 for your problem and use one of the recommended interim update methods, or whatever you did to install the previous instance. See also #32353, not yet separately added to the pinned issue.

geoidesic commented 1 year ago

What I did before was install from git master. I tried that again and now I'm getting a completely different error:

Successfully uninstalled youtube-dl-2021.12.17
[foundry@localhost root]$ sudo pip3 install git+https://github.com/ytdl-org/youtube-dl.git@master#egg=youtube_dl
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting youtube_dl from git+https://github.com/ytdl-org/youtube-dl.git@master#egg=youtube_dl
  Cloning https://github.com/ytdl-org/youtube-dl.git (to master) to /tmp/pip-build-gu1lpgmd/youtube-dl
Installing collected packages: youtube-dl
  Running setup.py install for youtube-dl ... done
Successfully installed youtube-dl-2021.12.17
[foundry@localhost root]$ youtube-dl --verbose --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=pGw2ztHACxA
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--extract-audio', '--audio-format', 'mp3', 'https://www.youtube.com/watch?v=pGw2ztHACxA']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.6.8 (CPython x86_64 64bit) - Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-almalinux-8.8-Sapphire_Caracal - OpenSSL 1.1.1k  FIPS 25 Mar 2021 - glibc 2.3.4
[debug] exe versions: ffmpeg 4.2.9, ffprobe 4.2.9
[debug] Proxy map: {}
[youtube] pGw2ztHACxA: Downloading webpage
[youtube] pGw2ztHACxA: Downloading player 71547d26
[debug] [youtube] Decrypted nsig KOMNJtZiV0wjx2UWLV => d7PBatAWETC7Uw
[debug] [youtube] Decrypted nsig INSLQHc56wCfG-xQLl => xGLxqO-UgtwPIw
[debug] Invoking downloader on 'https://rr4---sn-aigzrn7z.googlevideo.com/videoplayback?expire=1687970806&ei=lg-cZJWQFeP91wbMwZrYBw&ip=88.208.196.110&id=o-AKol_Pl0y9Y2NrACdMlySKHC_xWovfMd6ehtfR9seCGP&itag=140&source=youtube&requiressl=yes&mh=ul&mm=31%2C26&mn=sn-aigzrn7z%2Csn-4g5lznlz&ms=au%2Conr&mv=m&mvi=4&pl=20&initcwndbps=43750&spc=qEK7B7r9ZDIDp4I2E3eq2E9MpgKaOHSYLn-qTBXW4w&vprv=1&svpuc=1&mime=audio%2Fmp4&ns=U0205Vi3NCKIi0f0iDQzXCoN&gir=yes&clen=86854964&dur=5366.711&lmt=1622362903792786&mt=1687948904&fvip=5&keepalive=yes&fexp=24007246%2C51000022&c=WEB&txp=5432434&n=d7PBatAWETC7Uw&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAPQgjVULvQNfJbiKlbFO1ccxkA_6NCyOG0ZtJ4NqwTozAiEA2Mth6xxtCQFxLgwKA5uUfGQGh7_HdK8qrzSZ7F6CPGM%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAOhBZ0HzA_U-YzEFdabsTKQhSVTfRasPhD1mYCRWK-UlAiEAi0T7_RV51FlfDGmMBkm_h6yIRkS2ifoT5H0SYpa1_tA%3D'
[dashsegments] Total fragments: 9
[download] Destination: D&D _ RPG Battle Combat Music-pGw2ztHACxA.m4a
ERROR: unable to download video data: [Errno 13] Permission denied: 'D&D _ RPG Battle Combat Music-pGw2ztHACxA.m4a.ytdl'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1993, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1932, in dl
    return fd.download(name, info)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/common.py", line 376, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/dash.py", line 30, in real_download
    self._prepare_and_start_frag_download(ctx)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/fragment.py", line 69, in _prepare_and_start_frag_download
    self._prepare_frag_download(ctx)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/fragment.py", line 193, in _prepare_frag_download
    self._write_ytdl_file(ctx)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/fragment.py", line 87, in _write_ytdl_file
    frag_index_stream, _ = sanitize_open(self.ytdl_filename(ctx['filename']), 'w')
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/utils.py", line 2078, in sanitize_open
    stream = open(encodeFilename(filename), open_mode)
PermissionError: [Errno 13] Permission denied: 'D&D _ RPG Battle Combat Music-pGw2ztHACxA.m4a.ytdl'
geoidesic commented 1 year ago

nvm... my user was in the /root folder, thus the above error. Re-installing from master branch on git fixed the issue.

dirkf commented 1 year ago

The instructions that you followed have an escape route when "none of the suggested methods worked for me", but your pip installation seems to have succeeded.

Are you still running in the root directory, maybe? The program seems to be working but can't write to the specified directory, which is the current default directory since you haven't given yt-dl a custom output template. Yes, you got there first.

Also, not a problem here, but do quote the 'URL' in case it contains a special shell character like &.