Whisper-WebUI icon indicating copy to clipboard operation
Whisper-WebUI copied to clipboard

pytubefix.exceptions.BotDetection: meK-kn7XDHI This request has been detected as a bot, please try again or log in to view

Open 1247862674 opened this issue 1 year ago • 8 comments

How should I fix this error, it seems like he is saying that I am a robot
Ubuntu22.04 python3.10.14 image

1247862674 avatar Sep 03 '24 07:09 1247862674

Hi. Updating your pytubefix may fix the bug.

pip install -U pytubefix

See: https://github.com/JuanBindez/pytubefix/issues/208#issuecomment-2323325194

jhj0517 avatar Sep 03 '24 09:09 jhj0517

OK Thank you very much

1247862674 avatar Sep 03 '24 09:09 1247862674

I'm already using pytubefix-6.14.0, but I still get an error

1247862674 avatar Sep 03 '24 09:09 1247862674

I'm using EC2 ubuntu22.04 from AWS

1247862674 avatar Sep 03 '24 09:09 1247862674

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501 Network URL: http://172.31.16.255:8501 External URL: http://13.234.10.127:8501

Attempt 1 failed: c00eeJAA-uo This request was detected as a bot. Use use_po_token=True to view ^C Stopping... Attempt 2 failed: c00eeJAA-uo This request was detected as a bot. Use use_po_token=True to view Attempt 3 failed: c00eeJAA-uo This request was detected as a bot. Use use_po_token=True to view

Even after using po_token not work.

Using latest version 6.16.2

ramkrishna70 avatar Sep 16 '24 19:09 ramkrishna70

I have a similar issue on the remote and Pytubefix version is 7.2.2. my code:

token_data_base64 = os.getenv("YOUTUBE_TOKEN")

def custom_po_verifier() -> tuple[str, str]:
    print(f"raw base64={token_data_base64}")
    if token_data_base64:
        token_data_json = base64.b64decode(token_data_base64).decode('utf-8')
        token_data = json.loads(token_data_json)
        visitor_data = token_data.get('visitorData')
        po_token = token_data.get('poToken')
        print(f"Visitor Data: {visitor_data}")
        print(f"PO Token: {po_token}")
        return visitor_data, po_token
    else:
        print("No token data found")

def download_youtube_video(url, output_filename):
    yt = YouTube(url, use_po_token=True, po_token_verifier=custom_po_verifier)
    # yt = YouTube(url)
    stream = yt.streams.get_audio_only()
    stream.download(filename=output_filename)
    print(f"Downloaded: {output_filename}")

Error message:

Traceback (most recent call last):
(...)
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/pytubefix/__main__.py", line 632, in streams
    self.check_availability()
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/pytubefix/__main__.py", line 349, in check_availability
    raise exceptions.BotDetection(video_id=self.video_id)
pytubefix.exceptions.BotDetection: UiBMU8piEWk This request was detected as a bot. Use `use_po_token=True` to view. See more details at https://github.com/JuanBindez/pytubefix/pull/209
OS: linux
Python: 3.9.20 (main, Sep  9 2024, 03:07:22) 

gayuna avatar Oct 05 '24 15:10 gayuna

I'm having the exact same issue with the official docker image. How can I instruct the image to use this pytubefix? Version inside the image afaik is 8.12.0

Andreaux avatar Jan 25 '25 13:01 Andreaux

I couldn't reproduce it anymore, pytubefix fixed a bug. Try to update pytubefix with

pip install -U pytubefix

Then it should work.

jhj0517 avatar Feb 06 '25 04:02 jhj0517