Add video description to metadata

This commit is contained in:
Ivan Habunek 2024-03-29 09:22:50 +01:00
parent 8a097f5f93
commit 1c1e5955b8
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
4 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@
- "Add shell auto completion, see: https://twitch-dl.bezdomni.net/shell_completion.html"
- "Add setting defaults via environment variables, see: https://twitch-dl.bezdomni.net/environment_variables.html"
- "Add `download --concat` option to avoid using ffmeg for joinig vods and concat them instead. This will produce a `.ts` file by default."
- "Add video description to metadata (#129)"
2.1.4:
date: 2024-01-06

View File

@ -81,12 +81,16 @@ def _select_playlist_interactive(playlists):
def _join_vods(playlist_path: str, target: str, overwrite: bool, video):
description = video["description"] or ""
description = description.strip()
command = [
"ffmpeg",
"-i", playlist_path,
"-c", "copy",
"-metadata", f"artist={video['creator']['displayName']}",
"-metadata", f"title={video['title']}",
"-metadata", f"description={description}",
"-metadata", "encoded_by=twitch-dl",
"-stats",
"-loglevel", "warning",

View File

@ -91,6 +91,9 @@ def print_video(video):
if channel or playing:
print_out(" ".join([channel, playing]))
if video["description"]:
print_out(f"Description: {video['description']}")
print_out(f"Published <blue>{published_at}</blue> Length: <blue>{length}</blue> ")
print_out(f"<i>{url}</i>")

View File

@ -56,6 +56,7 @@ def gql_raise_on_error(response: httpx.Response):
VIDEO_FIELDS = """
id
title
description
publishedAt
broadcastType
lengthSeconds