-2

I have a directory of files that I downloaded without metadata using youtube-dl in the format "name-youtubeID" (the standard youtube-dl format). Could someone help me come up with a script in either bash or python what will take the youtube ID part of the filename and place it at the end of the youtube-dl command line for every file in that directory so that I can add the metadata for those files?

florosus
  • 25
  • 5

1 Answers1

0

I've done it in a simple bash file:

cd add_metadata

for i in * ;  do
  f="${i##*-}"
  e="${f%.*}"
  youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" -w --no-continue --no-part --merge-output-format mp4 --add-metadata $e
done
deepak
  • 1,348
  • 1
  • 17
  • 25
florosus
  • 25
  • 5