Incorrect handling of the --sub-langs "ru-en" parameter (also --sub-langs "ru.*") #494
-
|
I tested the --sub-langs "ru-en" parameter inside the container using this video: https://youtu.be/xairCL9m9ec?si=EWXZxzGG-HbTFDfx But when I send --sub-langs "ru.*" through the YTPTube web interface, I see the following issue in the logs: The “ru-en” subtitle file doesn’t download — only the plain “ru” file is fetched, and that one is rendered incorrectly by most players (Vimu, VLC). However, when I request the list of available subtitles through the YTPTube web interface using --list-subs, the “ru-en” subtitle track does appear in the list: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
|
Looking at the yt-dlp compiled options i.e. the green button {
"command": "--format default --write-thumbnail --convert-thumbnails jpg --write-info-json --embed-info-json --embed-metadata --extractor-args youtube:player_client=web_embedded --windows-filenames --socket-timeout 30 --write-thumbnail --write-info-json --write-auto-subs --write-subs --sub-langs 'ru.*' --format 'bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio[language=ru]/bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio' --embed-info-json --embed-metadata --embed-thumbnail --embed-subs --convert-thumbnails jpg --sleep-subtitles 5 --verbose --replace-in-metadata pre_process:title '[\\.\\s]+' _ --list-subs --no-simulate --output '%(title).180B [%(extractor)s-%(id)s].%(ext)s' --paths home:/downloads --paths temp:/tmp 'https://youtu.be/xairCL9m9ec?si=EWXZxzGG-HbTFDfx'",
"yt_dlp": {
"format": "bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio[language=ru]/bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio",
"windowsfilenames": true,
"writeinfojson": true,
"writethumbnail": true,
"writesubtitles": true,
"writeautomaticsub": true,
"listsubtitles": true,
"subtitleslangs": [
"ru.*"
],
"verbose": true,
"socket_timeout": 30,
"extractor_args": {
"youtube": {
"player_client": [
"web_embedded"
]
}
},
"postprocessors": [
{
"key": "MetadataParser",
"actions": [
[
{
"__module__": "yt_dlp.postprocessor.metadataparser",
"__name__": "replacer",
"__qualname__": "MetadataParserPP.replacer",
"__doc__": null,
"__annotations__": {},
"__type_params__": [],
"__wrapped__": {},
"func": {},
"_function_with_repr__repr": null
},
"title",
"[\\.\\s]+",
"_"
]
],
"when": "pre_process"
},
{
"key": "FFmpegThumbnailsConvertor",
"format": "jpg",
"when": "before_dl"
},
{
"key": "FFmpegEmbedSubtitle",
"already_have_subtitle": true
},
{
"key": "FFmpegMetadata",
"add_chapters": true,
"add_metadata": true,
"add_infojson": true
},
{
"key": "EmbedThumbnail",
"already_have_thumbnail": true
}
],
"sleep_interval_subtitles": 5
}
}vs yt-dlp opts { 'simulate': False,
'format': 'bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio[language=ru]/bestvideo[height<=480][dynamic_range=SDR][vcodec!^=av01]+worstaudio',
'windowsfilenames': True,
'ignoreerrors': 'only_download',
'retries': 10,
'fragment_retries': 10,
'writeinfojson': True,
'writethumbnail': True,
'writesubtitles': True,
'writeautomaticsub': True,
'listsubtitles': True,
'subtitleslangs': ['ru.*'],
'verbose': True,
'cookiefile': '/config/cookies/cookies_test.txt',
'proxy': 'socks5://192.168.129.100:10808/',
'socket_timeout': 30.0,
'extractor_args': {'youtube': {'player_client': ['web_embedded']}},
'extract_flat': 'discard_in_playlist',
'postprocessors': [ { 'key': 'MetadataParser',
'actions': [ ( yt_dlp.postprocessor.metadataparser.MetadataParserPP.replacer,
'title',
'[\\.\\s]+',
'_')],
'when': 'pre_process'},
{ 'key': 'FFmpegThumbnailsConvertor',
'format': 'jpg',
'when': 'before_dl'},
{ 'key': 'FFmpegEmbedSubtitle',
'already_have_subtitle': True},
{ 'key': 'FFmpegMetadata',
'add_chapters': True,
'add_metadata': True,
'add_infojson': True},
{ 'key': 'EmbedThumbnail',
'already_have_thumbnail': True},
{ 'key': 'FFmpegConcat',
'only_multi_video': True,
'when': 'playlist'}],
'sleep_interval_subtitles': 5}looks identical minus the forced conversion due to json vs python object |
Beta Was this translation helpful? Give feedback.

No it's not possible as you can see from the log, however the early extraction might be the issue, Anyway once bb59e25 is built try it in dev branch.
With this change i was able to get
so i assume it's fixes the issue. https://github.com/arabcoders/ytptube/actions/runs/19477069306