shaked6540 / YoutubePlaylistDownloader

A tool to download whole playlists, channels or single videos from youtube and also optionally convert them to almost any format you would like
Other
1.25k stars 206 forks source link

Chinese Caption Downloading Solution #268

Open stephenleeys opened 2 months ago

stephenleeys commented 2 months ago

I am Chinese user. When I was trying to use the downloader to download video with chinese cation, I chose the language option "Chinese". However, no caption will be downloaded. It is because the language code used in youtube caption is not correct.

I've looked through the code and find the language code setting of downloader and language code of the youtube player, Here is the solution:

Download the source code of this repo. Open the solution file by Visual Studio. Make sure your VS is in version 17.8+.

Inside file "DownloadSettingsControl.xaml.cs", in line 26 (it might not be the same line if different version, I was using downloader v1.9.24), find the dictionary: private readonly Dictionary<string, string> Languages ....

Add the two element somewhere inside the dictionary { "zh-Hans", "Chinese Simplified" }, { "zh-Hant", "Chinese Traditional" },

It should looks similar: private readonly Dictionary<string, string> Languages = new() { { ..., "zh-Hans", "Chinese Simplified" }, { "zh-Hant", "Chinese Traditional" }, ... } }

Please be sure you don't copy the line directly. "..." is rest of the language option.

Build the solution and start the program. Make sure you have the "ffmpeg.exe" in your build directory. Just copy it from the official release is fine.

If @shaked6540 have time, I sincerely hope that the correct language code can be added in the next update. Thank you very much!