Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Please add workaround for forced YouTube translated video titles #10758
Comments
|
For interested, there are some more details on IRC. |
|
Seems like a doable issue. I'm not advanced enough to solve it yet, but wish I could. |
|
This seems to be the default behaviour with video titles for me at the moment. Descriptions are still localised, though, and I imagine implementing the specific feature rcajal described would solve this. |
|
This is ancient. I'm on Python 3.7.1 x64 installed through Anaconda x64 I've updated, on Window$ 10.0.17134.345 Enterprise x64, of course using NTFS on my C drive, and youtube-dl 2018.12.03, and the filename is correct using just the defaults |
|
As far as the title of the issue goes, but descriptions still seem to be localised. I imagine that changing the gl and hl attributes by command switch as suggested by the first post would resolve it. |
|
I think this is the relevant issue - is there anything we can do to force a title language? I'm trying to download some videos from nicovideo.jp (niconico) and the titles are downloaded in English when available. I'd prefer to have the titles downloaded in Japanese. On the website, the way to force Japanese is to swap the website language to it (from English). Edit: It seems like language is selected based on browser language - when I swap my browser language to Japanese I get the Japanese version by default (I presume through checking |
|
@yan12125 Hi, Here's an example of usage of the First here's a video title displayed in Chinese : $ youtube-dl --ignore-config --get-filename XMaxBthVLx4
273 恩典的话语满有能力-XMaxBthVLx4.mp4To translate it to English (language used by $ youtube-dl --ignore-config --get-filename XMaxBthVLx4 | trans -b
273 The Word of Grace is full of power - XMaxBthVLx4.mp4To translate it to French (for example) : $ youtube-dl --ignore-config --get-filename XMaxBthVLx4 | trans -b :fr
273 La Parole de Grâce est pleine de puissance - XMaxBthVLx4.mp4You could call the |
|
@sebma; The important part isn't being able to read the title or not, it's being able to avoid the translations Youtube provides. |
|
it's the same, youtube-dl is using the description from the English interface, while what you're getting in the browser is the description from the Hindi interface. |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.09.24. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
YouTube has added a feature where it allows users or channel owners to contribute translations of video titles. This feature has been around for some time but rolled out in increments hitting users in different regions.
On YouTube's web interface whether the original title (desired) or one of the translated titles are shown depends on the choice of interface language. If the language interface is selected to be other than English then YouTube will show the non-English titles in their original form.
When using youtube-dl the desired outcome is for %(title)s to be the original title since this allows for better accounting of the saved material. There is no guarantee user-contributed or machine translations are accurate. These titles also make searching among files saved by youtube-dl harder than it should be.
The problem has now hit youtube-dl because it requests en-US (or en-GB for embedded SWF) content from YouTube via hardcoded 'hl=en' parameter in multiple places in extractor/youtube.py. This results in YouTube presenting youtube-dl with (often inaccurate or nonsensical) translated titles.
Please make the location, 'gl=??', and language 'hl=??', configurable via commandline switches. The parameter hl=?? is in particular effective for working around this issue. Currently, changing the occurrences of hl=en to, for example, hl=fr causes YouTuble, and consequently youtube-dl, to present the correct original title of videos.
Example
Video code: 2sKgVz79NZE
Original correct title (in Japanese, accessible via YouTube API or a browser where YouTube language interface has been set to something other than English): "人を怒らせる方法 「放棄」"
Translated title (acquired with --get-filename -f22 -o '%(title)s.%(ext)s' to youtube-dl, or a browser with YouTube interface language set to English): "How to make peopke angry 'renounse'.mp4"