How to find a particular episode

Colin Law clanlaw at googlemail.com
Sun Mar 4 12:04:28 EST 2012


On 4 March 2012 16:41, Andy Bircumshaw <andy at networkned.co.uk> wrote:
>
> On 4 March 2012, at 11:25, Colin Law wrote:
>>>>>> You can also use, then, `get_iplayer --pid b01czdrg`
>>>
>>> However, this *is* exactly what --pvr is for - when you add a programme using `get_iplayer --pvr-queue 1234` then get_iplayer will look up the PID and store that as the download criteria. It doesn't matter if the index number changes, as it invariably will, because the PID is eternal.
>>
>> OK, I did not realise that --pvr-queue would do that.  Presumably
>> there is a very small chance that the number will change between doing
>> the search and issuing the pvr queue command, but probably vanishingly
>> small.  Or is it clever enough to get the pid from the previous search
>> rather than querying again?
>
> The index number only changes when the index is refreshed.
>
> It will be refreshed if you run `get_iplayer --refresh` (or --flush) or if the cache is more than 4 hours old when you perform some other operation.
>
> The refreshing of the cache is obvious because "INFO: Getting tv Index Feeds…………" is first shown, then the list of newly added programmes.
>
> Personally, I find it annoying that searching for a programme sometimes necessitates waiting for a refresh to complete. I just want the results, not to have to sit through watching the download! So I have an hourly cronjob which does nothing but refresh the cache and thus I know that the index numbers will only change approximately upon the hour.

Would you have to be a little careful doing that, as the index number
may change in the background when the cron jog runs?  You could do a
search just before the job runs, get the id, and start or queue a
download based on that index just after the cronjob runs, with the
wrong index.

>
> 0 * * * *       /usr/local/bin/get_iplayer --type radio --refresh >> /dev/null 2>&1 && /usr/local/bin/get_iplayer --refresh --refresh-future >> /dev/null 2>&1
>
> Alternatively, you could alter the cache expiry period, for example:
>
> get_iplayer --expiry $((24*60*60)) --prefs-add
>
>>> Setting up a daily cronjob for off-peak hours, with only `get_iplayer --pvr` seems easier to me than setting ad-hoc cronjobs for `get_iplayer "some complex search"` and then having to remember to delete each one the next day.
>>
>> Yes, I think I am convinced, I thought the pvr stuff was more complex
>> in basic operation, but I see it can be used to do exactly what I
>> want.  Actually I think it does not matter if one forgets to remove
>> the cron job as it will not fetch the file again, if I read the docs
>> correctly (provided it is still there of course).  Not that I would
>> ever to forget to remove the job anyway... ah, crontab -e isn't it?
>
> The same PID won't be downloaded twice, but if you're using searches there's always a chance that a second programme will match.

Ok, thanks for the clarifications

Colin



More information about the get_iplayer mailing list