Add metadata to the encoded video file

This commit is contained in:
Ivan Habunek 2021-11-20 13:31:17 +01:00
parent dd1f4e0d26
commit 928c6d64cf
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
2 changed files with 7 additions and 3 deletions

View File

@ -5,6 +5,7 @@ Twitch Downloader change log
------------
* Fix speed calculation when resuming download (#75, thanks CroquetteTheThe)
* Add artist and title metadata to resulting video (#80)
1.16.1 (2021-07-31)
-------------------

View File

@ -48,14 +48,17 @@ def _select_playlist_interactive(playlists):
return uri
def _join_vods(playlist_path, target, overwrite):
def _join_vods(playlist_path, target, overwrite, video):
command = [
"ffmpeg",
"-i", playlist_path,
"-c", "copy",
target,
"-metadata", "artist={}".format(video["creator"]["displayName"]),
"-metadata", "title={}".format(video["title"]),
"-metadata", "encoded_by=twitch-dl",
"-stats",
"-loglevel", "warning",
target,
]
if overwrite:
@ -275,7 +278,7 @@ def _download_video(video_id, args):
print_out("\n\nJoining files...")
target = _video_target_filename(video, args.format)
_join_vods(playlist_path, target, args.overwrite)
_join_vods(playlist_path, target, args.overwrite, video)
if args.keep:
print_out("\n<dim>Temporary files not deleted: {}</dim>".format(target_dir))