-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
TranscriptsDisabled But it's not disabled (works locally, fails on Cloud machine) #303
Comments
Yes the issue is valid, but it seems that this does not show with the link, which Youtube gave us when we use the link from Share button. |
Hi @atoonk, do you only have this issue with this specific video, or all videos you are trying to retrieve? I can retrieve the subtitles for that video without any issues, which usually means that you are being rate-limited by YouTube (which would also mean that this should happen for all videos). |
Hi @jdepoix, I encountered the same problem yesterday with every video I tried. Although I don't use the API frequently, I do access it a few times per day. I hope it's not some new restriction from YouTube. I experienced the same problem as @atoonk, and the issue is still present today. Thanks a lot for your quick response and for this amazing tool; I really like it. |
Hi @SKVNDR, then you're most definitely being blocked by YouTube. The only way to work around this is to change your IP address in any way (VPN, proxy, or assign a new IP if possible). |
I can confirm that YouTube is most likely blocking =/ |
I have the same problem. But I never use this library before, just firs try for along time |
If you're running your code on a cloud machine it could be that (depending on your setup) you're getting assigned an IP from a pool that is shared with other machines. So the IP you're using could potentially be blocked without you doing anything. YouTube could also generally black list certain IPs that are known to belong to cloud providers (just a guess, I don't know if they actually do that!). |
Ah yes, i tried it from my laptop at home and it works fine now. And indeed, it affected all videos, which I why I thought it was a bug or new behaviour in YT api. |
Since this is not an official API, there unfortunately is no information on rate limits and when or for how long you will get blocked. People have been reporting different things, so I don't feel like it is consistent either. |
I will pin this issue and leave it open, since there are issues being opened due to this all the time. |
Same for me. I use a droplet on DigitalOcean, and YouTube probably blocked the IP from there, but using a proxy fixed the issue... |
how did you create a proxy can you share the code. did you use a free proxy or paid? how did you obtain that proxy? |
Hi @auspy, from youtube_transcript_api import YouTubeTranscriptApi
YouTubeTranscriptApi.get_transcript(video_id, proxies={"https": "https://user:pass@domain:port"}) I'm using a paid proxy from smartproxy.com with the "Residential" offer. |
confirmed, using a proxy from my droplet worked. I used this to proxy traffic from my digital ocean droplet to my local laptop. https://docs.border0.com/docs/expose-a-http-proxy
can make a more details quick video if folks are interested in how to use that. |
Having the exact same issue, & also using DigitalOcean droplet |
Same here. Subscribed this issue. |
sure would love a video on it. drop the link here |
thank you for sharing. this surely looks like a cheap option but I was looking for something free. don't want to pay in initial stages of my project. |
@auspy Would Appreciate a vid. or just more info. ::: I'm all new to proxies etc. seems most info. online is kinda for the more experienced ::: |
Just ran across this issue today, glad I found this thread. I too am on Digital Ocean, running my code in a Docker container. Getting transcripts runs fine locally, but not on DO. I would appreciate the video mentioned above, as proxies are new to me. If I use my localhost as a proxy, it means I need to leave the machine running 24/7 right? I mean, I guess that's obvious. |
Yep, same with me -- looks like youtube blocked many DO servers at once -- i didn't spent so much requests and I'm banned. |
I also use Digital Ocean droplet, i think they block IPs from DO servers. now I using google cloud functions. |
I can confirm that it is a problem with digital ocean servers being blocked. |
Now this error also in google cloud functions. |
Blocked from dedicated OVH too |
Has anyone faced same issue on pythonanywhere? |
@IversusAI Thank you for your kind words. As @jdepoix noted out, promoting the actor is outside the scope of this discussion, so please feel free to reach out: [email protected] |
Hi @IversusAI,
This module did not stop working! You'll just have to use it with proxies if you're using it with a blocked IP (as is the case with many cloud providers IPs) 🙂 |
Hello, I've got the same problem here. It works perfectly on my local machine with and without proxies. But on my server (OVH French provider), with and without proxies, this not work at all. I'm usign proxies from Apify. |
It seems to work for me when I use the residential proxies. |
Possible solution - I set up fastapi on an old android (termux) and then ssh proxy free serveo.net url. My backend just calls the serveo.net url which triggers the request on the android phone. Very fast and easy, no blocking, no authentication. |
somewhat unrelated but i was playing around with this repo on a oracle cloud instance today and ran into this same issue. I was able to use cloudflare warp to proxy. I used this repo to create a warp container and just set the proxy to http://warp:1080. |
FWIW, I'm having the exact same issue. I can retrieve the captions/transcripts of any given video locally, but not when I deploy the same code to a server. Super strange issue. |
@jdepoix is there a proxy service available that i can use to run it, brightdata doesn't seem to work. Sorry for being out of the topic here |
could i possibly get the service you are using? |
How many transcripts were you able to generate? This can be a great free alternative to residential proxies. |
I havent tested the limits but using it sparingly to get a few video transcripts here and there (~20-30 a day) has been completely fine. Unless you are trying to scrape massive amounts of youtube videos, using the warp proxy has been fine for me. |
I have this problem in GCF, is there any fix in using GCF? was working in local machine but noit in GCF |
@dominicdev there's no code fix to do here. It's all because YT api is authenticated and has rate limits and bans on anonymous requests from IP blocks belonging to cloud providers. What's worse is that they disabled API keys, so now has to be done via OAuth2 to authorize and refresh tokens. So basically works from home and maybe office, but likely won't work from any cloud service unless you use something like Apify or some proxy service that hasn't been IP-banned yet. |
Can you please tell me how you did this on Render? |
the Proxying through smart proxy fixed it , works for me |
It's definitely not a blocking by YouTube issue, I have figured this after hours (i think? haha). It's a cookie's issue to start. If you're hosting on a cloud, you need to copy your Netscape formatted cookies.txt from local machine to the cloud and make sure all headers are correct to avoid cors issues. Make sure formatting for request is right otherwise it'll be truncated and cut off for videoid / always return the subtitles error. I got it working fine on digital ocean and receiving transcripts from any video. It All ultimately came down to cookies and formatting. |
Hi @FVTAL, that is not quite accurate. When you receive this
So yes, you can use cookies to temporarily work around this issue, but your account will be banned eventually. Therefore, I wouldn't really consider this a proper solution, while using proxies is much more scalable! |
Understood - and thank you for clarifying. I appreciate your efforts and thank you for the project. |
I can confirm that this works. I also got a $7 package at Smart Proxy, and it worked just fine. |
To Reproduce
using youtube-transcript-api-0.6.2:
outputs:
What code / cli command are you executing?
I am running
Which Python version are you using?
Python 3.11.6
Which version of youtube-transcript-api are you using?
youtube-transcript-api-0.6.2
Expected behavior
Describe what you expected to happen.
I expected to receive the english transcript
I can see it in browser, see screenshot:
Actual behaviour
The text was updated successfully, but these errors were encountered: