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.89k stars 10k forks source link

Youtube site not having Cache attribute #32943

Closed peternewell closed 6 days ago

peternewell commented 1 week ago

Checklist

Verbose log

C:\youtube-dl-master>python -m youtube_dl -c -v https://www.youtube.com/watch?v=AscVtYCrhUE
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-c', '-v', 'https://www.youtube.com/watch?v=AscVtYCrhUE']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2021.12.17
[debug] Python 3.12.3 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 - OpenSSL 3.0.13 30 Jan 2024
[debug] exe versions: ffmpeg N-115239-g7b47099bc0-20240516, ffprobe N-115239-g7b47099bc0-20240516
[debug] Proxy map: {}
[youtube] AscVtYCrhUE: Downloading webpage
ERROR: Traceback (most recent call last):
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1606, in inner
    self._player_cache[cache_id] = func(*args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1637, in _decrypt_nsig
    jsi, player_id, func_code = self._extract_n_function_code(video_id, player_url)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1712, in _extract_n_function_code
    func_code = self.cache.load('youtube-nsig', player_id)
                ^^^^^^^^^^
AttributeError: 'YoutubeIE' object has no attribute 'cache'. Did you mean: '_cached'?
 (caused by AttributeError("'YoutubeIE' object has no attribute 'cache'")); 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 "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1606, in inner
    self._player_cache[cache_id] = func(*args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1637, in _decrypt_nsig
    jsi, player_id, func_code = self._extract_n_function_code(video_id, player_url)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1712, in _extract_n_function_code
    func_code = self.cache.load('youtube-nsig', player_id)
                ^^^^^^^^^^
AttributeError: 'YoutubeIE' object has no attribute 'cache'. Did you mean: '_cached'?
Traceback (most recent call last):
  File "C:\youtube-dl-master\youtube_dl\YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\YoutubeDL.py", line 955, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\common.py", line 565, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 2137, in _real_extract
    self._unthrottle_format_urls(video_id, player_url, dct)
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1754, in _unthrottle_format_urls
    n_response = decrypt_nsig(n_param)(n_param, video_id, player_url)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1614, in inner
    raise ret
youtube_dl.utils.ExtractorError: Traceback (most recent call last):
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1606, in inner
    self._player_cache[cache_id] = func(*args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1637, in _decrypt_nsig
    jsi, player_id, func_code = self._extract_n_function_code(video_id, player_url)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\youtube-dl-master\youtube_dl\extractor\youtube.py", line 1712, in _extract_n_function_code
    func_code = self.cache.load('youtube-nsig', player_id)
                ^^^^^^^^^^
AttributeError: 'YoutubeIE' object has no attribute 'cache'. Did you mean: '_cached'?
 (caused by AttributeError("'YoutubeIE' object has no attribute 'cache'")); 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

This site has just stopped working.

It never required the Cache attribute previously.

Any suggestions as to how to fix?

dirkf commented 1 week ago

Your installation is not expected to work. Review #30839 for more information. Until the issue is fixed you may need to work around #32905 when accessing YT.

peternewell commented 1 week ago

Thanks for that, I will work through it and see what I come up with.

As a small update, I downloaded and installed the nightly release 2024.08.07, and when I ran it I couldn't download anything from SBS.

Once I installed the attached file, it seemed then to work ok. (remove the txt suffix).

So I am wondering if the nightly repository is up to date?

sbs.py_new_file_working_2024.py.txt

dirkf commented 1 week ago

The nightly build includes all the commits to the master branch. The PR for SBS needs to be checked and then merged. I think the tests were failing last year and so it didn't progress. Assistance from anyone in-region would be appreciated (I'll post in the PR and link it here).

dirkf commented 1 week ago

As above, see https://github.com/ytdl-org/youtube-dl/pull/31880#issuecomment-2401060886.

dirkf commented 6 days ago

From the comment in the PR, OP has a working program now.