1

For example I have greasemonkey sript like this

Download YouTube Videos as MP4

https://greasyfork.org/en/scripts/1317-download-youtube-videos-as-mp4

I want to run this greasemonkey srcipt at the special time in firefox with crontab. for example i want to create this task in crontab in linux and I've tested this command but I think this is wrong

0 18 * * * export DISPLAY=:1 && firefox && greasemonkey --Download YouTube Videos as MP4

What is the correct command?

Genjo
  • 371
  • 1
  • 5
  • 15
green
  • 11
  • 3
  • Greasemonkey scripts are to help you when you are browsing webpages. To do standalone (headless) jobs, something like a Python script works much better. – Franklin Yu Feb 26 '17 at 13:47
  • To save your time you can verify whether `export DISPLAY=:1 && firefox && greasemonkey --Download YouTube Videos as MP4` works in command line. If it doesn't, it can't work in crontab. – Franklin Yu Feb 26 '17 at 14:08
  • May duplicates: https://stackoverflow.com/questions/28657604/using-greasemonkey-to-execute-javascript-every-5-seconds – Genjo Jan 10 '18 at 16:50
  • I recommend [youtube-dl](https://rg3.github.io/youtube-dl/) for this. It's a command line program that can download online videos from almost any site, especially YouTube. Your crontab would then look like `0 18 * * * youtube-dl -q "https://www.youtube.com/watch?v=dQw4w9WgXcQ"` (which will save that video in your home directory). – Adam Katz Jul 09 '18 at 21:30

0 Answers0