Discussion:
--history usage
RS
2017-11-08 16:53:53 UTC
Permalink
What is the significance of the index numbers returned by a search
with --history? They are clearly not cache index numbers. In one case when
I searched for a tv programme using a cache index and --history I got a
radio programme even though I had used --type=tv. That is probably because,
unlike the cache, there is only one history file for both. Curiously a lot
more information is returned for --type=radio than --type=tv.

Clearly the main function of the history file is to enable get_iplayer to
warn when programmes have already been recorded, and to require --force if
the programme is to be recorded again. The information it stores goes far
further than that. Is there any easy way of getting the complete records?
One way of doing it would be to load the file into Wordpad and then search
for the PID. I have often thought it would not be too difficult to write a
small C or Python program to export it to a database or spreadsheet to make
it more searchable, but if get_iplayer already has the capability there is
no need.
Ralph Corderoy
2017-11-08 18:24:34 UTC
Permalink
Hi Richard,
Post by RS
What is the significance of the index numbers returned by a search
with --history?
They are line numbers, one based, in ~/.get_iplayer/download_history.
Post by RS
Is there any easy way of getting the complete records?
It's a simple text file of one record per line, with `|'-separated
fields.

$ awk -F\| '{print $6}' ~/.get_iplayer/download_history |
Post by RS
sort | uniq -c | sort -n
1 dafhigh1
1 flashaaclow1
1 flashvhigh2
1 hlsvhigh1
1 hvflow1
4 flashhigh1
10 flashhd2
28 flashaacstd1
31 hvfxsd1
148 flashvhigh1
312 hlshd1
1278 flashhd1
$
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
RS
2017-11-09 13:17:50 UTC
Permalink
From: Ralph Corderoy
Sent: Wednesday, November 8, 2017 6:24 PM
Post by Ralph Corderoy
Post by RS
What is the significance of the index numbers returned by a search
with --history?
They are line numbers, one based, in ~/.get_iplayer/download_history.
Post by RS
Is there any easy way of getting the complete records?
It's a simple text file of one record per line, with `|'-separated
fields.
Hi Ralph

Thanks for that. I had noticed that the PID always occurred at the
beginning of a line, so I ought to have thought of that. Once I turned off
word wrap the format became a lot clearer. I had not realised how easy it
was to import it to a spreadsheet. In PlanMaker I did not even have to tell
it the separator; it worked it out for itself. Calc was slightly more work,
but nothing onerous. I haven't yet tried in Excel.

One thing that did require a bit of searching was the download date and time
in column 5. I eventually found it was a Unix Epoch Timestamp, the number
of seconds since 1 January 1970. It can be converted to a date by
formatting a cell containing =(((E1/60)/60)/24)+DATE(1970,1,1) as a date.

As a spreadsheet the history is a useful reminder of programmes downloaded
and the directory they were downloaded to.

The cache can also be imported to a spreadsheet, although there is a need
for a liberal sprinkling of --exclude options to remove programmes which are
never going to be of interest, especially for radio programmes. It also has
to be remembered that the cache will probably be refreshed when get_iplayer
is started so the index numbers will change. If the spreadsheet is going to
be used to identify programmes for download it is safer to use the PID.

Best wishes
Richard
Ralph Corderoy
2017-11-09 14:20:52 UTC
Permalink
Hi Richard,
I eventually found it was a Unix Epoch Timestamp, the number of
seconds since 1 January 1970. It can be converted to a date by
formatting a cell containing =(((E1/60)/60)/24)+DATE(1970,1,1) as a date.
Yes, that works most of the time and is good enough.
I think the seconds-since-epoch time in the file is GMT, i.e. +0000.
And it doesn't have any leap seconds. :-)
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
Loading...