Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--exec doesn't run when --skip-download is specified #26859
Comments
|
I wrote a bash script to work around this problem which I'll provide incase anyone else wants it. #!/bin/bash
# Get the command line input.
LINK_STR="$1"
TITLE_TEMPLATE="%(title)s.%(ext)s"
# Path to the folder you want to download to.
# This could be substituted with "$2" then you'd include the output folder as the second argument when executing this file.
OUTPUT_PATH="/example/path"
cd $OUTPUT_PATH
# Download the thumbnail.
youtube-dl -o $TITLE_TEMPLATE --write-thumbnail --skip-download $LINK_STR
# Get the title of the video that was downloaded to search for in the output folder.
OUTPUT_TITLE="$(youtube-dl -o $TITLE_TEMPLATE --get-title $LINK_STR)"
# Get the full path to the thumbnail file.
DOWNLOADED_THUMBNAIL_PATH="$(find $OUTPUT_PATH -type f -name "$OUTPUT_TITLE.*")"
# Change thumbnail extension to .jpg with ffmpeg.
ffmpeg -i "$DOWNLOADED_THUMBNAIL_PATH" "${DOWNLOADED_THUMBNAIL_PATH%.*}.jpg" -hide_banner
rm "$DOWNLOADED_THUMBNAIL_PATH" |
|
This is expected behavior. |
Checklist
Verbose log
Description
When
--skip-downloadis an argument--execdoesn't run which creates issues when--execis used in conjunction with other options like--write-thumbnail.I want to download just the thumbnail for videos and change the thumbnail extension to
.jpgsince sometimes the thumbnails come through as.webp. The simplest solution would be getting the path and converting it right after it downloads, but currently that's not possible since--execdoesn't run.