Closed MauroCSHPYP closed 1 year ago
Hi @MauroCSHPYP, what is the location the module is being called from? Is the code executed on a Chinese server or VPN? Either way, this is just the display name, so it shouldn't have any impact on the actual transcript which will be fetched.
Thanks for answering.
The code is executed on Google Colab, so I don't have the details about the VPN (if any) or additional information about it.
I suspect that the base code is using requests
with no default language on the headers, hence, sometimes, the language obtained on the results varies from English.
Hi @MauroCSHPYP,
that is a very good point! I thought this was location/cookie-based, but adding Accept-Language: en-US
to the header fixes it. I will make a PR to make it default to English.
Thank you for the suggestion!
Fix has been released in v0.6.1
DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.
To Reproduce
Steps to reproduce the behavior:
What code / cli command are you executing?
Here's the full code:
Results:
Which Python version are you using?
Python 3.10.11
Which version of youtube-transcript-api are you using?
youtube-transcript-api-0.6.0
Expected behavior
I expected to receive the results (i.e the text ) in english OR in the configured language - instead of those chinese characters. I do check the documentation to set the proxy, but, it's not clear to me where can be set the language to the
list_transcripts
function or theyoutube_transcript_api
instance.Example:
Instead of:
It should be:
Actual behaviour
Currently, the idiom/language of the
list_transcripts
is in chinese (I believe). With this same code, I got the results in english.