Brad Templeton Home

Brad Ideas
(My Blog)




Jokes / RHF

Photo Pages

Panoramic Photos

SF Publishing


Articles & Essays



The Book




RHF Home

Ty Templeton Home

Stig's Inferno

Copyright Myths

Emily Postnews


World Heritage Sites

Burning Man

Phone Booth

Alice Pascal

The Rules for Guys

Bill Gates

Contact Me

The Mythbulksearch Program

The Mythbulksearch Program

Note: Creating a large number of search requests currently causes Mythbackend to pause for a considerable time searching for them all each time you change the scheduled recordings list.

This bug has been mostly fixed, but in the meantime I took a different approach and ended up with a much more powerful program.

This is called TVWish and it is a complete wishlist language with tivo-like suggestions, importable wishes from the web and more.

Hard disk Video Recorders are great. The open source MythTV system allows you to change and improve the system, which is why I made this simple program to configure your box to record great movies whenever they come on.

Many of these systems have a wishlist or search feature, which lets you program in a request for any show that matches a search string, even if it isn't showing in the 2 upcoming weeks you have listing data for. Thus you can enter a search for a movie, like "Tron" and your box will record it whenever it comes on, even months or years in the future.

Your TV schedule is full of good movies, including many you haven't seen. Mythbulksearch lets you do a bulk import of searches into MythTV, in particular, all the movies you think you would like to see. You do this once, and from then on whenever one of those movies is aired, you will see it magically arrive.

To start, you want to build your list of movies in an ordinary text file. You may want to check out:

IDMB also has top databases for various genres, for box office and many other categories. Your favourite film critics probably have similar lists.

Just go to the lists you like, and use your mouse to select, copy and paste the list into your text editor. Mythbulksearch removes any numbers and years and quotes from the movies so you don't have to clean them up much, if at all. You can also copy and paste most tables into a spreadsheet like Gnumeric or Excel, and then select just the data you want and save it out as a text file.

Your goal is a text file, with one movie per line, and if it is easier. numbers before and after the movie name.

Next, go through the list and turn it into your wishlist. In other words, remove the movies you have already seen or know you don't want to see.


You may need to fix up the list a bit. Some of the titles may not be in the form your TV listings will use. And some titles, notably one word titles like "Brazil" or "Alien" present a problem. The MythTV search feature will record anything that contains the string you provide. Which will record "Brazil" but also "The Boys from Brazil". Right now there is no easy way around this. Mythbulksearch will warn you if it sees one of the movies that is a likely trap, but it still enters the movie. You may need to remove it and hand-create it later.

If a movie name starts or ends with a number, Mythbulksearch will strip that number. Use the "-n" option to stop it from stripping numbers. You will need a clean file with no numbers, or put that entry in its own file. (You can run Mythbulksearch again to add new lists.)

Sources like IMDB like to identify movies by the title in the language of the country of origin. That's fair, though they sometimes overdo it, for example listing "The Good, the Bad and the Ugly" -- which was shot in English -- as "Buono, il brutto, il cattivo, Il." I have arranged for Mythbulksearch to translate most of the entries on the IMDB top 250 if you use that as a source. It puts in both the English and non-English forms. You can remove the non-English later if you like.

Do it

Download the perl program here.

Just issue the command:

perl mythbulksearch filename...

With the text file containing your desired movies.

You may wish to run "mythfilldatabase" to update your listings at this point and get them scanned for programs.

No Search

Mythbulksearch does not create "Search" entries for you in Myth. You can't go to the Search entry and work with them. It creates only recording requests, to avoid overloading the search box. Use Mythweb to see and remove these reqeusts. If you want to remove all of them or many of them, use an SQL database editor on the raw Myth database. PhpMyAdmin is a simple free one you can use.

Non-Title requests

You can also enter Keyword and People wishlists. In your text file, preface a line with "Keyword:" or "People:" and it will be treated as that type. A Keyword search matches the string anywhere in a show's title, subtitle or description. A People search lets you provide the names of Actors, Directors etc. and record anything that has their name on it. Frankly I think that overdoes it -- almost nobody in Hollywood is 100% golden -- but it can be fun for a short term infatuation with an actor or director.


Do not strip numbers from the start or end of an entry. Use this if you have stripped any ranking numbers or trailing vote numbers from the entries, and/or you have movies with numbers in their names.
Run a test, don't write to the database
Delete the requested entries from the database

Other Notes

If you keep your "mysql.txt" file other than the standard place /usr/share/mythtv/mysql.txt you will have to edit a line at the start of the program to show where it is. Otherwise the program should run fine on any system that runs mythfrontend or mythbackend. It only talks to the database, not to Myth itself.

If you combine from several lists, you might enter some duplicates. Mythbulksearch will handle this, but you may also wish to use the linux command "sort -u" which will sort your list and remove duplicate lines.

The lists, however, in pure form are very simple and easy to make: Here's an example of a file that would work, including translating one film to "Once upon a time in the west."

Raging Bull
Double Indemnity
The Pianist
Paths of Glory
C'era una volta il West
Cidade de Deus
12 Angry Men