you-get icon indicating copy to clipboard operation
you-get copied to clipboard

YouTube failing

Open xfq opened this issue 10 months ago • 10 comments

$ you-get https://www.youtube.com/watch\?v\=LNEOx_Dkdzo
you-get: Server refused to provide video details. Returned status: LOGIN_REQUIRED. Reason: Sign in to confirm you’re not a bot This helps protect our community.

xfq avatar Feb 24 '25 06:02 xfq

  • Add cookies, still 403.

you-get -o . -d -c www.youtube.com.txt --itag=136 'https://www.youtube.com/watch?v=TnHl7FQZgAc'

Errors :

you-get: version 0.4.1743, a tiny downloader that scrapes the web. you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies='www.youtube.com.txt', timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag='136', m3u8=False, URL=['https://www.youtube.com/watch?v=TnHl7FQZgAc']) Traceback (most recent call last): File "/opt/homebrew/bin/you-get", line 8, in sys.exit(main()) ~~~~^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/main.py", line 92, in main main(**kwargs) ~~~~^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1883, in main script_main(any_download, any_download_playlist, **kwargs) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1772, in script_main download_main( ~~~~~~~~~~~~~^ download, download_playlist, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<4 lines>... **extra ^^^^^^^ ) ^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1386, in download_main download(url, **kwargs) ~~~~~~~~^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1874, in any_download m.download(url, **kwargs) ~~~~~~~~~~^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractor.py", line 61, in download_by_url self.download(**kwargs) ~~~~~~~~~~~~~^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractor.py", line 238, in download download_urls(urls, self.title, ext, total_size, headers=headers, ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ output_dir=kwargs['output_dir'], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ merge=kwargs['merge'], ^^^^^^^^^^^^^^^^^^^^^^ av=stream_id in self.dash_streams, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ vid=self.vid) ^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1057, in download_urls url_save( ~~~~~~~~^ url, output_filepath_i, bar, refer=refer, is_part=True, faker=faker, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ headers=headers, **kwargs ^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 680, in url_save chunk_sizes = [url_size(url, faker=faker, headers=tmp_headers) for url in url] ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 564, in url_size response = urlopen_with_retry(request.Request(url, headers=headers)) File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 448, in urlopen_with_retry raise http_error File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 439, in urlopen_with_retry return request.urlopen(*args, **kwargs) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 189, in urlopen return opener.open(url, data, timeout) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 495, in open response = meth(req, response) File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 604, in http_response response = self.parent.error( 'http', request, response, code, msg, hdrs) File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 533, in error return self._call_chain(*args) ~~~~~~~~~~~~~~~~^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 466, in _call_chain result = func(*args) File "/opt/homebrew/Cellar/[email protected]/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 613, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

Vie-Any avatar Mar 21 '25 14:03 Vie-Any

Iinitial settings — Python version 3.13.3 You-Get version 0.4.1743 Windows 11 Corporate 22H2 / 22621.5189 — launch:

python you-get "https://www.youtube.com/watch?v=BqwEr7WXfe0&t=2s" --debug

Error LOG:


[DEBUG] Extracting from the video page...
[DEBUG] get_content: https://www.youtube.com/watch?v=BqwEr7WXfe0
[DEBUG] Retrieving the player code...
[DEBUG] get_content: https://www.youtube.com/s/player/9599b765/player-plasma-ias-tablet-ru_RU.vflset/base.js
[DEBUG] Loading ytInitialPlayerResponse...
[DEBUG] status: OK
[DEBUG] Found format: itag=18
you-get: version 0.4.1743, a tiny downloader that scrapes the web.
you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies=None, timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.youtube.com/watch?v=BqwEr7WXfe0&t=2s'])
Traceback (most recent call last):
  File "C:\you-get\you-get", line 11, in <module>
    you_get.main(repo_path=_filepath)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "C:\you-get/src\you_get\__main__.py", line 92, in main
    main(**kwargs)
    ~~~~^^^^^^^^^^
  File "C:\you-get/src\you_get\common.py", line 1883, in main
    script_main(any_download, any_download_playlist, **kwargs)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\you-get/src\you_get\common.py", line 1772, in script_main
    download_main(
    ~~~~~~~~~~~~~^
        download, download_playlist,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        **extra
        ^^^^^^^
    )
    ^
  File "C:\you-get/src\you_get\common.py", line 1386, in download_main
    download(url, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\you-get/src\you_get\common.py", line 1874, in any_download
    m.download(url, **kwargs)
    ~~~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\you-get/src\you_get\extractor.py", line 48, in download_by_url
    self.prepare(**kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^
  File "C:\you-get/src\you_get\extractors\youtube.py", line 272, in prepare
    url = self.__class__.dethrottle(self.js, url)
  File "C:\you-get/src\you_get\extractors\youtube.py", line 104, in dethrottle
    n = n_to_n(js, qs['n'][0])
  File "C:\you-get/src\you_get\extractors\youtube.py", line 99, in n_to_n
    n = dukpy.evaljs('%s(%s)("%s")' % (v1def, f1def, n))
  File "C:\Users\Master\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\dukpy\evaljs.py", line 138, in evaljs
    return JSInterpreter().evaljs(code, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "C:\Users\Master\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\dukpy\evaljs.py", line 57, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: ReferenceError: identifier 'Fx' undefined
    at [anon] (src\duktape\duktape.c:94432) internal
    at [anon] (eval:1)
    at eval (eval:1) preventsyield

Previously, a week ago, everything worked well

Video-VV avatar Apr 10 '25 12:04 Video-VV

tring(self, jscode, jsvars) _dukpy.JSRuntimeError: ReferenceError: identifier 'Fx' undefined at [anon] (src\duktape\duktape.c:94432) internal at [anon] (eval:1) at eval (eval:1) preventsyield

metoo,

ReferenceError: identifier 'Fx' undefined at [anon] (src/duktape/duktape.c:94429) internal at EQa (eval:1) at eval (eval:1) preventsyield

Flow-sandyu avatar Apr 13 '25 23:04 Flow-sandyu

I also got the same error when using you-get. I don't know how to solve it? C:\Users\ll> you-get 'https://www.youtube.com/watch?v=sUrsYsw5mUA' --debug [DEBUG] Extracting from the video page... [DEBUG] get_content: https://www.youtube.com/watch?v=sUrsYsw5mUA [DEBUG] Retrieving the player code... [DEBUG] get_content: https://www.youtube.com/s/player/b2858d36/player-plasma-ias-tablet-en_US.vflset/base.js [DEBUG] Loading ytInitialPlayerResponse... [DEBUG] status: OK [DEBUG] Found format: itag=18 you-get: version 0.4.1743, a tiny downloader that scrapes the web. you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies=None, timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.youtube.com/watch?v=sUrsYsw5mUA']) Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "D:\Program Files\Python313\Scripts\you-get.exe\__main__.py", line 7, in <module> sys.exit(main()) ~~~~^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\__main__.py", line 92, in main main(**kwargs) ~~~~^^^^^^^^^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\common.py", line 1883, in main script_main(any_download, any_download_playlist, **kwargs) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\common.py", line 1772, in script_main download_main( ~~~~~~~~~~~~~^ download, download_playlist, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<4 lines>... **extra ^^^^^^^ ) ^ File "D:\Program Files\Python313\Lib\site-packages\you_get\common.py", line 1386, in download_main download(url, **kwargs) ~~~~~~~~^^^^^^^^^^^^^^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\common.py", line 1874, in any_download m.download(url, **kwargs) ~~~~~~~~~~^^^^^^^^^^^^^^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\extractor.py", line 48, in download_by_url self.prepare(**kwargs) ~~~~~~~~~~~~^^^^^^^^^^ File "D:\Program Files\Python313\Lib\site-packages\you_get\extractors\youtube.py", line 272, in prepare url = self.__class__.dethrottle(self.js, url) File "D:\Program Files\Python313\Lib\site-packages\you_get\extractors\youtube.py", line 104, in dethrottle n = n_to_n(js, qs['n'][0]) File "D:\Program Files\Python313\Lib\site-packages\you_get\extractors\youtube.py", line 94, in n_to_n f1def = match1(js, r'\W%s=(function\(\w+\).+?\)});' % re.escape(f1)) ~~~~~~~~~^^^^ File "D:\Program Files\Python313\Lib\re\__init__.py", line 312, in escape pattern = str(pattern, 'latin1') TypeError: decoding to str: need a bytes-like object, NoneType found

tianyi725 avatar May 13 '25 12:05 tianyi725

Anyone encounting issue when trying to download niconico vedios on windows commandline?

I am using you-get 0.4.1743,when I add Netscape format cookie as parameter, I am still asked to provide username and password, which seems to be not working even if you type in the right username and password. The network is fine since I can access this url normally using a proxied Japaese IP. I feel like this issue might be related to niconico's login verifivation policy, as user are required to provide verification code on email. The Netscape format cookie.txt should have no problem since it works for bilibili and the commandline response seems to be not relating to cookie. Following is commandline response:

you-get -c C:\Users\30629\cookie.txt -i https://www.nicovideo.jp/watch/sm44944337
User:     [email protected]
Password:
you-get: [error] oops, something went wrong.
you-get: don't panic, c'est la vie. please try the following steps:
you-get:   (1) Rule out any network problem.
you-get:   (2) Make sure you-get is up-to-date.
you-get:   (3) Check if the issue is already known, on
you-get:         https://github.com/soimort/you-get/wiki/Known-Bugs
you-get:         https://github.com/soimort/you-get/issues
you-get:   (4) Run the command with '--debug' option,
you-get:       and report this issue with the full output.
Logging in...

I tried the --debug in commandline,issue seems to be password not recognized and [SSL: NO_CIPHERS_AVAILABLE]:

you-get: version 0.4.1743, a tiny downloader that scrapes the web.
you-get: Namespace(version=False, help=False, info=True, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies='C:\\Users\\30629\\cookie.txt', timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.nicovideo.jp/watch/sm44944337'])
Traceback (most recent call last):
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1336, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1382, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1091, in _send_output
    self.send(msg)
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1035, in send
    self.connect()
  File "D:\downloads\Anaconda\Lib\http\client.py", line 1477, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\ssl.py", line 1041, in _create
    self.do_handshake()
  File "D:\downloads\Anaconda\Lib\ssl.py", line 1319, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\downloads\Anaconda\Scripts\you-get.exe\__main__.py", line 7, in <module>
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\__main__.py", line 92, in main
    main(**kwargs)
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\common.py", line 1883, in main
    script_main(any_download, any_download_playlist, **kwargs)
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\common.py", line 1772, in script_main
    download_main(
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\common.py", line 1386, in download_main
    download(url, **kwargs)
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\common.py", line 1874, in any_download
    m.download(url, **kwargs)
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\extractors\nicovideo.py", line 31, in nicovideo_download
    nicovideo_login(user, password)
  File "D:\downloads\Anaconda\Lib\site-packages\you_get\extractors\nicovideo.py", line 9, in nicovideo_login
    response = request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", headers=fake_headers, data=data.encode('utf-8')))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\downloads\Anaconda\Lib\urllib\request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:1000)>
Logging in...

Winterworm-2025 avatar May 25 '25 13:05 Winterworm-2025

Doesn't work for the simple example given in the README.

you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw' --debug
[DEBUG] Extracting from the video page...
[DEBUG] get_content: https://www.youtube.com/watch?v=jNQXAC9IVRw
[DEBUG] Retrieving the player code...
[DEBUG] get_content: https://www.youtube.com/s/player/b7ed0796/player-plasma-ias-tablet-en_US.vflset/base.js
[DEBUG] Loading ytInitialPlayerResponse...
[DEBUG] status: OK
[DEBUG] Found format: itag=18
you-get: version 0.4.1743, a tiny downloader that scrapes the web.
you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies=None, timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.youtube.com/watch?v=jNQXAC9IVRw'])
Traceback (most recent call last):
  File "/opt/homebrew/bin/you-get", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/__main__.py", line 92, in main
    main(**kwargs)
    ~~~~^^^^^^^^^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1883, in main
    script_main(any_download, any_download_playlist, **kwargs)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1772, in script_main
    download_main(
    ~~~~~~~~~~~~~^
        download, download_playlist,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        **extra
        ^^^^^^^
    )
    ^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1386, in download_main
    download(url, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1874, in any_download
    m.download(url, **kwargs)
    ~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractor.py", line 48, in download_by_url
    self.prepare(**kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 272, in prepare
    url = self.__class__.dethrottle(self.js, url)
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 104, in dethrottle
    n = n_to_n(js, qs['n'][0])
  File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 94, in n_to_n
    f1def = match1(js, r'\W%s=(function\(\w+\).+?\)});' % re.escape(f1))
                                                          ~~~~~~~~~^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/re/__init__.py", line 312, in escape
    pattern = str(pattern, 'latin1')
TypeError: decoding to str: need a bytes-like object, NoneType found

kundeng avatar Jul 08 '25 17:07 kundeng

Doesn't work for the simple example given in the README.

you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw' --debug -c cookies.txt [DEBUG] Extracting from the video page... [DEBUG] get_content: https://www.youtube.com/watch?v=jNQXAC9IVRw [DEBUG] Retrieving the player code... [DEBUG] get_content: https://www.youtube.com/s/player/ef259203/player-plasma-ias-tablet-zh_CN.vflset/base.js [DEBUG] Loading ytInitialPlayerResponse... [DEBUG] status: OK [DEBUG] Found format: itag=18 you-get: version 0.4.1743, a tiny downloader that scrapes the web. you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, prefix=None, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies='cookies.txt', timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.youtube.com/watch?v=jNQXAC9IVRw']) Traceback (most recent call last): File "/opt/homebrew/bin/you-get", line 8, in sys.exit(main()) ~~~~^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/main.py", line 92, in main main(**kwargs) ~~~~^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1883, in main script_main(any_download, any_download_playlist, **kwargs) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1772, in script_main download_main( ~~~~~~~~~~~~~^ download, download_playlist, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<4 lines>... **extra ^^^^^^^ ) ^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1386, in download_main download(url, **kwargs) ~~~~~~~~^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/common.py", line 1874, in any_download m.download(url, **kwargs) ~~~~~~~~~~^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractor.py", line 48, in download_by_url self.prepare(**kwargs) ~~~~~~~~~~~~^^^^^^^^^^ File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 272, in prepare url = self.class.dethrottle(self.js, url) File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 104, in dethrottle n = n_to_n(js, qs['n'][0]) File "/opt/homebrew/Cellar/you-get/0.4.1743/libexec/lib/python3.13/site-packages/you_get/extractors/youtube.py", line 94, in n_to_n f1def = match1(js, r'\W%s=(function(\w+).+?)});' % re.escape(f1)) ~~~~~~~~~^^^^ File "/opt/homebrew/Cellar/[email protected]/3.13.3_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/re/init.py", line 312, in escape pattern = str(pattern, 'latin1') TypeError: decoding to str: need a bytes-like object, NoneType found

felix0102 avatar Jul 10 '25 03:07 felix0102

Same TypeError issue

Forest-Lee avatar Jul 26 '25 14:07 Forest-Lee

 File "/usr/local/lib/python3.7/site-packages/you_get/extractors/bilibili.py", line 214, in prepare
    initial_state = json.loads(initial_state_text)
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
  File "/usr/local/lib/python3.7/site-packages/you_get/extractors/youtube.py", line 272, in prepare
    url = self.__class__.dethrottle(self.js, url)
  File "/usr/local/lib/python3.7/site-packages/you_get/extractors/youtube.py", line 104, in dethrottle
    n = n_to_n(js, qs['n'][0])
  File "/usr/local/lib/python3.7/site-packages/you_get/extractors/youtube.py", line 94, in n_to_n
    f1def = match1(js, r'\W%s=(function\(\w+\).+?\)});' % re.escape(f1))
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 259, in escape
    pattern = str(pattern, 'latin1')
TypeError: decoding to str: need a bytes-like object, NoneType found

tried bilibili and youtube, it looks like all got TypeError issue.

bgwm avatar Sep 29 '25 03:09 bgwm

BiliBili worked at least very recently, YouTube downloads are broken.

barracuda156 avatar Oct 18 '25 14:10 barracuda156