gitmylo / audio-webui

A webui for different audio related Neural Networks
MIT License
1.03k stars 99 forks source link

[BUG REPORT] Cannot download YouTube audio #229

Open tomcat-bit opened 5 months ago

tomcat-bit commented 5 months ago

Describe the bug When trying to download an audio file from a YouTube link an exception occurs.

To Reproduce Steps to reproduce the behavior:

  1. Follow the installation guide described in this repository.
  2. Go to Utils -> audio downloads.
  3. Paste a YouTube link and press "Download".

Expected behavior An audio file

Screenshots

Traceback (most recent call last):
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/__main__.py", line 181, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/cipher.py", line 33, in __init__
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/gradio/queueing.py", line 407, in call_prediction
    output = await route_utils.call_process_api(
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/gradio/blocks.py", line 1550, in process_api
    result = await self.call_function(
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/gradio/blocks.py", line 1185, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/gradio/utils.py", line 661, in wrapper
    response = f(*args, **kwargs)
  File "/home/thomas/Downloads/audio-webui/audio-webui/webui/modules/implementations/audio_download.py", line 8, in download_audio
    video = yt.streams.filter(only_audio=True).first()
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/__main__.py", line 296, in streams
    return StreamQuery(self.fmt_streams)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/__main__.py", line 188, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "/home/thomas/Downloads/audio-webui/audio-webui/venv/lib64/python3.10/site-packages/pytube/cipher.py", line 33, in __init__
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W

Additional context OS: Fedora 40 Kernel: x86_64 Linux 6.8.8-300.fc40.x86_64 CPU: Intel Core i7-5960X @ 16x 3.5GHz [39.0°C] GPU: NVIDIA GeForce RTX 3090 RAM: 22721MiB / 31980MiB