oz_penguin (oz_penguin) wrote,
oz_penguin
oz_penguin

  • Mood:
  • Music:

Solving a strange problem with Armangil's podcatcher

I use v 3.1.6 of Armangil's podcatcher with a cron job to batch download the podcasts I listen to.

This morning, the output from the cron job reported

/usr/bin/podcatcher:1028:in `<': comparison of Time with nil failed (ArgumentError)

for each of the podcasts it attempted to download, and didn't download anything.

Something was obviously wrong. Here is an example of my call to podcatcher:

podcatcher -d /usr/local/podcasts --size 0 -H 2013.07.01 <URL of podcast RSS feed>

podcatcher is written in Ruby, a language I know nothing about, but a quick look at the relevant section of the code directed me to the votes file. podcatcher creates the votes file in the directory where you tell it to save the download (/usr/local/podcasts in my case).

The votes file looked like this:

---
ping-probability: 1.0
last-ping:
last-session: 2013-08-07 00:00:07.279195360 +10:00


Lines 1027-1028 of podcatcher look like this:

when 'last-ping'
     @data[key] = value unless @now<value


@now is the time at which podcatcher was invoked, so it was trying to compare a date value it thought should be against last-ping: with the current time. Since last-ping: was blank, it was throwing an error.

I copied the date/time from last-session: into last-ping:, and after that podcatcher was happy. Presumably the previous time I'd run the cron job, last-ping: had somehow ended up being updated with a null value.

I'm happy it was a easy fix, and wasn't the result of a ruby update rendering the code obsolete.
Subscribe

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments