mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 09:29:16 +02:00
Add options to choose audio language for the video (default is English)
This commit is contained in:
parent
605f1a8d67
commit
f3e0369710
6 changed files with 85 additions and 3 deletions
38
lib/utils.py
38
lib/utils.py
|
@ -45,7 +45,38 @@ PEERTUBE_CATEGORY = {
|
|||
"animals": 16
|
||||
}
|
||||
|
||||
### LANGUAGES ###
|
||||
YOUTUBE_LANGUAGE = {
|
||||
"arabic": 'ar',
|
||||
"english": 'en',
|
||||
"french": 'fr',
|
||||
"german": 'de',
|
||||
"hindi": 'hi',
|
||||
"italian": 'it',
|
||||
"japanese": 'ja',
|
||||
"korean": 'ko',
|
||||
"mandarin": 'zh-CN',
|
||||
"portuguese": 'pt-PT',
|
||||
"punjabi": 'pa',
|
||||
"russian": 'ru',
|
||||
"spanish": 'es'
|
||||
}
|
||||
|
||||
PEERTUBE_LANGUAGE = {
|
||||
"arabic": 5,
|
||||
"english": 1,
|
||||
"french": 13,
|
||||
"german": 11,
|
||||
"hindi": 4,
|
||||
"italian": 14,
|
||||
"japanese": 9,
|
||||
"korean": 12,
|
||||
"mandarin": 3,
|
||||
"portuguese": 6,
|
||||
"punjabi": 10,
|
||||
"russian": 8,
|
||||
"spanish": 2
|
||||
}
|
||||
######################
|
||||
|
||||
|
||||
|
@ -56,6 +87,13 @@ def getCategory(category, platform):
|
|||
return PEERTUBE_CATEGORY[category.lower()]
|
||||
|
||||
|
||||
def getLanguage(language, platform):
|
||||
if platform == "youtube":
|
||||
return YOUTUBE_LANGUAGE[language.lower()]
|
||||
else:
|
||||
return PEERTUBE_LANGUAGE[language.lower()]
|
||||
|
||||
|
||||
# return the nfo as a RawConfigParser object
|
||||
def loadNFO(options):
|
||||
video_directory = dirname(options.get('--file')) + "/"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue