pytube / pytube

A lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.
https://pytube.io
The Unlicense
12.21k stars 2.52k forks source link

[BUG] Regex Match Error in pytube. #2051

Open v-danh opened 5 days ago

v-danh commented 5 days ago

Before creating an issue

Please confirm that you are on the latest version of pytube by installing from the source. You can do this by running python -m pip install git+https://github.com/pytube/pytube. Sometimes, the pypi library repository is not up to date, and your issue may have been fixed already!

Describe the bug

Regex Match Error in pytube.

To Reproduce Please provide the following information:

Everything is normal.

Expected behavior A clear and concise description of what you expected to happen.

Output If pytube raises an exception, please provide the full traceback for the exception.

Traceback (most recent call last): File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube__main__.py", line 181, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) ^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 405, in get_throttling_plan raw_code = get_throttling_function_code(js) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 311, in get_throttling_function_code name = re.escape(get_throttling_function_name(js)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 296, in get_throttling_function_name raise RegexMatchError( pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Python Projects\FileManagerProject\download_with_pytube.py", line 32, in download_video_and_audio(youtube_video_url, 'final_output.mp4') File "D:\Python Projects\FileManagerProject\download_with_pytube.py", line 10, in download_video_and_audio video_stream = yt.streams.filter(adaptive=True, file_extension='mp4', only_video=True).first() ^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube__main.py", line 296, in streams return StreamQuery(self.fmt_streams) ^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube__main__.py", line 188, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) ^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 43, in init__ self.throttling_plan = get_throttling_plan(js) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 405, in get_throttling_plan raw_code = get_throttling_function_code(js) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 311, in get_throttling_function_code name = re.escape(get_throttling_function_name(js)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python Projects\FileManagerProject.venv\Lib\site-packages\pytube\cipher.py", line 296, in get_throttling_function_name raise RegexMatchError( pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

System information Please provide the following information:

3.12.1

15.0.0

pip install pytube

github-actions[bot] commented 5 days ago

Thank you for contributing to PyTube. Please remember to reference Contributing.md