mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-12-21 09:20:12 +00:00
Optionally embed metadata into video files (#21)
This adds basic `postprocessors` support and adds a setting to optionally enable `FFmpegMetadata`. It's the same as passing `--add-metadata` and `--add-chapters` via the `yt-dlp` CLI.
This commit is contained in:
parent
1c3ca8364c
commit
69e6e490f4
@ -14,7 +14,8 @@
|
||||
"limit_count": 5,
|
||||
"limit_speed": false,
|
||||
"sleep_interval": 3,
|
||||
"format": false
|
||||
"format": false,
|
||||
"add_metadata": false
|
||||
},
|
||||
"application": {
|
||||
"cache_dir": "/cache",
|
||||
@ -22,4 +23,4 @@
|
||||
"file_template": "%(id)s_%(title)s.mp4",
|
||||
"colors": "dark"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -454,6 +454,19 @@ class VideoDownloader:
|
||||
external = False
|
||||
if external:
|
||||
obs['external_downloader'] = 'aria2c'
|
||||
|
||||
|
||||
postprocessors = []
|
||||
|
||||
if self.config['downloads']['add_metadata']:
|
||||
postprocessors.append({
|
||||
'key': 'FFmpegMetadata',
|
||||
'add_chapters': True,
|
||||
'add_metadata': True,
|
||||
})
|
||||
|
||||
obs['postprocessors'] = postprocessors
|
||||
|
||||
# check if already in cache to continue from there
|
||||
cache_dir = self.config['application']['cache_dir']
|
||||
all_cached = os.listdir(cache_dir + '/download/')
|
||||
|
@ -106,6 +106,15 @@
|
||||
<input type="text" name="downloads.format" id="downloads.format">
|
||||
<br>
|
||||
</div>
|
||||
<div class="settings-item">
|
||||
<p>Current metadata embed setting: <span class="settings-current">{{ config.downloads.add_metadata }}</span></p>
|
||||
<i>Metadata is not embedded into the downloaded files by default.</i><br>
|
||||
<select name="downloads.add_metadata" id="downloads.add_metadata"">
|
||||
<option value="" disabled selected> -- change metadata embed -- </option>
|
||||
<option value="0">don't embed metadata</option>
|
||||
<option value="1">embed metadata</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit">Update Settings</button>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user