# Global blocklist for wishlists (standalone)



## mikerr (Jun 2, 2005)

Ever been annoyed that your keyword wishlist picks up cartoons?

This script runs in the background, and cancels items from the todo list that match your blocklist.
*Note it never cancels a seasonpass or manual recording, just wishlist recordings.*

*Example 1*
You set a low priority wishlist for all films to keep a few films in now playing, 
but you don't want "old" films.

```
/var/hack/blocklist.tcl -year 1970
```
(Never record films older than 1970)

*Example 2*
You have a wishlist for "Vampire", but don't want cartoons.
Block the "Animated" and "Children" genres by putting them in /var/hack/blockgenres.txt:

```
"Animated"
"Children"
```
 (Never record wishlists that match Animated or Childrens programmes)

You can get a list of available genres by typing (for example)

```
/var/hack/blocklist.tcl -listgenres 
or
/var/hack/blocklist.tcl -listgenres "A*"
```
There is a tivoweb module to help set up the title blocklist: 
http://archive.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=153834
http://www.denali.org.uk/blocklist

It shares the blocklist config files from the above blocklist tivoweb module, so install that to setup your title blocklists,

or just add titles to /var/hack/blocklist.txt:

```
"The Lost World"
"Afro Samurai"
"Robot Wars"
```
(Those programmes are matched by wishlists, but I never want them to record)

It auto-backgrounds:

```
/var/hack/blocklist.tcl
```
logging goes to /var/log/blocklist.

# Version 1.3


----------



## Pete77 (Aug 1, 2006)

I find Kids programs are the worst offenders in being accidentally picked up by my Wishlists. Or rather I notice the kids program offenders far more than any others because there is zero chance I will be interested in them.

On the other hand I have never used the Global Blocklist so far so I will have to get to grips with that too. I had perhaps gained the impression that it was only suitable for US Tivos as there seems to be no long term thread running about the Global Blocklist in Tivo UK.


----------



## TCM2007 (Dec 25, 2006)

Pete77 said:


> I find Kids programs are the worst offenders in being accidentally picked up by my Wishlists. Or rather I notice the kids program offenders far more than any others because there is zero chance I will be interested in them..


remove the kids channels for CIR, should block most of them.


----------



## Pete77 (Aug 1, 2006)

TCM2007 said:


> remove the kids channels for CIR, should block most of them.


True. I leave them in the EPG purely for when my sister and young niece and nephew visit.


----------



## realbigmike (May 20, 2006)

So the .tcl automatically deletes what is outlined in the blocklist from the ToDo list?

Sorry for the dumb Q, but to install this I can copy it anywhere on the tivo and call it in the rc.sysinit.author?


----------



## mikerr (Jun 2, 2005)

Yes, thats exactly right.

You might want to also install the tivoweb module to easily set the config file.


----------



## realbigmike (May 20, 2006)

Looks like I have to pull my hard drive and edit rc.sysinit.author because blocklist.tcl hangs for me. 
I ran it from telnet and it said:
Opening db
closing db
It seemed ok but didnt do anything to my ToDo list so I added it to rc.sysinit.author in hopes it would work. My tivo still starts but ftp, telnet, and TWP are down unfortunately. Maybe I had a different blocklist in my TWP than the one u have mikerrr.


----------



## TCM2007 (Dec 25, 2006)

That will be caused by either a problem in how you edited rc.sysinit.author, or failing to background the command with an &


----------



## realbigmike (May 20, 2006)

It seems to be running fine but it does not delete any shows from the ToDo List.

```
master:/hack/scripts #
master:/hack/scripts # ./blocklist.tcl &
[2] 256
master:/hack/scripts #
master:/hack/scripts # Opening db
closing db
Opening db
closing db
Opening db
closing db
Opening db
closing db
Opening db
closing db
```
I have TWP installed in /hack/TivoWebPlus, not /var/hack is this the problem? Just a guess, I'm noob.
I opened up the tcl script and the only thing I found that may be wrong for me is 
set blocklist [load_list "/var/hack/blocklist.txt"]
set blockpatt [load_list "/var/hack/blockpatt.txt"]

I store your blocklist.tcl in /hack/scripts/


----------



## mikerr (Jun 2, 2005)

Those files are created by the tivoweb module,

check /var/hack/blocklist.txt actually exists.


----------



## threadkiller (Dec 12, 2002)

realbigmike said:


> Looks like I have to pull my hard drive and edit rc.sysinit.author because blocklist.tcl hangs for me.
> I ran it from telnet and it said:
> Opening db
> closing db
> It seemed ok but didnt do anything to my ToDo list so I added it to rc.sysinit.author in hopes it would work. My tivo still starts but ftp, telnet, and TWP are down unfortunately. Maybe I had a different blocklist in my TWP than the one u have mikerrr.


your better of using Sandertons startup script editor, if you have Tivoweb, easier & safer than editing rc.sysinit.author directly


----------



## realbigmike (May 20, 2006)

threadkiller, I looked up Sanderton's editor but it looks like you have fix it if your tivo wipes out /var/hack/ as it sometimes does. 

Hackman has a nice easy module for editing it, but ftp and textpad works well too. But yeah, if you mess this it you have to pull the hard drive.

So back to blocklist.tcl . . . in /var/hack/ I do have the 2 files that were created and they are 0kb. 

Just an idea- the blocklist.tcl should only run after a guide update is indexed, this is when tivo adds shows to the ToDo List and the block list. It seems excessive to run it every 10 minutes don't you think? It is a necessary service though, IMO.


----------



## mikerr (Jun 2, 2005)

If those two files are empty (0kb), then there is nothing to block... what did you expect ? 

Install the tivoweb module to set them up, or just add titles to block in /var/hack/blocklist.txt:


```
% cat /var/hack/blocklist.txt
"The Lost World"
"Afro Samurai"
"Robot Wars"
[etc]
%
```
IIRC the todo items "came back" after an hour or so (or maybe less), 
thats why its set to every ten minutes. I should probably relook at that sometime.


----------



## realbigmike (May 20, 2006)

I have items in my blocklist in TivoWebPlus though. TWP2.0 comes with the blocklist already built in (ui_todo.itcl), is this not what you based this program on. I figured your tcl script would pick up on that and use the data. Did I misunderstand something ?

Looks like it is storing my blocklist data somewhere else because in ui_todo.itcl there is the line that is commented out tho:

#set blocklist [gbl_savefile "/var/hack/etc/blocklist.txt" $blocklist]

I haven't found where it is storing my blocklist data, the ones in /var/hack/ or /var/hack/etc/ were 0kb, empty files.


----------



## mikerr (Jun 2, 2005)

so long as you have titles in /var/hack/blocklist.txt as in post 13, it should work.


----------



## mikerr (Jun 2, 2005)

I've revamped this module quite a bit:

it now has the ability to block whole genres and older films.

See first post.


----------



## alan_m_2004 (Jan 6, 2005)

Hello,

I've installed blocklist.tcl to both my tivos.

It seems to work fine on one, when I run it on the second I get;
/var/hack #blocklist.tcl
/var/hack/blocklist.tcl: proc: command not found
/var/hack/blocklist.tcl: return: bad non-numeric arg `[string'

I'm not to sure what that means.

Thanks in advance,

Alan.


----------



## mikerr (Jun 2, 2005)

Have you edited the file maybe?
first line should be

```
#!/tvbin/tivosh
```


----------



## alan_m_2004 (Jan 6, 2005)

Hi MikeErr,

That was one of the first things I checked;

/var/hack #less blocklist.tcl
WARNING: terminal is not fully functional
blocklist.tcl (press RETURN)
#!/tvbin/tivosh
#
# Blocklist.tcl v1.3
#
# Removes wishlist items from the todo list based on blocklists

Reading through the tcl code I can't see any obvious calls to external commands . Are there any dependencies on other programs?

Thanks in advance (and for providing such programs)

Alan.


----------



## mikerr (Jun 2, 2005)

"proc" is a tcl command, so its trying to run it as a shell script, not a tcl script. 
Re upload it in binary mode maybe?

This hack doesn't have any dependancies on any other programs.
It does expect to see some entries in /var/hack/blocklist.txt, or it won't actually block anything ...


----------



## alan_m_2004 (Jan 6, 2005)

Thanks - will try reloading it at weekend when I have a little more time


----------



## Pete77 (Aug 1, 2006)

So what should be in the blockpatt.txt file if anything then mike? Or is this data only generated by your tcl blocklist program for its own purposes?


----------



## Pete77 (Aug 1, 2006)

Pete77 said:


> So what should be in the blockpatt.txt file if anything then mike? Or is this data only generated by your tcl blocklist program for its own purposes?


Answering my own question I notice that the blockpatt.txt file is referred to in the amended To Do module functionality and blocklist editing features added by Denali's xlist.itcl module

blockpatt.txt according to the Tivoweb module seems to relate to specific episode titles in a series that you want to block rather than blocking the whole series by putting the series name in blocklist.txt?

I think that's right but this thread makes no mention of the purpose of blockpatt.txt or what should be in it

Also are episodes listed in blockpatt.txt actively blocked by Mike's tcl application or not or do they only get ticked for deletion in the To Do list as Denali originally intended?


----------



## mikerr (Jun 2, 2005)

From the tivoweb module:


blocklist tivoweb module said:


> Entries in the Blocking Patterns (right) are compared against _episode names_ and _descriptions_ in the same lists,
> Entries in this list may include the _wildcards_ *?* for matching any character and *** for matching any string; locical AND combinations may be expressed as _\"string1+string2\"_
> Entries on this list are _NOT_ case-sensitive and there are implicit *** wildcards around the patterns when
> matching against the lists.
> ...


I did keep support for those in this standalone version (using blockpatt.txt) 
but TBH an exact title match (blocklist.txt) and/or genre match (blockgenres.txt)
is more than enough for my usage.


----------



## Pete77 (Aug 1, 2006)

mikerr said:


> I did keep support for those in this standalone version (using blockpatt.txt) but TBH an exact title match (blocklist.txt) and/or genre match (blockgenres.txt) is more than enough for my usage.


OK thanks for the confirmation.

There are a couple of series I have Wishlists for where I have now caught all the episodes currently made but the series is shown again once every few months. So I only want Tivo to record any new episodes of the series that are made. So this would be a way to achieve this by putting the titles of all currently made episodes in blockpatt.txt (whilst not having the series title in blocklist.txt).

Having said that I have a Season Pass and a Wishlist for the series in question so I would also need to delete the Season Pass too for this to work.

Am I right in thinking the correct use of this app is just to start it automatically at bootup from an entry in rc.sysinit.author.edit and it then runs every 10 minutes removing programs that meet the criteria from the To Do list - there is no need for regular cron jobs to run it? I would imagine the Tivo resource overhead is also probably quite small compared to SortNP?


----------



## Pete77 (Aug 1, 2006)

mikerr said:


> There is a tivoweb module to help set up the title blocklist:
> http://archive.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=153834
> http://www.denali.org.uk/blocklist
> 
> It shares the blocklist config files from the above blocklist tivoweb module, so install that to setup your title blocklists,


So if I add the words "Qualifying" and "Highlights" to the right hand column (episode descriptions) in the manual editor of the block files accessed from the User Interface/To Do list in TivoWeb will the Qualifying and Highlights programs for "Formula 1" on BBC One and BBC Three then be blocked but the Race program still recorded? I presume they won't be blocked if I use an SP for Formula 1 but will be if I only record Formula 1 using a Wishlist for "Formula 1"?

However at present in "To Do" the Formula 1 Highlights program on BBC Three seems to still be ticked for deletion by the Blocklist but has not actually been removed from the "To Do" list.

Do you have any ideas about this Mike?


----------



## mikerr (Jun 2, 2005)

The tivoweb module and standalone program in this thread work differently, but share a config file.

The standalone module in no way affects SPs, only wishlists.

The tivoweb module does show effects on all todo items, not just wishlists, but any deletions are actioned manually by clicking in tivoweb.


----------



## Pete77 (Aug 1, 2006)

mikerr said:


> The standalone module in no way affects SPs, only wishlists.


Yes I do understand that.



> The tivoweb module does show effects on all todo items, not just wishlists, but any deletions are actioned manually by clicking in tivoweb.


I also understand that latter point.

However I now have a scenario where my Formula 1 programs on BBC One and BBC Three are recorded only by a Wishlist and there is no SP for the series on either channel, so my question remains if I have Qualifying and Highlights listed in the right hand "blocking patterns" column of the To Do blocklist editor will those words cause my Wishlist for Formula 1 to be blocked for episodes containing the words Highlights or Qualifying in the episode description?

It seems that this episode specific blocking is probably not happening based on tonight's BBC Three Formula 1 Highlights program having still recorded on my Tivo but if so is there any way that your standalone tcl utility can also be extended to block programs by reference to any keyword in the episode title or episode description?


----------



## TCM2007 (Dec 25, 2006)

Ever think you might be better off just manually picking the showing of the race you want to record?


----------



## Pete77 (Aug 1, 2006)

TCM2007 said:


> Ever think you might be better off just manually picking the showing of the race you want to record?


No. Definitely not. Surely I would have bought a dumb HD PVR if I had wanted to do that.

However it seems I may be better off to use Tivoweb to cancel the recordings I don't want to take place once a week or so and/or to delete the unwanted F1 recordings soon after they have taken place.

But like I said giving Qualifying, Race and Highlights a different SP would totally have covered the situation and allowed me to do what I want to do. This is something which Digiguide already makes possible with their F1 EPG data but it seems to be beyond the capabilities of Tribune.:down:


----------



## nickf (Oct 12, 2001)

It's taken a lot of manual tweaking by the DigiGuide staff to get the F1 programmes the way they are...


----------



## TCM2007 (Dec 25, 2006)

Pete77 said:


> No. Definitely not. Surely I would have bought a dumb HD PVR if I had wanted to do that.
> 
> However it seems I may be better off to use Tivoweb to cancel the recordings I don't want to take place once a week or so and/or to delete the unwanted F1 recordings soon after they have taken place.


So you'd rather do EXTRA work over and above what would be required to manually set the recordings, just so some element of them is automatic. Hmm.


----------



## Pete77 (Aug 1, 2006)

TCM2007 said:


> So you'd rather do EXTRA work over and above what would be required to manually set the recordings, just so some element of them is automatic. Hmm.


I prefer it that way so that the recording of the programs is fail safe.
I then delete and tell Tivo to not record the programs I don't need.


----------



## Pete77 (Aug 1, 2006)

nickf said:


> It's taken a lot of manual tweaking by the DigiGuide staff to get the F1 programmes the way they are...


Do you know someone who works at Digiguide then Nick?

I thought that you were a former NatWest man yourself?


----------



## glen_a_stewart (Jan 30, 2010)

Perl offers a nice module called WWW::Mechanize. With this TINY little script, your computer can go to your Tivo's TODO page and submit the form that deletes your TivoWeb blocklist choices automatically.

Here's the perl script:
-------------------------
#!/usr/bin/perl

use WWW::Mechanize;
my $agent = WWW::Mechanize->new();

$agent->get('http:SLASHSLASHtivo/todo');
$agent->form_name('form');
$agent->click('submit');

$agent->form_number(1);
$agent->click('submit');
------------------------

Replace the SLASHSLASH with // above.

Advantages over the blocklist.tcl:

1. no additional memory or load impact on the Tivo
2. no need to install blocklist.tcl (addresses the hassle with TivoWebPlus using an incompatible blocklist file, with respect to blocklist.tcl, on some hacked Tivos)
3. deletes shows resulting from both wishlist and season pass

Disadvantages:

1. Requires a regularly running computer (that rules out any Microsoft PC) 
2. Perl and WWW::Mechanize modules must be installed


----------



## mikerr (Jun 2, 2005)

from the middle of another thread:


Pete77 said:


> I also still can't get Blocklists to work properly for a whole series or one off film eg "The Sinking of the Rainbow Warrior" on TrueMovies is always caught by my Wishlist for French
> 
> it seems to work fine in the more complicated fashion of blocking Formula1 Highlights and Qualifying by having a description for the episode in the second column after Formula1 in the first column in the list that you can edit through the add on app for the To Do list.
> 
> I wonder if the fact that I have extended episode titles in Now Playing using the SortNP hack is perhaps causing this problem (Formula 1 does not have episode titles so would not be affected by any amendment to the Now Playing title).


That'll be because blocklists is doing an exact match, and your title is probably "The Sinking of the Rainbow Warrior (1970)" not just "The Sinking of the Rainbow Warrior"

Adding a * on the end : "The Sinking of the Rainbow Warrior*" should work for you.


----------



## Pete77 (Aug 1, 2006)

mikerr said:


> That'll be because blocklists is doing an exact match, and your title is probably "The Sinking of the Rainbow Warrior (1970)" not just "The Sinking of the Rainbow Warrior"
> 
> Adding a * on the end : "The Sinking of the Rainbow Warrior*" should work for you.


So this wouldn't happen if I wasn't adding episode titles to program descriptions using SortNP? But adding a * to the end of all my Global Blocklist program names before the closing quote marks should fully resolve the issue?

There are quite a number of repeated films on TrueMovies, Zone Horror and the like that are regularly recorded by Tivo despite the program title being in my Global Blocklist.

By the way I only run SortNP once a day using a cron job script about 4am to add titles to the Now Playing descriptions and SortNP is then deactivated for the rest of the day when my Tivo goes off for five minutes at 5am on a timer. The reason I do this is becasue I find the memory overhead of SortNP unacceptable with my very long Now Playing list. But once the episode titles are added they are retained in Now Playing indefinitely (unless a different Sort NP sort is run).


----------



## Pete77 (Aug 1, 2006)

Adding a further query does an item that is present in the Global Blockists text file also prevent that program being recorded as a Scheduled Suggestion by Tivo and/or it being listed in "Tivo's Suggestions"?

If not is there a way that such functionality could be added to the Global Blocklists module? Also is there a way a Global Blocklists item could stop an episode or episode of a series for which a Season Pass is active from being recorded if just the episode name is in the second column of the editing module accessible from the To Do list? Or is the only way to achieve this to set a Wishlist for the series instead and then list the episodes one wants to block in the second column in the To Do blocklist editor module?


----------



## mikerr (Jun 2, 2005)

It currently affects wishlists only, it could be changed to cancel suggestions with very little code.

Cancelling SeasonPass recordings would be too problematic for the user IMO,
as setting seasonpass really means you do want those exact shows !

If its repeated films you want to stop, then I think tracker will do that for you.


----------



## Pete77 (Aug 1, 2006)

mikerr said:


> Cancelling SeasonPass recordings would be too problematic for the user IMO,as *setting seasonpass really means you do want those exact shows !*


No if I set a Season Pass for Formula1 I (and I imagine plenty of other people) only actually want the race on Sunday morning/afternoon and not the qualifying or highlights programs.



> If its repeated films you want to stop, then I think tracker will do that for you.


I don't currently have anything script or cron job wise that can run tracker unattended to automatically de-schedule programs I have recorded more than 28 days before. Of course if you could invent such a script Mike it would no doubt be very greatly appreciated.:up:


----------



## kweller (Mar 10, 2002)

Calling this from rc.sysinit.author doesn't actually work unless the code is installed as well...

Thanks Mike, that's a useful hack.

If only figuring out why the TiVo isn't recording suggestions was as easy.

Kevin


----------



## Pete77 (Aug 1, 2006)

kweller said:


> If only figuring out why the TiVo isn't recording suggestions was as easy.


Suggestions have been behaving very strangely lately. I was down to only about three yesterday after I thumbed down various Suggestions I didn't like a few days earlier.

But suddenly today I have gone back to 70 Suggestions which seem quite a reasonable crop on the whole. There is something Tivo only does to the database from time to time to make Suggestions regenerate themselves. Or may be it is a process the Tivo only runs weekly. My Tivo has been connecting and getting the Guide Data every day as normal.

When I only had 10 Suggestions or less left in Tivo's Suggestions I wasn't any Scheduled Suggestions recording themselves

Regarding the Global Blocklist I find it doesn't work at all consistently and that some things still get recorded by Wishlists despite being in the Blocklist. A version that also blocks certain episodes of Season Passes is desperately needed in my opinion.


----------



## glen_a_stewart (Jan 30, 2010)

I realize TivoWebPlus 2.0 is old-school for many here, but I still use it, and just updated the ui_todo.itcl module to automatically mark Wishlist entries for deletion based on hardcoded sets of ratings and genres. 

I use this in combination with the perl WWW:Mechanize method mentioned earlier in the thread, to automatically visit the ToDo web page, and delete the queued shows that don't meet my criteria. It's worked great for a few years now.

If you want to adjust the filters, look for the line: 
### BEGIN new blocking for Bits, Rating, Advisory, and Genre

I view the present settings as being somewhat family-friendly. YMMV. Tweak to suit.


----------

