|As of 'commit 35: 95a2922fcf20', the |
You should delete the
What Is It
tvdb-bulk-update is a command-line script used to set metadata and posters for tv episodes in MythVideo using the excellent database at http://thetvdb.com. The script works against the mythtv database so always make sure it's up to date by using the myth UI to do a scan first.
You will need the following to use this script:
- MythTV v0.21
- Python (tested with 2.5.2)
- MySQLdb for Python: http://sourceforge.net/projects/mysql-python
- tvdb_api package: http://github.com/dbr/tvdb_api/tree/master. If the module is not found the script will offer to download it for you. (requires wget)
- if you want to use the default poster composite command you will also need the ImageMagick composite command
Download the script http://bitbucket.org/davels/tvdb-bulk-update/raw/tip/tvdb_bulk_update.py and set the user options to match your environment. You have two ways to define your options.
- Modify the USER OPTIONS section of the script
- Create a new file containing the options you want to override and specify it on the command line with the
Method 2 is a bit more work but it makes future upgrades much easier. For example if you place the following in the file myconfig.py, you can run the script using:
$ tvdb-bulk-update.py --config=myconfig.py
DRY_RUN = False ROOTS = ["/video/tv/"]
At a bare minimum you need to define the
ROOTS variable to identify the directories where you TV episodes are stored. This is recursive so just specify the top level directories. You should also check the
MYTH_DB variables to make sure the connection information is correct. You will also want to add
DRY_RUN = False once you're sure everything looks good. There are many other options that can be configured for more advanced control.
Using The Script
Simply run the script to start
There are a few command-line options that can be specified as well
--config=FILEread options from FILE and merge them into the options specified in the script
--root=ROOTsearch for files at ROOT instead of using the ROOTS configuration option
--dry-rununconditionally turn on dry run mode (see options)
--debugprint extra debug output
If you don't have the
tvdb_api package it will offer to download it for you and place it in the current directory. This is the best way to ensure you have a compatible version.
The script will look at all files in the database (limited by the ROOTS specified) that don't currently have any metadata assigned. For each file it will attempt to parse out the series, season and episode number from the filename (see NAME_PARSERS in options). If that succeeds you will presented with a list of the best matches for the series name. You can choose the correct series from the list or type a new search term if none of the options are correct. You also have to option to skip the series/episode for this session, or to permanently skip the episode. If you choose to permanently skip the episode a bogus inetref value will saved in the database so it will be ignored in future scans.