title: add torrent to transmission from cron
body: <p>I'm trying to add torrents to transmission from python. The code is shown below...</p>
  
  <pre><code>def download_movie(magnet_link):
      os.system('transmission-gtk')
      #webbrowser.open(magnet_link)
      os.system('transmission-gtk ' + magnet_link)
  </code></pre>
  
  <p>As you can see I've tried 3 different options to add these torrents but none work.. I've also added XDG_RUNTIME_DIR="/run/user/1000" in the crontab file. The log in /var/mail is running the script but it shows: (transmission-gtk:14091): Gtk-WARNING **: cannot open display:. I've also run the command xhost + as said in <a href="http://www.thegeekstuff.com/2010/06/xhost-cannot-open-display/" rel="nofollow">http://www.thegeekstuff.com/2010/06/xhost-cannot-open-display/</a> but still the gtk-warning comes up. Anyone have any ideas? What I want eventually is that I run this script on a pi so if anyone has any alternatives, I'm all ears.. Thanks.</p>