TV_IMDB(1p)
π TV_IMDB π
okay bestie, so this is a User Contributed Perl Documentation page for tv_imdb, and it's about to become your whole personality, no cap. it's a Perl script that goes and gets imdb.com data and sprinkles it into your XMLTV listings files. we're gonna get into it. π
β¨ NAME β¨
tv_imdb β augment XMLTV listings files with imdb.com data. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
tv_imdb --imdbdir <dir> [--help] [--quiet] [--download]
[--movies-only] [--filesort] [--nosystemsort]
[--prepStage (1-9,all)]
tv_imdb --imdbdir <dir> [--help] [--quiet]
[--with-keywords] [--with-plot]
[--movies-only] [--actors NUMBER]
[--stats] [--debug]
[--output FILE] [FILE...]
tv_imdb --imdbdir <dir>
--validate-title 'movie title'
--validate-year 2004
[--with-keywords] [--with-plot]
[--debug]
three whole moods, pick your fighter. π«Ά
π¦ DESCRIPTION π¦
tv_imdb is literally the twin sister of tv_cat when it comes to semantics (go read tv_cat), except β and this is the iconic part β whenever a programme shows up with a "date" entry, the title and date get used to look up extra data via XMLTV::IMDB. it's giving glow-up. β¨
--output FILEβ write to FILE instead of standard output. slay.--with-keywordsβ include IMDb keywords in the output file.--with-plotβ include IMDb plot summary in the output file.--actors NUMBERβ number of actors from IMDb to add (default=3).--quietβ disable all status messages (the ones that normally appear onstderr). shhh. π€«--downloadβ try to download data files if they are missing (in--prepStage).--statsβ output grab stats (stats output disabled in--quietmode).--debugβ output info from movie matching.--movies-onlyβ only augment programs that look like movie listings (4 digit'date'field).
every single program gets checked against imdb.com data (unless --movies-only is used, then it's a much more exclusive guest list).
so for the purposes of tv_imdb, an "exact" match is defined as a case insensitive match against imdb.com data (which may or may not include the transformation of '&' to 'and' and vice-versa). the chaos is canon. π
if the program includes a 4 digit 'date' field, these matches get attempted, and the first successful match wins, periodt:
- an
"exact"title/year match against movie titles is done - an
"exact"title match against tv series (and tv mini series) - an
"exact"title match against movie titles with production dates within 2 years of the'date'value
unless --movies-only is used, if the program does not include a 4 digit 'date' field, these matches are attempted, and the first succeeding match is used:
- an
"exact"title match against tv series (and tv mini series)
when a match is found in the imdb.com data, here's the whole makeover that gets applied:
- the
'title'field is set to match exactly the title from the imdb.com data. this includes modification of the case to match and any transformations mentioned above. - if the match is a movie, the
'date'field is set to imdb.com 4 digit year of production. - the type of match found (Movie, TV Movie, Video Movie, TV Series, or TV Mini Series) is placed in the
'categories'field. - the url to the
www.imdb.compage is added - the director is added if the match was a movie or if only one director is listed in the imdb.com data (because some tv series have > 30 directors β imagine π)
- the top 3 billing actors are added (use
-actors [num]to adjust). - genres added to
'categories'field (current list of genres are Short, Drama, Comedy, Documentary, Animation, Adult, Action, Family, Romance, Crime, Thriller, Musical, Adventure, Western, Horror, Sci-Fi, Fantasy, Mystery, War, Film-Noir, Music - imdb user ratings added to
'star-ratings'field. - imdb keywords added to
'keyword'fields (if--with-keywordsused). - imdb plot summary is added (if
--with-plotused).
π§ HOWTO π§
so like, in order to actually use tv_imdb, you need:
- choose a directory location to use for the
tv_imdbdatabase (you'll need about 1 GB of free space β she's hungry π)
2a. run 'tv_imdb --imdbdir <dir> --prepStage all --download' to download the list files from imdb.com. or,
2b. if you have a slow network connection you may prefer to omit the '--download' flag and be prompted for what you need to download by hand. see <http://www.imdb.com/interfaces> for the download sites. then once you have the files, rerun without '--download'.
note:'--prepStage'requires up to 520MB of memory. this can be reduced a little by running each prepStage separately, using--prepStagewith each of the stages individually (see--helpfor details). memory use can be reduced further by using--filesortoption when building the database. this will try to use the operating system to sort the interim data files rather than sorting in memory. if this system sort does not work for you then you can use theFile::Sortpackage if it is installed on your system, by also adding the option--nosystemsort(however this method of sorting is very slow π). if you specify neither option then Perl will sort the files in memory.
if you are only interested in movies, you can reduce the memory required and the size of the database by passing the --movies-only option to the database build, which will exclude tv-series from the database.
- once you have the database loaded, try
'cat tv.xml | tv_imdb --imdbdir <dir> > tv1.xml'.
feel free to report any problems with these steps at https://github.com/XMLTV/xmltv/issues. we're all friends here π«Ά
β TESTING β
the --validate-title and --validate-year flags can be used to validate the information in the tv_imdb database. for exmple:
tv_imdb --imdbdir . --validate-title 'Army of Darkness' --validate-year 1994
(yes, "exmple" β we keep the typo, it's part of the lore π)
π BUGS π
could use a --configure step just like the grabbers so you do not have to specify the --imdbdir on the command line every time. also this could step you through the prep stages with more description of what is being done and what is required. Configure could also control the number of actors to add (since some movies have an awful lot), currently we are adding the top 3.
how and what to look up needs to be option driven.
needs some more controls for fine tuning "close" matches. for instance, currently it looks like the North America grabber only has date entries for movies, but the imdb.com data contains made for video movies as well as as real movies, so it's possible to get the wrong data to be inserted. in this case we may want to say "ignore tv series" and "ignore tv mini series". along with this, we'd want to define what a "close" match is. for instance does a movie by the same title with a date out by 1 year or 2 years considered a match (currently we're using 2).
nice to haves include: verification/addition of programme MPAA/VCHIP ratings, addition of imdb.com user ratings (by votes) to programmes. potentially we could expand to include "country of origin", "description", "writer" and "producer" credits, maybe even "commentator".
heh, if the XMLTV.dtd supported it, we could even include urls to head shots of the actors :)
π SEE ALSO π
xmltv(5)
π AUTHOR π
Jerry Veldhuis, jerry@matilda.com
and that's the whole thing bestie, we ate and left absolutely no crumbs β¨ this was TV_IMDB(1p), from perl v5.40.1, dated 2025-04-19 β go forth and augment those listings, main character π
π¦π
π¦ where this page comes from
- debian trixie: xmltv-util 1.4.0-1 Β· GPL-2.0-only
- ubuntu resolute: xmltv-util 1.4.0-1 Β· GPL-2.0-only
- ubuntu stonking: xmltv-util 1.4.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms