-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing the obtained URL results in HTTP ERROR 403 #386
Comments
I also detected an abnormally high number of "HTTP Error 403: Forbidden" exception errors in recent days. |
Recently I also started detecting it, maybe it's YouTube messing with the ANDROID_VR client. Maybe soon we will have to switch to a WEB-based client, which will reduce the library's performance. |
I wonder why YouTube chose to return a URL that cannot be played, instead of simply not returning a URL at all. |
I believe it is related to PoToken, see more here: #209 |
I did an analysis on how this error is affecting my system. My system is small, with a couple of IPs. |
On the same IP server, the URLs obtained via pytubefix cannot play videos, but the URLs obtained using yt-dlp without a potoken can always play videos. I hope this information is helpful. |
Even with the URL obtained by inputting the potoken and visitorData as shown below, the video cannot be played and results in a 403 error.
|
I tried yt-dlp in my server, without any proxy, and got this error:
|
Recently yt-dlp implemented poToken in the IOS client. And the fact that the error appears randomly may indicate that YouTube is doing A/B testing. I think that at the moment we just have to wait for the A/B tests to be completed and prepare to change the client. |
I am also getting the same error while downloading the video from youtube: |
It seems that such an error occurs when accessing YouTube multiple times from the same server. This 403 error has also been discussed in yt-dlp, so it doesn't seem to be an issue specific to pytubefix. |
With the latest yt-dlp, the URL obtained using the following command can be played without resulting in a 403 error.
|
In my tests, I noticed that the 403 error appears after many requests coming from a single IP, and in some cases, it is immediately detected as a bot. I managed to fix this by manually adding a visitorData to the API request. This does not fix it when already detected as a bot, only when the 403 error is generated. Using poToken seems to work as it sends the visitorData (I'm not sure but it seems to expire after several requests). We can add visitorData automatically, but I believe that for now it is better to wait for the A/B tests and prepare for the changes. |
🛑 DO NOT REMOVE OR SKIP THIS ISSUE TEMPLATE 🛑
Issues with incomplete or missing information will be closed automatically.
🐞 Bug Description
Accessing the obtained URL results in HTTP ERROR 403.
I was able to play the video until yesterday.
The same error occurs on a server with a different IP address.
If I retrieve the best_url with yt-dlp without using the potoken, the video can be played, so it doesn't seem to be an issue with the potoken.
I couldn't determine if it was the same issue as #384.
🔢 Code Snippet
Include the minimal code snippet that reproduces the issue.
🎯 Expected Behavior
Describe what you expected to happen instead of the observed behavior.
Accessing the obtained URL allows the video to play.
📸 Screenshots or Logs
🖥️ Environment Details
Fill in the details below about your setup:
📋 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.
The text was updated successfully, but these errors were encountered: