From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:54:51 +0000 (-0400) Subject: its scuffed but it works sometimes to get albums X-Git-Url: http://git.skullheadx.com/nixos/static/gitweb.js?a=commitdiff_plain;h=refs%2Fheads%2Fcli;p=youtube-downloader.git its scuffed but it works sometimes to get albums --- diff --git a/links.txt b/links.txt deleted file mode 100644 index 5acca21..0000000 --- a/links.txt +++ /dev/null @@ -1 +0,0 @@ -https://music.youtube.com/watch?v=lYBUbBu4W08&si=z03FVSmqqyxKZFmZ diff --git a/ytdl/__pycache__/funcmodule.cpython-312.pyc b/ytdl/__pycache__/funcmodule.cpython-312.pyc index af7fa62..91e1dc7 100644 Binary files a/ytdl/__pycache__/funcmodule.cpython-312.pyc and b/ytdl/__pycache__/funcmodule.cpython-312.pyc differ diff --git a/ytdl/funcmodule.py b/ytdl/funcmodule.py index 83bfefb..53ddeee 100644 --- a/ytdl/funcmodule.py +++ b/ytdl/funcmodule.py @@ -62,7 +62,9 @@ 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'] + album = yt.title + if 'keywords' in yt.vid_info['videoDetails'].keys() and len(yt.vid_info['videoDetails']['keywords']) > 2: + album = yt.vid_info['videoDetails']['keywords'][-2] command = [ 'ffmpeg', '-i', input1, @@ -71,8 +73,8 @@ 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={title}', - '-metadata', f'artist={artist}', + '-metadata', f'title={yt.title}', + '-metadata', f'artist={yt.author}', '-metadata', f'comment={big_num_format(yt.views) + " views"}', '-metadata', f'date={yt.publish_date}', '-metadata', f'album={album}',