JuanBindez / pytubefix

Python3 library for downloading YouTube Videos.
http://pytubefix.rtfd.io/
MIT License
454 stars 67 forks source link

RegexMatchError : could not find match for multiple #168

Closed AndrienMont closed 1 month ago

AndrienMont commented 1 month ago
Traceback (most recent call last):
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\__main__.py", line 231, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\extract.py", line 415, in apply_signature
    cipher = Cipher(js=js)
             ^^^^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\cipher.py", line 25, in __init__
    self.throttling_function_name = get_throttling_function_name(js)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\cipher.py", line 137, in get_throttling_function_name
    raise RegexMatchError(
pytubefix.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 "C:\Users\Andrien\SoulFinding\test1.py", line 10, in <module>
    ys = yt.streams.first()
         ^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\__main__.py", line 498, in streams
    return StreamQuery(self.fmt_streams)
                       ^^^^^^^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\__main__.py", line 238, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\extract.py", line 415, in apply_signature
    cipher = Cipher(js=js)
             ^^^^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\cipher.py", line 25, in __init__
    self.throttling_function_name = get_throttling_function_name(js)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Andrien\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\cipher.py", line 137, in get_throttling_function_name
    raise RegexMatchError(
pytubefix.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

This massive error happens when executing the following code. I remember it working just fine last week.

from pytubefix import YouTube
from pytubefix.cli import on_progress

url = "https://youtu.be/AnMhdn0wJ4I?si=oOb5x4UTLtWHIdPw"

yt = YouTube(url, on_progress_callback = on_progress)
print(yt.title)

ys = yt.streams.first()
print(ys)
ys.download()
felipeucelli commented 1 month ago

Make sure you are using the latest version of pytubefix.

AndrienMont commented 1 month ago

Thanks for the response, I must have skipped over that part in trying to understand it 😅