Remrecord Tool

One of the selling points of the 8320HD is its Remote Recording capability, which you access via the Fetch TV listings page or via a free Iphone app. I don't have an Iphone, so I can only comment on the TV listings method, which has these disadvantages:
  • Several channels (e.g. BBC red button 301) are "missing" compared to the 8320HD's EPG (this is up to Fetch TV to correct really).
  • Doesn't work if you disable JavaScript.
  • Loads in a lot of style sheets, JavaScript and images, so it can be quite slow to navigate around the EPG-style UI and this often forces me to use the search facility instead.
  • The search facility doesn't do an exact (or even sub-string) match on programme titles, so whilst it tends to put the closest match first, it also comes back with pages of results that don't even match a sub-string of the programme title that you typed in.
  • You often can't remotely record the HD simulcast of an SD programme (another Fetch TV bug in their search that they need to fix).
  • No way to filter out repeats from your search results (even though the detailed programme description does have a REP indicator).
  • No way to do multi-episode recordings (whether it's via a Series Link facility or just "record every non-repeat matching this programme title").
  • No automation facility (no API, no "repeat this set of searches and record the results every day").
As many users have found out, the "Series Link" facility on the 8320HD's EPG doesn't work too well either - I've often found all it does is set a recording for the same time slot in a week's time. In other words, even if you do program the 8320HD in advance with Series Link, you still can't trust it to get it right!

It then got me thinking - could I script something up to fix all the deficiencies of the Remote Recording facility and effectively add a more reliable version of Series Link for all my favourite shows? Yes, I could and it's unimaginatively called "remrecord"...

remrecord - Reliable automated remote recording for your 8320HD

Note: New features in 1.0 are in bold below

System requirements:
POSIX system with GNU-style awk, bash, cut, curl, date, grep, mkdir, rm,  sed, sleep and sort binaries.
Linux and Mac OS X has these as standard.
Windows requires Cygwin (check the binaries listed above are installed, particularly curl).

Licensing: GPL 3 as of version 0.2 upwards (mainly because I forgot to put a license file/statement in version 0.1!).

Version: 1.0 (stable status - release date: Tue 21 Dec 2010): Download
  • Man page, COPYING (GPL 3 license), Cygwin.txt (Windows install instructions), Makefile, README.txt and ChangeLog are now shipped with the package and all have DOS line endings now so that the wretched Windows Notepad can view them.
  • Many command-line flags are now supported - of particular note are the -s option to match on a sub-string of a programme title rather than an exact match and the -r option to remote record ranges of numbered programmes returned from a search, which also allows the user to cron remrecord to run non-interactively at a particular time.
  • Some settings have been moved into a configuration file and remrecord now offers a first-time interactive setup of the configuration file if one isn't present. This includes a set of programme titles that will be searched for by default if none are specified on the command line and a list of "banned" channels that will be filtered out of any programme searches.
  • Prompts for one or more programme titles (or sub-string of the titles) to record if no titles are passed as parameters.
  • Agent string faked as Firefox 4.0b7 (uses curl for Web requests).
  • Support for optional proxy server/port/username/password (fixed in 0.3 onwards - didn't work before then!). You can also specify the proxy server and port on the command line.
  • Regular (monthly by default) upgrade checks, which can be forced ahead of time if necessary. Will automatically download and install new versions and then execute the new version if it was successfully upgraded.
  • Automated login to Fetch TV site (using a username and password either in a config file or prompted for if not present).
  • Searches for the specified titles and makes additional page requests if the results are split into multiple pages. If a search fails, up to 2 retries will be attempted by default (there is also a command-line option to specify the total number of attempts).
  • Any results that don't exactly (or sub-string if -s supplied) match the search terms (case insensitively) are removed.
  • If additional episodes, repeats or HD simulcasts are detected, these are also loaded (possibly with further multiple results pages).
  • Merges all the results from one or more results pages, uniquely sorts them in ascending date order, removes programmes airing on "banned" channels, filters out repeat attempts to remote record a previously successful remote recording, can "prefer" SD or HD simulcasts, ignores repeats by default and numbers them from 1 upwards.
  • Loops around interactively asking for the result number ranges to record (blank asks for new search terms and 0 terminates the loop). If the -r option is used, ranges of numbered programmes will be non-interactively remote recorded instead.
  • For each result number selected, a Remote Recording request is made (with up to 2 retries by default if it fails) and the successful request is logged. The log file is later used to skip any repeat attempts to remote record that successful request (can be overridden with the -f option). Upon success, the programmes are then removed from the numbered list and the updated list is displayed again.
  • Each Web request made to the Fetch TV site will introduce an additional cumulative 0.2 seconds delay for the following requests, which is eventually reset back to 0.0 seconds when the programme selection prompt is displayed. This effectively throttles searches that generate a large number of Web requests (e.g. "and", "the", "news" etc).
  • Logs out from the Fetch TV site once the loop is exited.
Post-1.0 wishlist:
  • Fetch TV's listings search has a bug that fails to mark many sub-results (usually when following repeat/simulcast/episode "Also:" links from a search result) with "Record This"/"Remind Me" links. This means those sub-results can't be remotely recorded either by the Fetch TV Web interface or indeed by remrecord itself.  I've lodged a ticket with Fetch TV on this search bug (which they've reproduced and are going to work on fixing it), because it doesn't look easy to work around.

    The most obvious bug example is that it's frequently impossible to remotely record both simulcast BBC 1 (SD) and BBC 1 HD programmes if you just use the Fetch TV listings search - I gave them a Holby City example (which I never watch because it's awful) because that has 4 non-remote-recordable airings at the moment!
  • Need to provide a bash script to setup or remove the syslog-ng and cron services from within Cygwin (the instructions to do so are tortuous and really need to be one-liners with some prompts). Wondering if it should just be an option in the remrecord script (would need to detect we're in Cygwin rather than a "real" UNIX/Linux)?