JuanBindez / pytubefix

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

While using the pytubefix library on AWS EC2 it shows the Error 'This request has been detected as a bot' #208

Closed Buddy4toBuddy closed 1 month ago

Buddy4toBuddy commented 2 months ago

:exclamation: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE :exclamation:

lack of information will lead to closure of the issue


Describe the bug A clear and concise description of what the bug is. if I used the code on the AWS Ec2 instance when I hit the code it threw the error "TlB_eWDSMt4 This request has been detected as a bot, please try again or log in to view" here TlB_eWDSMt4 is the youtube URL ID.

But it works perfectly on my local through the container and without a container.


code that was used that resulted in the bug Here is my code


from pytubefix import YouTube

def fetch_youtube_details(url):
    try:
        yt = YouTube(url)
        details = {
            'title': yt.title,
            'author': yt.author,
            'views': yt.views,
            'thumbnail_url': yt.thumbnail_url,
            'description': yt.description,
            'publish_date': yt.publish_date,
            'length': yt.length
        }
        print('Video details:', details)
    except Exception as e:
        print('Error fetching video details:', e)

url = 'https://www.youtube.com/watch?v=TlB_eWDSMt4'
fetch_youtube_details(url)

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


Screenshots If applicable, add screenshots to help explain your problem.

image


Desktop (please complete the following information):


Additional context Add any other context about the problem here.

iCodexDev commented 2 months ago

Same error happened for me !

deconasser commented 2 months ago

Same error happened for me !

JuanBindez commented 2 months ago

use the latest version 6.14.0 and see #170

bajiegegememeda123 commented 2 months ago

YouTube(url, use_oauth=True)

felipeucelli commented 2 months ago

Test this PR #209 .

1247862674 commented 2 months ago

I have the same error, and I'm also deployed on AWS EC2

JuanBindez commented 2 months ago

I have the same error, and I'm also deployed on AWS EC2

Have you tried with proxy?

NannoSilver commented 2 months ago

I have the same error, and I'm also deployed on AWS EC2

Have to use proxies. There is no other solution for now.

1247862674 commented 2 months ago

I have the same error, and I'm also deployed on AWS EC2

Have you tried with proxy?

Haven’t used an agent yet

yannickErp commented 2 months ago

Have to use proxies. There is no other solution for now.

Anyone know where to find proxies? Paid ones are really expensive with a few dollars per GB, which is deadly for youtube downloads...

arkaydeus commented 1 month ago

In addition, most of the paid proxies don't actually work as they've also been flagged as for bot use.