When I run my bash script manually via terminal (bashscript.sh) calling youtube-dl then youtube-dl is found and executed. When running via cron my log says :
/home/myhomepath/bashscript.sh: line 5: youtube-dl: command not found
My entry made by using crontab (Note: used crontab -e to input the entry and the interval to run the script is just made up for example purposes)
*/1 * * * * /home/myhomepath/bashscript.sh
Inside my bash script I've tried using the following at the top:
#!/usr/bin/env bash and also #!/usr/bin/bash but neither resolve the issue
I call youtube-dl in the script by the following:
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' --download-archive downloaded.txt --no-post-overwrites -o '/path/im/writing/to/'$RESULT 'http://youtube.com/watch?v='$RESULT
The binary is located here:
/usr/local/bin/youtube-dl
I've also tried updating youtube-dl to the latest version, but that doesn't resolve the issue. Command used:
pip install --upgrade youtube-dl