Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: HOWTO: Set up RSS support for Transmission 1.93

  1. #1
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    HOWTO: Set up RSS support for Transmission 1.93

    This howto aims to detail the procedure to automatically parse an rss feed for recurring torrent files, i.e. a weekly television program. This is accomplished through the use of flexget, cron and transmission. Flexget is a multipurpose automation tool for things like torrents, podcasts, comics, ect. Cron is a daemon used to schedule tasks to run at a specific time. Each user has a crontab file, there's also a system crontab. Transmission is a multi-os bittorent program, it has a fairly plain vanilla interface, but gets the job done. Step 7 is entirely optional, but provides a handy icon in the notification area whenever torrent files are present in your download directory.


    Background

    I migrated from commercial operating systems several years ago-8.04 Hardy Heron was my first foray into the world of linux. I've been quite happy with almost every feature of Ubuntu, but disappointed with the lack of rss feed support in the default torrent client. So, like any self-respecting geek, I ran to google and searched 'transmission rss ubuntu', which returned 'http://theblawblog.com/use-transmission-cli-to-download-from-rss', however that guide was written some time ago, is using the cli version of transmission, and is for linux in general. I had to adapt parts of it for my system, and I thought there should be a concise, easy to follow guide that's specifically for Ubuntu. Now, I do realize that there are torrent clients available in the repositories that support rss feeds, without the need for an external program, but I like transmission, it's easy and it's the default client in 10.04.

    Note
    : This howto assumes you're running Ubuntu 10.04, using gnome, and all your packages are updated as of 09/26/10. If your system is not up-to-date:
    Code:
    sudo apt-get update && sudo apt-get upgrade


    Requirements

    Python 2.5.x or higher, easy_install, FlexGet, transmission 1.93, a source for your rss feeds


    Howto

    1. Check your installed version of python
    Code:
    python -V
    expected output: Python 2.6.5

    1b. If your version is below 2.5.x:
    Code:
    sudo apt-get install python2.6
    2. Get the easy_install tool
    Code:
    sudo apt-get install python-setuptools
    note that this step takes a bit of time to resolve.


    3. Get FlexGet
    3a1. For Python 2.5.x:
    Code:
    sudo easy_install http://download.flexget.com/unstable/FlexGet-1.0r1445-py2.5.egg

    3a2
    . For Python 2.6.x:
    Code:
    sudo easy_install http://download.flexget.com/unstable/FlexGet-1.0r1445-py2.6.egg
    note that this step takes a bit of time to resolve.

    3b. Verify FlexGet install
    Code:
    flexget -V
    expected output: FlexGet 1.0r1445

    3c. Determine location of executable
    Code:
    which flexget
    expected output: /usr/local/bin/flexget
    As long as the output matches what's expected, no worries. If it doesn't match, make a note of the output. When you get to step 5. refer to step 5b., rather than 5a.


    4. Create FlexGet config
    Code:
    mkdir ~/.flexget/ && touch ~/.flexget/config.yml && gedit ~/.flexget/config.yml


    4a
    . Set up FlexGet config
    I found this step to be the trickiest to accomplish. A few notes:
    1. Always use 2 spaces, never use tab!!
    2. If a text value contains any special characters, (i.e. {}[]%:), it must be enclosed in single quotes,' '
    3. If a text value contains a number it must be enclosed in single quotes, ' '
    4. All plugins are supposed to be indented with exactly the same number of spaces
    5. Plugin order doesn't matter. Neither does feed order, feeds are executed in a random order unless you use the priority plugin(detailed at flexget's wiki).
    6. You cannot list a plugin twice in a single feed.

    Copy and paste this sample config with dummy data into the gedit window you opened:
    Code:
    feeds:
      TV:
        rss: http://some.rss.website/feed/location/
        series:
          hdtv:
            - show 1
            - show 2
        download: ~/tmp/
    Breakdown of dummy config:
    Line 1:
    feeds:
    is a container which may contain any number of feeds under it.

    Line 2:
    TV:
    is the actual name of the feed, it must be indented by two spaces since it belongs to feeds:.

    Line 3:
    rss: http://some.rss.website/feed/location/
    is a Plugin used to retrieve a rss feed from the web. It must be indented by four spaces since it belongs to TV:.
    (note that is not an actual rss url, you must replace it with your rss feed source)

    Line 4:
    series:
    is a Plugin used to intelligently parse a list of shows. It will automatically increment-meaning it will download a torrent for S0XE01, then S0XE02. It must be indented by four spaces since it belongs to TV:.

    Line 5:
    hdtv:
    is a group name, and also a quality setting. It ensures that only torrents tagged with hdtv or better are downloaded. It must be indented by six spaces since it belongs to series:.

    Line 6:
    - show 1
    is a placeholder for the name of the show that you want to download a torrent for. Note the "- ", this must preface each of the shows in the list. It must be indented by eight spaces since it belongs to hdtv:.

    Line 7:
    - show 2
    is the same as Line 6, replace 'show 2' with the name of the program you want a torrent for, preserving the "- "...so if you wanted the torrent for south park, you'd change this line to read" - south park". It must be indented by eight spaces since it belongs to hdtv:.
    To add more shows to the list, simply indent the line by eight spaces, and preface the show name with "- ".

    Line 8:
    download: ~/tmp/
    is the third and final Plugin used in my sample config, it specifies where to save the parsed .torrent files. It must be indented by four spaces since it belongs to TV:.

    This should be enough to get FlexGet off the ground, however FlexGet supports quite a few more options than I've detailed here, for more information refer to:
    http://flexget.com/wiki/Configuration

    4b. Save config.yml, then check your syntax:
    Code:
    flexget --check
    expected output: Feed 'TV' passed


    5. Set up cron via terminal(note that step 5. Alternate details a method to add cron jobs via gui)
    If you haven't used cron before, follow these steps:

    5a1.
    Code:
    crontab -e
    It will ask which editor you'd prefer to use, I've written this howto for option 2, nano. If you choose one of the other options, disregard the keyboard commands I've specified.
    5a2. add this line:
    Code:
    @hourly /usr/local/bin/flexget --cron
    Press ctrl+o, enter, to save changes, ctrl+x to exit. You must include a newline after the final job, or cron will not run the job, and no errors will be reported at edit or runtime.(This is a bug with vixiecron, a fix is in the works; if you're interested here's the bug report @ launchpad)

    5b. If your output in step 3c. did not match the expected, modify the line to add to crontab thusly:
    Code:
    @hourly [insert output from 3c.] --cron

    5c
    . check /var/log/syslog after the top of the hour to verify the job is running, you should see a line similar to this one:
    Sep 27 07:00:03 %HOST% CRON[2966]: (%USER%) CMD (/usr/local/bin/flexget --cron)
    the %HOST% replaced with your hostname; the %USER% replaced with your username.

    If you have used cron before, simply add the line from 5a2. or 5b.(3c) to your existing crontab.


    5. Alternate
    If you'd rather accomplish this step via gui:
    5Aa. Get the gnome scheduled tasks program:
    Code:
    sudo apt-get install gnome-schedule
    5Ab. Applications>System Tools>Scheduled tasks
    5Ac. Click 'New'
    5Ad. Click 'A task that launches recurrently'.
    5Ae. Put whatever you like in the 'Description' box.
    5Af. Put the code from 5a2. ("/usr/local/bin/flexget --cron") or 5b.(3c) ("[insert output from 3c.] --cron")in the 'Command' box.
    5Ag. Click 'Add'.

    Your task should look like this:



    6. Set up transmission
    6a. Edit>Preferences>Torrents tab
    Check box for 'Automatically add torrents from:', point towards ~/tmp/
    6b. Check box for 'Start when added'
    6c. Uncheck box for 'Show options dialog'
    Optional, but recommended:
    6d. Check box for 'Seed torrent until its ratio reaches:', set to 1.00

    Your Transmission Preferences should look like this:



    7. Optional(but handy) zenity notification for new torrents
    Note: for this to function correctly, you must have transmission set to "Move .torrent file to the trash"(which I've forgotten to include in my screenshot above XD )
    7a1. CLI Method: Open a terminal
    Code:
    crontab -e
    7a2. Add this line to your crontab(replacing %USER% with your username):
    Code:
    1 * * * * ! pgrep zenity && ls /home/%USER%/tmp/* && DISPLAY=:0 zenity --notification --text="New Torrents"
    Press ctrl+o, enter, to save changes, ctrl+x to exit. You must include a newline after the final job.

    7b. GUI Method: Open gnome scheduled tasks(Applications>System Tools>Scheduled tasks)
    7b1. Click 'New'
    7b2. Click 'A task that launches recurrently'.
    7b3. Put whatever you like in the 'Description' box.
    7b4. Put the following code in the 'Command' box:
    Code:
    ! pgrep zenity && ls /home/%USER%/tmp/* && DISPLAY=:0 zenity --notification --text="New Torrents"
    7b5. Click the 'Advanced' bullet point, input a 1 in the 'Minute' box.
    7b6. Click 'Add'.

    Explanation:
    "! pgrep zenity" determines whether an instance of zenity is already in your tray; "ls /home/%USER%/tmp/*" checks your incoming torrent folder to see if any files exist there; "DISPLAY=:0" sets an environment variable that cron ignores; "zenity..." generates the tray icon itself.
    As an alternate to launching a zenity notification icon, you could just launch transmission itself. If you'd like this, modify the code in step 7a2. or 7b4. as follows:
    Replace "zenity" with "transmission", Replace "DISPLAY=:0 zenity --notification --text="New Torrents"" with "/usr/bin/transmission". Your modified line would look like this:
    Code:
    ! pgrep transmission && ls /home/%USER%/tmp/* && /usr/bin/transmission
    Your task should look like this:



    Procedure to revert the changes in this Howto

    Step 1.
    No revert required.

    Step 2.
    Code:
    sudo apt-get remove python-setuptools
    Step 3.
    I'm not sure how to revert this, but i would imagine that you only need to delete the output of 3c.
    Code:
    sudo rm /usr/local/bin/flexget
    Step 4.
    Code:
    sudo rm -r ~/.flexget/
    Step 5.
    Code:
    sudo crontab -e
    delete the "@hourly /usr/local/bin/flexget" line, ctrl+o, enter to save, ctrl+x to exit.

    Step 5A.
    Code:
    sudo apt-get remove gnome-schedule
    Step 6.
    Uncheck all boxes you'd checked in this step.

    Step 7.
    Code:
    sudo crontab -e
    delete the "1 * * * *! pgrep zenity && ls /home/%USER%/tmp/* && DISPLAY=:0 zenity --notification --text="New Torrents" " line, ctrl+o, enter to save, ctrl+x to exit.

    Sources:
    http://theblawblog.com/use-transmiss...nload-from-rss
    https://help.ubuntu.com/community/Cr...20Level%20Cron
    https://bugs.launchpad.net/ubuntu/+s...on/+bug/118168
    http://flexget.com/wiki/Configuration
    And a resounding thank you to the folks in #bash on irc.freenode.net, step 7 had eluded me for about three months...they solved it in two hours.
    Last edited by Vu1kan; January 9th, 2011 at 07:02 AM.

  2. #2
    Join Date
    Aug 2006
    Beans
    92
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: HOWTO: Set up RSS support for Transmission 1.93

    aww..nice post. i tried to get this working with flex a while back, but i didn't have any luck. going to try your write up now. thanks!

  3. #3
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set up RSS support for Transmission 1.93

    Well, one month and 500+ views later, I've a few questions for anybody that feels like responding. Firstly, is step one even required in a "fresh out of the box" lucid install? What parts of my guide are difficult to follow, and how would you recommend revising them? Has anybody come across another, simpler method to accomplish broadcatching using transmission? And lastly, how about reporting any successes/failures? If you're unable to get flexget working, I'm perfectly willing to try to help hammer out the problem.

    p.s. #2 google result when searching 'transmission rss ubuntu' woot!

  4. #4
    Join Date
    Jul 2006
    Beans
    Hidden!

    Re: HOWTO: Set up RSS support for Transmission 1.93

    It's fantastic! I just followed it, and had no trouble adding a couple things I needed to get right. There was a crazy error with permissions of the flexget folder, however. Wasn't writable.

    I would love to find out if there was some way to get these torrents added to Transmission with no options dialog. Because I would still love to use the options dialog for things I add myself...but not for the things automatically added by FlexGet. So I have it disabled right now so that it works for FlexGet, but still want to have it pop up for me.
    As far as I know, there is no way to do this - since Transmission relies on the same options for both the folder watching AND manual adding.

  5. #5
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set up RSS support for Transmission 1.93

    @erissiva: I may have a workaround concerning the options dialog: If you're comfortable w/cli, you could get the command line version of transmission(it's in the repo's), and have your FlexGet output folder monitored by that...I'm pretty sure this method wouldn't add your flexgot(hehe) torrents to the gui of transmission. Otherwise, I seem to recall that transmission will start downloading a file whether or not the options dialog is open...I can't be sure though, my options still match the screenshot i included in the howto.
    Also, I wonder if your error with the folder was due to the fact that the directory was created and accessed with essentially the same command? When I was muddling through the somewhat dated guide I based this on, I created the directory with one command, made the .yml with a second, and opened my gedit with a third...I'll install a lucid virtual machine tomorrow and do some testing.

  6. #6
    Join Date
    Jan 2010
    Beans
    29

    Re: HOWTO: Set up RSS support for Transmission 1.93

    @erissiva
    The "crazy error with permissions of the flexget folder" is bc step 4 shouldn't be using sudo.

    Running that step w/ the "sudo"s creates a directory and config file owned by root. It is a personal config file that is being created and thus should be owned by whatever account you login as.

    Corrected line would be:

    mkdir ~/.flexget/ && touch ~/.flexget/config.yml && gedit ~/.flexget/config.yml

  7. #7
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set up RSS support for Transmission 1.93

    I didn't realize the command shouldn't be sudo'ed...as i mentioned, i did that step in three parts...i've corrected the howto, thanks for pointing that out, proteusmoteus.

  8. #8
    Join Date
    Jun 2006
    Beans
    14

    Re: HOWTO: Set up RSS support for Transmission 1.93

    You might want to add a step that runs "flexget --test" to verify the config.yml file. Otherwise, great little guide, thanks.

  9. #9
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set up RSS support for Transmission 1.93

    @jstapels see step 4b..."flexget --check" will go through the .yml file and report any irregularities...whereas "flexget --test" just does a 'dry run', in other words, it runs flexget, but doesn't write any fetched torrent files to disk.

  10. #10
    Join Date
    Jun 2010
    Location
    Nebraska
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set up RSS support for Transmission 1.93

    Three months and 1500+ views later...wow, theres a disproportionate amount of replies to views ratio; I'm going to assume it's because people are looking at the howto and determining that it's not for them, or they're following the howto and not having problems. Either way, it's all groovy.
    My post this evening is to denote what I hope will be the final large update to the howto. I've accomplished everything I set out to do, and until the zenity developers implement right-click actions for notification icons, I don't foresee any major changes.
    Also, I wanted to let people know that I'm subscribed to the thread, and still just as curious for answers to my previous questions. As well as still willing to provide support, if anybody needs it. I would prefer you just make a new reply to the thread, so that we could help other people that may be experiencing your issues.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •