get_iplayer_genrss

get_iplayer_genrss is an open source utility for creating rss (podcast) feeds from your get_iplayer download history.  get_iplayer is a really powerful BBC iPlayer search and download program, which also has some great PVR functionality.

Used together, they can automatically push your favourite BBC tv or radio programs to your phone, tablet, browser, media centre, iTunes or anything else than can read rss feeds!

get_iplayer_genrss reads the get_iplayer download_history file and by using parameters passed in such as URL where downloads are e.g. "http://server/path/to/downloads" creates an RSS file based on its contents.

It supports functions such as:
  • Days in the past - only include in the RSS, downloads from the past [so many] days
  • Media type - only include downloads with a specific media type (tv, radio, etc)
  • Alternative directories - search alternative directories for the download, useful if the download has been copied to a different location
The code is being managed at github, the repository https://github.com/martinohanlon/get_iplayer_genrss.git and I would welcome any contributions, comments or feedback.

Install

wget https://github.com/downloads/martinohanlon/get_iplayer_genrss/get_iplayer_genrss-0.2.tar.gz

tar -xf get_iplayer_genrss-0.2.tar.gz

cd get_iplayer_genrss

Usage:

python get_iplayer_genrss.py -h

usage: get_iplayer_genrss.py [-h] 
                             [-a ALTDOWNLOADDIR] 
                             [-m MEDIATYPE] 
                             [-v]
                             outputRSSFilename 
                             numberOfPastDays 
                             rssTitle
                             rssDescription 
                             rssHTMLPageURL 
                             rssDownloadsURL
                             rssImageURL 
                             rssTTL 
                             rssWebMaster

Create RSS feed (podcast) from get_iplayer's download history

positional arguments:
  outputRSSFilename     The location to output the RSS file
  numberOfPastDays      The number of days in the past to 
                        include in the RSS
  rssTitle              Title of the rss feed
  rssDescription        Description of the rss feed
  rssHTMLPageURL        URL to the rss feed HTML page
                        www.example.com/rss/index.html
  rssDownloadsURL       URL where the downloads will be 
                        located,
                        wwww.example.com/rss/downloads/
  rssImageURL           URL of the rss image
  rssTTL                Time to live in minutes for the rss 
                        feed e.g 60 minutes
  rssWebMaster          RSS feed web master contact details 
                        e.g. me@me.com

optional arguments:
  -h, --help            show this help message and exit
  -a ALTDOWNLOADDIR, --altDownloadDir ALTDOWNLOADDIR
                        An alternative download directory as 
                        apposed to that in the download_history, 
                        useful if the downloads have been copied 
                        to another location; specify multiple by
                        seperating with a comma /path1,path2
  -m MEDIATYPE, --mediaType MEDIATYPE
                        Filter by get_iplayer media type (tv,
                        radio) ; specify multile values by 
                        seperating with a comma tv,radio
  -v, --verbose         Output verbose statements

get_iplayer_genrss needs to be run as the same user which is used to run get_iplayer as get_iplayer creates download histories per user.

Example:

If your webserver is on IP address http://192.168.1.100 and your iplayer downloads are in the virtual directory http://192.168.1.100/iPlayerDownloads and you want to create and RSS file in the /var/www directory of the last 30 days downloads:

./get_iplayer_genrss.py -v /var/www/get_iplayer_feed.rss 30 "The rss feed title" "A description of the rss feed" "http://192.168.1.100/rss_feed_html_file.html" "http://192.168.1.100/iPlayerDownloads/" "http://192.168.1.100/rss_feed_logo.jpg" 60 "me@myemail.com (Mr My Name)"

Alternative directories

If you have moved the downloads from the original get_iplayer download directory you can specify an alternative directory using the -a option:

./get_iplayer_genrss.py -v -a /path/where/downloads/are /var/www/get_iplayer_feed.rss 30 "The rss feed title" "A description of the rss feed" "http://192.168.1.100/rss_feed_html_file.html" "http://192.168.1.100/iPlayerDownloads/" "http://192.168.1.100/rss_feed_logo.jpg" 60 "me@myemail.com (Mr My Name)"

Multiple alternative directories can be specified by separating them with a comma:

-a /path/where/downloads/are1,/path/where/downloads/are2

Media Types

If you only want to include tv program's in the RSS feed you can specify a media type using the -m option:

./get_iplayer_genrss.py -v -m tv /var/www/get_iplayer_feed.rss 30 "The rss feed title" "A description of the rss feed" "http://192.168.1.100/rss_feed_html_file.html" "http://192.168.1.100/iPlayerDownloads/" "http://192.168.1.100/rss_feed_logo.jpg" 60 "me@myemail.com (Mr My Name)"

Multiple media types can be specified by separating them with a comma:

-m tv,radio

Currently in Alpha...

So far get_iplayer_genrss has been tested on debian linux and get_iplayer 2.82.

Please let me know if you have used and tested the program on a different setup or if you have problems.

5 comments:

  1. Hi, thanks for writing these guides for get_iplayer. Managed to follow along the initial setup but been left slightly confused by this section for what command I need to have to create a RSS feed for my setup. By webserver address do you just mean the IP address for the device running lighttpd? Additionally, by rssDownloadsURL is that an argument that will create the download directory for me or do I need to create a link within lighttpd to the directory where I have get_iplayer setup to download the files to? Thanks again.

    ReplyDelete
    Replies
    1. Hi Abe,

      You are stretching my memory now.. My iplayer downloader has been running for nearly 3 years now and I probably havent changed it since...

      Yes, the RSS has to contain the full URL of your webserver.

      So the rssHtmlPageURL is the link to a webpage which describes your rss feed. http://mywebserver.com/myrss/myrssfeed.html

      The rssDownloadsURL is the URL which will be put on start of the iplayer file name to create a full URL.http://mywebserver.com/myrss/iplayerfiles/ . The filename would be appended to this so the following URL would appear in the RSS file. http://mywebserver.com/myrss/iplayerfiles/[get_iplayer folder]/[get_iplayer_file_name].

      What I did was created a directory within lighttpd which linked to iplayerfiles.

      The rss file itself will be created in the outputRSSFilename path.

      I did create a load of install scripts to set all this up. They did work, although a lot has changed, but I'll get them onto github so you have a reference to work from if you think that would be helpful.

      I never thought anyone else used this!

      Mart

      Delete
    2. Thanks for the reply - and sorry for delay getting back to you. I played around some more and seem to be making some progress. I can now get my phone to see the RSS file and it is able to read the file list and descriptions fine. However, I am getting 404 erors when it tries to download the files. My guess is that this is a result of not having the directories setup correctly within lighttpd - completely new to using it so have no idea where to even start with this. I tried manually creating a symbolic link within /var/www/ to the get_iplayer downloads directory but no luck - still getting 404 error. Any idea of what I am doing wrong? Thanks again for the help - much appreciated.

      I am surprised more folk don't use this! There are a few BBC radio programmes I wish there were podcasts for and this combined with get_iplayer seems perfect way to create my own.

      Abe.

      Delete
    3. Update: Found the solution - I needed to add 'dir-listing.activate = "enable"' to the lighttpd conf file so that it allows browsing of directories within /var/www/.

      Delete
    4. Im pleased you seem to be making progress. I will package up an install and get it online. Have you got it working?

      Delete

Note: only a member of this blog may post a comment.