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.
If-satement in --exec #22397
If-satement in --exec #22397
Comments
|
Move code to sh script and run it in |
I have youtube-dl running on my raspberry pi and it checks every 10min if there is a new video in my youtube playlist. i add them when i'm not at home and the videos are downloaded then. i want to run some commands if the file title contains a specific uploader_id because i have to re-encode the videos with ffmpeg. when i try something like this
youtube-dl --merge-output-format mkv -f 'worstvideo[ext!=webm]+worstaudio[ext!=webm]/best[ext!=webm]' -o '%(timestamp)s-%(release_date)s-%(upload_date)s-%(uploader_id)s'.mkv URL --exec 'if [[ {} =~ <uloader_id> ]]; then touch /home/user/file; fi'This test should create an empty file when the file title contains the uploader_id. Running this results in this error:
/bin/sh: 1: [[: not foundWhen i run the command with single brackets i have this error:
/bin/sh: 1: [: NA-NA-20190913-uploader_id.mkv: unexpected operator