问题
I'm using youtube-dl to download videos from youtube that we query using words from a target foreign language, but there's no guarantee that the video is in the target language. Is there any way to know what is the spoken language in a video when using youtube-dl? I figure youtube must know this info since it generates captions for some videos. Thanks!
回答1:
I am not sure if you can use youtube-dl to get the video language, but if you use the Youtube Data API it is possible.
The documentation here shows that you can get the video language in multiple ways:
- Video title / description language:
snippet.defaultLanguage
- spoken language in default audio track:
snippet.defaultAudioLanguage
The option for you would be to call the Youtube Data API and check if snippet.defaultAudioLanguage
matches your desired language.
来源:https://stackoverflow.com/questions/47105402/is-it-possible-to-obtain-the-spoken-language-from-youtube-dl