Filtering help please

Nigel Taylor njtaylor at asterisk.demon.co.uk
Fri Nov 18 10:17:57 EST 2011


On 11/18/11 13:53, Dr. Curt 'Mex' Nicol D.D. Ph.D. wrote:
> Hi
> 
>>> However I want to omit audiodescribed and signed, I have tried:
>>> get_iplayer --type=tv --long --exclude-category=-audiodescribed
>>
>> "audiodescribed" isn't a programme category, it's a programme version. A
>> given programme may have multiple versions (default, audiodescribed, signed)
>> with the same category descriptors.  Use this instead:
>>
>> get_iplayer --type=tv --long --versions=default
> 
> Just tried this, unfortunately I'm still getting both audiodescribed,
> and signed listed.
> 
> How do I exclude things from searches, adding a '-' seems to have no effect.
> 
> -Mex
> 
> _______________________________________________
> get_iplayer mailing list
> get_iplayer at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/get_iplayer
> 
Hi,

The search uses regular expressions so to find a where a download occurs in only one 
specific version you need to use the ^ = begining of line, $ = end of line

get_iplayer --type=tv --long --versions=^default$
.....
1032:	ZingZillas: Series 2 - 15. Cinema Day, CBeebies, Children's,Entertainment & Comedy,Learning,Pre-School,TV, default, 1 days 15 hours ago - The ZingZillas intend to have a day at the cinema, but the film projector blows up.
1033:	am.pm - 15/11/2011, BBC Two, Factual,Politics,TV,Wales, default, 2 days 17 hours ago - Including First Minister's Questions.

INFO: 677 Matching Programmes

Without the ^ and $ the result returns the large number...
get_iplayer --type=tv --long --versions=default
.....
INFO: 995 Matching Programmes

total = 1033 

Unfortunately 677 is the wrong number, a more complex regular expression is needed,

get_iplayer --type=tv --long --versions=default[[:punct:]]?$
...
INFO: 837 Matching Programmes

This works on OpenBSD, Debian not tried on Windows..

[[:punct:]] is any punctuation character, only interested in a comma really but comma is used as a delimter.

? is Match 0 or 1 times the preceding character

So the expression matches default or default,

You can verify that number using the index cache directly.. 838 includes a header line.

$ cut -d"|" -f1,9 .get_iplayer/tv.cache | grep -v signed  | grep -v audiodescribed | wc              
     838     838   10166


Nigel



More information about the get_iplayer mailing list