4

I would like to execute a script via youtube-dl's own options/settings/adjustments after a download is finished.

Reading through the documentation, I have not found anything that is relevant or helpful in this regard.

Is this possible or not possible?

henry
  • 844
  • 2
  • 9
  • 23

1 Answers1

4

Use the option --exec CMD

There's an example in the manual:

--exec CMD

Execute a command on the file after downloading, similar to find's -exec syntax. Example:

--exec 'adb push {} /sdcard/Music/ && rm {}'
guest
  • 2,134
  • 4
  • 11
  • Too add on that, it unfortunately executes the script after the download of _each_ file is finished. This is relevant in the case of when one uses youtube-dl do specify multiple URLs at once, i.e. `youtube-dl URL_1 URL_2`. – henry Apr 26 '20 at 18:47