Skip to content

Instantly share code, notes, and snippets.

@eruffaldi
Created July 16, 2017 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eruffaldi/9a52b62ff4febc988392a52548b82691 to your computer and use it in GitHub Desktop.
Save eruffaldi/9a52b62ff4febc988392a52548b82691 to your computer and use it in GitHub Desktop.
Youtube Download and Preserve originating URL
#!/bin/bash
# get filename from youtube-dl then replace it with mp4
# then download, convert to mp4 and put metadata
filename=$(youtube-dl --get-filename "$1")
filename=${filename%.*}.mp4
youtube-dl "$1" --recode-video mp4 --add-metadata
exiftool $filename -XMP:source=$1
exiftool $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment