FillMythMetadata.pl

From MythTV Official Wiki
Revision as of 17:33, 18 April 2009 by Menny (talk | contribs) (Welcome new page - fill_mythvideo_metadata)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

fill_mythvideo_metadata.pl is perl script written by Menny Even Danan that goes over all the files under MythVideo folder and look them up in the Internet and fill the MythVideo database with the data.

This is done by parsing the filename, and determine whether it is a tv-show or a movie (not a tv-show), and retrieve information about the parsed item from thetvdb.com or imdb.com, locate subtitles for the video file, and generate a cover for the video file (either from within the video file, or from a web-site).

Basic Usage

Usually, the best option to run fill_mythvideo_metadata.pl is without any arguments. The script can automatically detect the sql password, and the machine's hostname, it can determine the video files folder, and which file extensions are valid, and where to store the artwork. If you would like to change the default behavior of the script, read about the command-line arguments below. It is suggested to use this script in a crontab job: 00 06 * * * /home/mythtv/fill_mythvideo_metadata.pl

  • replace /home/mythtv/ with the path to the location of the script.

Perl prerequisites

There are not prerequisites for this script. It works with the default perl modules.

Help Output

./fill_mythvideo_metadata.pl usage:

options:

-N [1/0]

                       Perform "full" (0)/"new files only" (1) scan (overriding the default specified)
                       default: 1

-D [path]

                       Scan specific directory, recursive (overriding the automatic media folder detection).
                       default: taken from the database.

-F [full path to file]

                       Work on a specific file.

-S [1/0]

                       Perform subtitles download
                       default: 0

-DBP [whatever]

                       Specify DB password
                       default: taken from mysql.txt file.

-MOVIE_SNAP [1/0]

                       For movies - generate snapshot from file (1), or take it from imdb.com (0)
                       default: 0

-TV_SNAP [1/0]

                       For TV shows - generate snapshot from file (1), or take it from imdb.com (0)
                       default: 1

-SNAPSHOT_WIDTH [number]

                       Change the default snapshot width (height is calcualted by the aspect ratio)
                       default: 320

-THUMB_OFFSET [seconds]

                       Take the video snaphost image from the specified time.
                       default: -1 which means take a random point in the video file.

-TV_TITLE_TYPE [0/1/2]

                       0-[Filename]
                       1(default)-[Episode number]: [Episode name]
                       2-[Show] S[Season number]E[Episode number] [Episode name]
                       3-[Show] [Season number]x[Episode number] [Episode name]

-MOVIE_TITLE_TYPE [0/1/2]

                       0-[Filename]
                       1(default)-[Movie name from IMDB]

-ARTFOLDER [full path to folder]

                       Override Art-Work folder.
                       default: taken from the database.

-HOST [hostname]

                       Override the automatic hostname resolving.

-TVIP [HOST/IP]

                       Change the IP of THE-TV-DB (this should be used rarely!)

User Contributed Tips