JuanBindez / pytubefix

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

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

Open Buddy4toBuddy opened 2 weeks ago

Buddy4toBuddy commented 2 weeks 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 weeks ago

Same error happened for me !

deconasser commented 1 week ago

Same error happened for me !

JuanBindez commented 1 week ago

use the latest version 6.14.0 and see #170

bajiegegememeda123 commented 1 week ago

YouTube(url, use_oauth=True)

felipeucelli commented 1 week ago

Test this PR #209 .

1247862674 commented 1 week ago

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

JuanBindez commented 1 week ago

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

Have you tried with proxy?

NannoSilver commented 1 week 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 1 week 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 3 days 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...