]> Skullheadx's Git Forge - youtube-downloader.git/commitdiff
add album and more accurate title/artist metadata
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Mon, 14 Oct 2024 18:52:25 +0000 (14:52 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Mon, 14 Oct 2024 18:52:25 +0000 (14:52 -0400)
README.md
ytdl/__pycache__/funcmodule.cpython-312.pyc
ytdl/funcmodule.py

index 4117e4416e7352fd8ef7ffef29730338b575bf79..8f6da0bbf59b8aa1900930ce0e1b82a489717d6f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -12,5 +12,4 @@ downloads the audio and video and stitches it together in the current directory.
 - `-f` - force replace if file exists
 
 # TODO:
-- [ ] add album name
 - [ ] figure out why -av takes so long compared to -a and -v
\ No newline at end of file
index 1852a604a6d2653655055b823cec7fd62ec731fc..af7fa62b138e763b4562e3255eccd304e5e28bc2 100644 (file)
Binary files a/ytdl/__pycache__/funcmodule.cpython-312.pyc and b/ytdl/__pycache__/funcmodule.cpython-312.pyc differ
index acd2018b8240ac2ed6b6b01690d76cc13fc831e3..83bfefb85b819db469d9d69b42455be7d430e077 100644 (file)
@@ -62,6 +62,7 @@ def download(link, mode, force=False):
 
 
 def convert_add_metadata(input1, input2, output, yt, m1=1, m2=0):
+    artist, album, title = yt.vid_info['videoDetails']['keywords']
     command = [
         'ffmpeg',
         '-i', input1,
@@ -70,10 +71,11 @@ def convert_add_metadata(input1, input2, output, yt, m1=1, m2=0):
         '-map', f'{m2}',
         '-c', 'copy',
         f'-disposition:v:{m2}', 'attached_pic',
-        '-metadata', f'title={yt.title}',
-        '-metadata', f'artist={yt.author}',
+        '-metadata', f'title={title}',
+        '-metadata', f'artist={artist}',
         '-metadata', f'comment={big_num_format(yt.views) + " views"}',
         '-metadata', f'date={yt.publish_date}',
+        '-metadata', f'album={album}',
         output + ".mp4",
         '-y'
     ]