PK òAŠœ¦ÛþQ þQ tvrenamr-3.3.1/config.html
For ease of use Tv Renamr uses a config file. By default it looks for it in ~/.tvrenamr/config.yml, an example is listed below which shows all the possible default values you can use.
The defaults segment should be self-explanatory but I’ll list them just for completeness. The listed values are the assumed defaults if any of the options are not added.
The output format for files to be renamed to.
format: '%n - %s%e - %t%x'
Note
The extension part includes the period (.) part of the file’s extension and is also optional.
The online database to use for episode names. Options are: thetvdb or tvrage
library: thetvdb
If a show has a leading ‘The’, such as ‘The Big Bang Theory’, move it to the end of the show name, i.e. ‘Big Bang Theory, The’.
the: true
Below the defaults are shows that won’t get renamed correctly using the default options. Taking CSI as the example you have:
csi:
canonical: "CSI: Crime Scene Investigation"
output: "CSI, Crime Scene Investigation"
In the above example csi is used to match the show name in the downloaded file name, which might look something like this csi.s10e01.blah.blah.avi.
The name used by the online database(s) for a show.
Since The TVDb and Tv Rage both list CSI as CSI: Crime Scene Investigation the canonical option is used.
canonical: "CSI: Crime Scene Investigation"
Note
This method is the easiest way to deal with shows with a year in the name too, i.e. Castle (2009).
The show name to use when writing the new filename.
The canonical show name contains a colon which most filesystems won’t play nice with
output: "CSI, Crime Scene Investigation"
The output format to use when writing the new filename.
format: %n - %s%e
Warning
The colon (:) and comma (,) characters are reserved in YAML so must be quoted.
defaults:
format: '%n - %s%e - %t%x'
library: thetvdb
organise: yes
renamed: /Volumes/Media/TV/
the: true
'24':
format: '%n - %s%e'
american dad:
canonical: American Dad!
castle 2009:
canonical: Castle (2009)
csi:
canonical: "CSI: Crime Scene Investigation"
output: "CSI, Crime Scene Investigation"
doctor who 2005:
canonical: Doctor Who (2005)
the it crowd:
the: false
the simpsons:
the: false
v 2009:
canonical: V (2009)
output: V
Install Tv Renamr with your favourite Python package manager:
pip install tvrenamr
Note
You might need to be an administrator to do this.
A nice shiny tvr script is now installed in the relevant directory on your python path.
Note
If you don’t have pip install you’ll get an error message. Instructions on how to install pip can be found here.
Due to a problem with easy_install/pip and Tv Renamr’s option parsing code it isn’t possible to use easy_install or pip for installation just yet, but it might get fixed in the future.
git clone https://github.com/ghickman/tvrenamr.git
cd tvrenamr
python setup.py install
Warning
You may probably need to be an administrator to run the python setup.py install line.
A command line utility to rename TV show files into a cleaner format.
In your favourite terminal run:
$ tvr file
or
$ tvr folder
or
$ tvr .avi
Tv Renamr accepts the following options which take precedent over any options set in the Config.
-c, --canonical | |
Set the show’s canonical name to use when performing the online lookup. | |
--deluge | Checks Deluge to make sure the file has been completed before renaming. |
--deluge-ratio | Checks Deluge for completed and that the file has at least reached X share ratio. |
-d, --dry-run | Dry run your renaming. |
-e, --episode | Set the episode number. Currently this will cause errors when working with more than one file. |
--log-file | Set the log file location. |
-l, --log-level | |
Set the log level. Options: short, minimal, info and debug. | |
--library | Set the library to use for retrieving episode titles. Options: thetvdb & tvrage. |
-n, --name | Set the show’s name. This will be used as the show’s when the renaming is completed. |
-o, --output | Set the output format for the episodes being renamed. |
--organise | Organise renamed files into folders based on their show name and season number. |
--no-organise | Explicitly tell Tv Renamr not to organise renamed files. Used to override the config. |
-q, --quiet | Don’t output logs to the command line. |
-r, --recursive | |
Recursively lookup files in a given directory. | |
--rename-dir | The directory to move renamed files to, if not specified the working directory is used. |
--no-rename-dir | |
Explicitly tell Tv Renamr not to move renamed files. Used to override the config. | |
--regex | The regular expression to use when extracting information from files. |
-s, --season | Set the season number. |
-t, --the | Set the position of ‘The’ in a show’s name to the end of the file. |
$ tvr
$ tvr --recursive /path/to/a/directory/
$ tvr --organise -r '/path/to/a/directory/' /path/to/a/directory/[a_file.avi]
$ tvr --season '1' --name 'chuck' /path/to/a/file/the_file.avi
v3.2.0
By default TV Renamr will match shows in the formats:
However you can specify custom regular expressions if your files aren’t in either of these formats. Some custom regular expression syntax has been used to help you specify different parts of the filename:
It is also possible to specify how many digits there are in the season and episode sections of the filename using the syntax:
where the n in {n} specifies how many digits are in each of the sections.
Note
All spaces are converted to periods before your regular expression is run.
Python regular expression syntax can be found here.
Please report any bugs or feature requests to the issue tracker on Github.
All colons : are converted to commas , in both the show name and the episode title. This stops issues that can arise with network shares and gives a cleaner format on windows where python replaces the colon character with a backslash \.
Shows with a year in the canonical title, i.e. Doctor Who (2005), will fail if this year isn’t specified in the show name inside brackets. You’ll need to set this as the canonical name in the config file.
Unfortunately this is not coped with at all. The first episode is usually picked up so the file will be renamed using this.
The logging level for the log file is always debug, however the amount of information you see in your console can be modified. Use the --log-level option (-l for short) to select one of the output options:
Given the filename chuck.S01E02.avi to rename, the log levels would show the following information:
Renamed: “Chuck - 102 - Chuck Versus the Helicopter.avi”
Renaming: chuck.S01E02.aviDirectory: /Volumes/Media/TV/Chuck/Season 1/Renamed: “Chuck - 102 - Chuck Versus the Helicopter.avi”
Renaming: chuck.S01E02.aviSearching: chuckEpisode: Chuck Versus the HelicopterDirectory: /Volumes/Media/TV/Chuck/Season 1/Renamed: “Chuck - 102 - Chuck Versus the Helicopter.avi”
2010-10-17 20:40 DEBUG Config Config loaded2010-10-17 20:40 DEBUG Config Defaults retrieved2010-10-17 20:40 SHORT Core Dry Run beginning.2010-10-17 20:40 SHORT Core ———————————————————————-2010-10-17 20:40 SHORT Core2010-10-17 20:40 MINIMAL Core Renaming: chuck.S01E02.avi2010-10-17 20:40 DEBUG Core Renaming using: (?P<show>[ws.,_-]+).[Ss]?(?P<season>[d]{1,2})[XxEe]?(?P<episode>[d]{2})2010-10-17 20:40 DEBUG Core Returned show: chuck, season: 01, episode: 02, extension: .avi2010-10-17 20:40 DEBUG Core Imported The Tv Db library2010-10-17 20:40 INFO The Tv DB Searching: chuck2010-10-17 20:40 DEBUG The Tv DB Retrieving series id for chuck2010-10-17 20:40 DEBUG The Tv DB Series url: http://www.thetvdb.com/api/GetSeries.php?seriesname=chuck2010-10-17 20:40 DEBUG The Tv DB XML: Attempting to parse2010-10-17 20:40 DEBUG The Tv DB XML retrieved, searching for series2010-10-17 20:40 DEBUG The Tv DB Series chosen: Chuck2010-10-17 20:40 DEBUG The Tv DB Retrieved show id: 803482010-10-17 20:40 DEBUG The Tv DB Retrieved canonical show name: Chuck2010-10-17 20:40 DEBUG The Tv DB Episode URL: http://www.thetvdb.com/api/C4C424B4E9137AFD/series/80348/default/1/2/en.xml2010-10-17 20:40 DEBUG The Tv DB Attempting to retrieve episode name2010-10-17 20:40 DEBUG The Tv DB XML: Retreived2010-10-17 20:40 DEBUG The Tv DB XML: Attempting to parse2010-10-17 20:40 DEBUG The Tv DB XML: Parsed2010-10-17 20:40 DEBUG The Tv DB XML: Episode document retrived for Chuck - 01022010-10-17 20:40 DEBUG The Tv DB XML: Attempting to finding the episode name2010-10-17 20:40 DEBUG The Tv DB Retrieved episode name: Chuck Versus the Helicopter2010-10-17 20:40 INFO Core Episode: Chuck Versus the Helicopter2010-10-17 20:40 DEBUG Error ‘chuck’ is not in the Config. Falling back on name extracted from the filename2010-10-17 20:40 DEBUG Core Using the formatted show name retrieved by the library: Chuck2010-10-17 20:40 DEBUG Core Final show name: Chuck2010-10-17 20:40 MINIMAL Core Directory: /Volumes/Media/TV/Chuck/Season 1/2010-10-17 20:40 DEBUG Core Full path: /Volumes/Media/TV/Chuck/Season 1/Chuck - 102 - Chuck Versus the Helicopter.avi2010-10-17 20:40 MINIMAL Core Renamed: “Chuck - 102 - Chuck Versus the Helicopter.avi”2010-10-17 20:40 SHORT Core2010-10-17 20:40 SHORT Core ———————————————————————-2010-10-17 20:40 SHORT Core Dry Run complete. No files were harmed in the process.2010-10-17 20:40 SHORT Core
Debug will automatically perform a dry run rename since it was designed to be used for testing. However this is the format you will see in your log file, minus the dry run.
Please activate JavaScript to enable the search functionality.
From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.
It is possible to set a custom output format for your files using the -o command line option and the same syntax used with Custom Regular Expressions: