Skip to content

pytubefix.exceptions.RegexMatchError: get_throttling_function_name #464

Open
@sHooPmyWooP

Description

@sHooPmyWooP

🛑 DO NOT REMOVE OR SKIP THIS ISSUE TEMPLATE 🛑

Issues with incomplete or missing information will be closed automatically.


🐞 Bug Description

Provide a clear and concise description of the bug.

I get the following error:

   Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pytubefix/__main__.py", line 335, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js, self.js_url)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/extract.py", line 459, in apply_signature
    cipher = Cipher(js=js, js_url=url_js)
  File "/usr/local/lib/python3.13/site-packages/pytubefix/cipher.py", line 25, in __init__
    self.throttling_function_name = get_throttling_function_name(js, js_url)
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/cipher.py", line 181, in get_throttling_function_name
    raise RegexMatchError(
        caller="get_throttling_function_name", pattern=f"multiple in {js_url}"
    )
pytubefix.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple in https://youtube.com/s/player/753b1819/player_ias.vflset/en_US/base.js

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 "/usr/local/lib/python3.13/site-packages/tonie_sync/__main__.py", line 28, in <module>
    main(query=query, creative_tonie_name=creative_tonie_name)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tonie_sync/__main__.py", line 17, in main
    sync_service.sync(query=query, creative_tonie_name=creative_tonie_name)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/tonie_sync/sync_service.py", line 56, in sync
    download_tracks_metadata = youtube_client.search_and_download(query=query)
  File "/usr/local/lib/python3.13/site-packages/tonie_sync/clients/youtube_client.py", line 63, in search_and_download
    youtube_stream=track.streams.get_audio_only(),
                   ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/__main__.py", line 715, in streams
    return StreamQuery(self.fmt_streams)
                       ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/__main__.py", line 342, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js, self.js_url)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/extract.py", line 459, in apply_signature
    cipher = Cipher(js=js, js_url=url_js)
  File "/usr/local/lib/python3.13/site-packages/pytubefix/cipher.py", line 25, in __init__
    self.throttling_function_name = get_throttling_function_name(js, js_url)
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pytubefix/cipher.py", line 181, in get_throttling_function_name
    raise RegexMatchError(
        caller="get_throttling_function_name", pattern=f"multiple in {js_url}"
    )
pytubefix.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple in https://youtube.com/s/player/753b1819/player_ias.vflset/en_US/base.js

🔢 Code Snippet

Include the minimal code snippet that reproduces the issue.

query = "https://youtube.com/playlist?list=PLt4uv88-2gUo3nXfk6-SHH_0sQaUgRM24&si=dgmgjtItnsxHfijQ"
pl = Playlist(query)
for track in pl.videos:
  youtube_stream=track.streams.get_audio_only()
  youtube_stream.download(
                output_path=track_metadata.download_root,
                filename=track_metadata.filename,
            )

🎯 Expected Behavior

Describe what you expected to happen instead of the observed behavior.

Download the videos audio without an error


📸 Screenshots or Logs


🖥️ Environment Details

Fill in the details below about your setup:

  • Operating System: [e.g., Windows 10, macOS Monterey]
  • Python Version: 3.13
  • Pytubefix Version: 8.12.3

📋 Additional Context

Add any additional information or context that might help us resolve the issue.


🚀 Next Steps

Once submitted, we will triage the issue. Make sure to respond to follow-up questions to keep the process smooth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    waiting

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions