filemp3thumbnailspython-3.8file-manipulation

Remove Thumbnail from MP3 FILE - from yt-audio


When using yt-audio, how can you remove the thumbnail image (artwork / screenshot) that comes with the downloaded mp3 file?

Best would be to have a way of doing it by adding an additional argument to the command, but looping through the downloaded files works too if someone knows how to do that.

Just in case, this is the description of the yt-audio usage:

usage: yt-audio [OPTIONS] REQUIRED_ARGS

A simple, configurable youtube-dl wrapper for downloading and managing youtube audio.

Required Arguments (Any/all):
URL[::DIR]            Video/Playlist URL with (optional) save directory [URL::dir]
-e, --example1        Example playlist [Custom]
--all                 All [Custom] Arguments

Optional Arguments:
-h, --help            show this help message and exit
-v, --version         show version and exit
--use-archive         use archive file to track downloaded titles
--use-metadata        use metadata to track downloaded titles
--output-format [OUTPUT_FORMAT]
                        File output format
--ytdl-args [YTDL_ADDITIONAL_ARGS]
                        youtube-dl additional arguments

Thank you all!!


Solution

  • So in the end, I found the answer to this one myself (quite ashamed of the time it took me though.)

    To remove the thumbnail, don't download it.

    That sums it up basically.

    To not download the thumbnail, I simply needed to edit the common.py file once yt-audio was installed.

    The file is in the installation, under: yt_audio/common.py

    Editing the common.py file.

    In common.py find the Common class, and edit DEFAULT_ARGUMENT_VALUES.

    Or simply replace the value assigned to it, with this thumbnail-less version (below).

    DEFAULT_ARGUMENT_VALUES = {
            'download_command': 'youtube-dl -x -q --print-json --audio-format mp3 --audio-quality 0 '
                                '--add-metadata -o "$OUTPUT$" $URL$',
            'playlist_info_command': 'youtube-dl --flat-playlist -J $PLAYLIST_URL$',
            'output_format': '%%(title)s.%%(ext)s',
            'ffprobe_command': 'ffprobe -v quiet -print_format json -show_format -hide_banner "$PATH$"',
            'output_directory': str(PurePath(Path.home(), "Music"))
        }
    

    That's it.