alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
3.97k stars 264 forks source link

metube does not follow custom commands #356

Closed PilaScat closed 6 months ago

PilaScat commented 6 months ago

I'm trying to use this setting, cookies and user-agent are okay but the rest no:

{
    "cookiefile": "/config/cookies.txt",
    "user-agent": "USER-AGENT",
    "sub-lang": "it-IT",
    "embed-subs": true,
    "convert-subs": "srt",
    "remux-video": "mkv"
}

with yt-dlp they work flawlessy with this: yt-dlp --cookies-from-browser chrome --user-agent "USER-AGENT" --sub-lang "it-IT" --embed-subs --convert-subs srt --remux-video mkv URL

PikuZheng commented 6 months ago

according https://github.com/alexta69/metube?tab=readme-ov-file#configuration-via-environment-variables ,

PikuZheng commented 6 months ago
YTDL_OPTIONS={
  "cookiefile":"/config/cookies.txt",
  "http_headers":{"User-Agent": "USER-AGENT"},
  "writesubtitles":True,
  "subtitleslangs":["it-IT"],
  "final_ext":"mkv",
  "postprocessors":[
    {"key":"FFmpegVideoRemuxer","preferedformat":"mkv"},
    {"key":"FFmpegEmbedSubtitle","already_have_subtitle":False},
    {"key":"FFmpegSubtitlesConvertor","when":"before_dl","format":"srt"}
  ]
}

but why convert subtitle to srt before embed?

PilaScat commented 6 months ago

First I use a json file for configs, second I didnt know a order was needed since with yt-dlp it is not necessary as you can see, third these are not yt-dlp options, never saw them documented anywhere, now I'll try them

PikuZheng commented 6 months ago

nevermind about the order of parameter

YTDL_OPTIONS: Additional options to pass to youtube-dl, in JSON format. See available options here. They roughly correspond to command-line options, though some do not have exact equivalents here, for example --recode-video has to be specified via postprocessors. Also note that dashes are replaced with underscores.

For embedded yt-dlp, all command line parameters are ytdl_options

PikuZheng commented 6 months ago

--embed-subs --convert-subs srt

I mean, why should you both embed subtitles into mkv and convert to sub. If you embed, there is no need to convert the format first

PilaScat commented 6 months ago

These command seems perfect, but I have some more questions:

--embed-subs --convert-subs srt

I mean, why should you both embed subtitles into mkv and convert to sub. If you embed, there is no need to convert the format first

I wanted them in SRT, only this

PikuZheng commented 6 months ago

How to auto set first audio to match the language code?

It doesn't look like YouTube and I'm not familiar with it. Maybe there are relevant parameters on the command line? We can find its comparative ytdl_options

How to set the subs default and forced?

ytdl_options works throughout the whole container life cycle, you only need to set it

Why it puts files on NA folder? How to prevent and use root folder?

according https://github.com/alexta69/metube?tab=readme-ov-file#configuration-via-environment-variables ,You need to set DOWNLOAD_DIR

alexta69 commented 6 months ago

Please reopen if there are still issues