updated readme with new changes

This commit is contained in:
ArabCoders 2025-03-04 21:08:08 +03:00
parent c58faa28c9
commit 4036dcacc4
2 changed files with 58 additions and 95 deletions

143
README.md
View file

@ -29,11 +29,10 @@ Your `yt-dlp` config should include the following options for optimal working co
```json ```json
{ {
"windowsfilenames": true, "windowsfilenames": true,
"live_from_start": true, "continue_dl": true,
"format_sort": [ "live_from_start": true,
"codec:avc:m4a" "format_sort": [ "codec:avc:m4a" ],
]
} }
``` ```
* Note, the `format_sort`, forces YouTube to use x264 instead of vp9 codec, you can ignore it if you want. i prefer the media in x264. * Note, the `format_sort`, forces YouTube to use x264 instead of vp9 codec, you can ignore it if you want. i prefer the media in x264.
@ -144,7 +143,6 @@ Before asking a question or submitting an issue for YTPTube, please remember tha
In order to test with the yt-dlp command directly, you can either download it and run it locally, or for a better simulation of its actual conditions, you can run it within the YTPTube container itself. In order to test with the yt-dlp command directly, you can either download it and run it locally, or for a better simulation of its actual conditions, you can run it within the YTPTube container itself.
#### Via HTTP #### Via HTTP
Simply go to `Console` button in your navbar and directly use the yt-dlp command. Simply go to `Console` button in your navbar and directly use the yt-dlp command.
@ -186,97 +184,66 @@ A Docker image can be built locally (it will build the UI too):
docker build . -t ytptube docker build . -t ytptube
``` ```
### ytdlp.json File ## ytdlp.json file
The `config/ytdlp.json`, is a json file which can be used to alter the default `yt-dlp` config settings. For example these are the options i personally use, The `config/ytdlp.json`, is a json file which can be used to alter the default `yt-dlp` config settings globally.
We recommend not use this file for options that aren't **truly global**, everything that can be done via the `ytdlp.json` file
can be done via a preset, which only effects the download that uses it. For example, my personal preset that i use for all
my jp video downloads is:
```json5 ```json5
{ {
// Make the final filename windows compatible. "name": "jp_videos",
"windowsfilenames": true, "format": "bv[ext=mp4]+(ba[ext=m4a][format_note*=original]/ba)/bv[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b",
// Write subtitles if the stream has them. "args": {
"writesubtitles": true, "writesubtitles": true,
// Write info.json file for each download. It can be used by many tools to generate info etc. "writeinfojson": true,
"writeinfojson": true, "writethumbnail": true,
// Write thumbnail if available. "merge_output_format": "mkv",
"writethumbnail": true, "final_ext": "mkv",
// Do not download automatically generated subtitles. "format_sort": [ "codec:avc:m4a" ],
"writeautomaticsub": false, "subtitleslangs": [ "en", "ar" ]
// MP4 is limited with the codecs we use, so "mkv" make sense. },
"merge_output_format": "mkv",
// Record live stream from the start.
"live_from_start": true,
// For YouTube try to force H264 video codec & AAC audio.
"format_sort": [
"codec:avc:m4a"
],
// Your choice of subtitle languages to download.
"subtitleslangs": [ "en", "ar" ],
// postprocessors to run on the file
"postprocessors": [ "postprocessors": [
// this processor convert the downloaded thumbnail to jpg. {
{ "key": "FFmpegVideoRemuxer",
"key": "FFmpegThumbnailsConvertor", "preferedformat": "mkv"
"format": "jpg" },
}, {
// This processor convert subtitles to srt format. "key": "FFmpegConcat",
{ "only_multi_video": true,
"key": "FFmpegSubtitlesConvertor", "when": "playlist"
"format": "srt" },
}, {
// This processor embed metadata & info.json file into the final mkv file. "key": "FFmpegThumbnailsConvertor",
{ "format": "jpg"
"key": "FFmpegMetadata", },
"add_infojson": true, {
"add_metadata": true "key": "FFmpegSubtitlesConvertor",
}, "format": "srt"
// This process embed subtitles into the final file if it doesn't have subtitles embedded. },
{ {
"key": "FFmpegEmbedSubtitle", "key": "FFmpegMetadata",
"already_have_subtitle": false "add_chapters": true,
} "add_infojson": true,
"add_metadata": true
},
{
"key": "FFmpegEmbedSubtitle",
"already_have_subtitle": false
},
{
"key": "Exec",
"exec_cmd": "/usr/bin/mkvpropedit %(filepath)q --edit track:a1 --set language=jpn --set name=Japanese --add-track-statistics-tags",
"when": "after_move"
}
] ]
} }
```
The options can be fount at [yt-dlp YoutubeDL.py](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L214) file.
And for the postprocessors at [yt-dlp postprocessor](https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/postprocessor).
> [!NOTE]
> You can use the `yt-dlp json config` box in the new Download page to convert your cli options to json format.
### presets.json File
The `config/presets.json`, is a json file, which can be used to add custom presets for selection in WebUI.
The file is supposed to be an array of objects, each object represent a preset, the schema for the object is as the following.
```json5
[
{
// (name: string) - REQUIRED - The preset name.
"name": "My super preset",
// (format: string) - REQUIRED - The required yt-dlp format. i.e. -f option in yt-dlp cli.
"format": "best",
// (postprocessors: array) - OPTIONAL - The postprocessors to run on the file. if it's preset or set to empty array, it will override the default postprocessors.
"postprocessors": [
// for example to embed thumbnail.
{
"key": "EmbedThumbnail",
"already_have_thumbnail": false
}
],
// (args: dict) - OPTIONAL - Extra yt-dlp arguments to pass to yt-dlp.
"args": {
// (key: string) - REQUIRED - The yt-dlp argument key.
"writethumbnail": true
}
},
{
// another preset, etc...
}
]
``` ```
For more expanded example please take look at the default presets file found in [app/library/presets.json](app/library/presets.json). You can convert your own yt-dlp command arguments into a preset using the box found in the presets add page. For reference,
The options can be fount at [yt-dlp YoutubeDL.py](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L214) file.
And for the postprocessors at [yt-dlp postprocessor](https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/postprocessor).
## Authentication ## Authentication

View file

@ -88,9 +88,7 @@
<div class="column is-6-tablet is-12-mobile"> <div class="column is-6-tablet is-12-mobile">
<div class="field"> <div class="field">
<label class="label is-inline" for="name"> <label class="label is-inline" for="name" v-text="'Name'" />
Preset name
</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input type="text" class="input" id="name" v-model="form.name" :disabled="addInProgress"> <input type="text" class="input" id="name" v-model="form.name" :disabled="addInProgress">
<span class="icon is-small is-left"><i class="fa-solid fa-n" /></span> <span class="icon is-small is-left"><i class="fa-solid fa-n" /></span>
@ -104,9 +102,7 @@
<div class="column is-6-tablet is-12-mobile"> <div class="column is-6-tablet is-12-mobile">
<div class="field"> <div class="field">
<label class="label is-inline" for="format"> <label class="label is-inline" for="format" v-text="'Format'" />
Format
</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input type="text" class="input" id="format" v-model="form.format" :disabled="addInProgress"> <input type="text" class="input" id="format" v-model="form.format" :disabled="addInProgress">
<span class="icon is-small is-left"><i class="fa-solid fa-f" /></span> <span class="icon is-small is-left"><i class="fa-solid fa-f" /></span>
@ -210,7 +206,7 @@ const props = defineProps({
const toast = useToast() const toast = useToast()
const convertInProgress = ref(false) const convertInProgress = ref(false)
const form = reactive( JSON.parse(JSON.stringify(props.preset))) const form = reactive(JSON.parse(JSON.stringify(props.preset)))
const opts = ref('') const opts = ref('')
const json_preset = ref('') const json_preset = ref('')
const importExpanded = ref(false) const importExpanded = ref(false)