Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Sho
>Sho
Line 29: Line 29:
[http://thetvdb.com/?tab=season&seriesid=80146&seasonid=27486&lid=7 Blackadder's Christmas Carol] should have a filename that matches season 0 episode 1 (e.g. contain s00e01).
[http://thetvdb.com/?tab=season&seriesid=80146&seasonid=27486&lid=7 Blackadder's Christmas Carol] should have a filename that matches season 0 episode 1 (e.g. contain s00e01).


Specials naming order can be observed in the Specials Season at [http://thetvdb.com/ thetvdb.com].
Specials naming order can be observed in the Specials Season of the relevant TV show at [http://thetvdb.com/ thetvdb.com].


=== Custom Directory Structure & File Names ===
=== Custom Directory Structure & File Names ===

Revision as of 10:31, 15 July 2007

Since build 8044, date: 2007-03-08, XBMC has had the ability to lookup and present information on TV Shows in the Video Library. TV show support is through new scrapers and requires a connection to the internet. The information gathered is cached locally so that it is later available when you are offline. In order to get the most out of your video library, you need to scan your TV shows and retrieve the information about them from sites like tv.com and The Online TV Database.

TV show filenaming conventions

Tv.shows.jpg
The TV show lookup relies on the following naming conventions in order to work as intended.

Directory Structure & File Names

The directory structure and filenames for tvshows have to be matched by the regular expressions set in tvshowmatching.

The defaults will match the following structures/filenames:

foo_[s01]_[e01] foo.1x09* foo.s01.e01, foo.s01_e01 foo.103*

Defaults for two-parters will match:

foo_[s01]_[e01-02] foo.s01.e01-02 foo.1x09 1x10

TV Show Specials

Special episodes are currently supported with theTVDB.com scraper. In order for the XBMC scraper regular expressions to recognize them, they should be part of season 0.

Example

Blackadder's Christmas Carol should have a filename that matches season 0 episode 1 (e.g. contain s00e01).

Specials naming order can be observed in the Specials Season of the relevant TV show at thetvdb.com.

Custom Directory Structure & File Names

When enumerating episodes for a series, XBMC only cares about the season and episode, so when designing regexps you should only be concerned with these things.

Here are several common naming schemes and corresponding regexps and examples.

\Season #\## (Season# is at very end of directory name, and filename starts with episode name, neither have to be a specific number of digits) : <xml> <tvshowmatching>

   <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>

</tvshowmatching> </xml> Example : \Battlestar Galactica\Season 3\01 - Occupation.avi (Season 3, Episode 1)


### ([season#][episode#] with nothing in between all in filename, assumes episode number is always 2 digits) : <xml> <tvshowmatching>

   <regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp>

</tvshowmatching> </xml> Example : \24\Season 6\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)
Example 2 : \Lost\Season 1\Lost - 101.avi (Season 1, Episode 1)
Example 3 : \24\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)


##x## ([season#]x[episode#] all in filename : <xml> <tvshowmatching> <regexp>([0-9]+)x([0-9]+)[^\\/]*</regexp> </tvshowmatching> </xml> Example : \Scrubs\Season 1\1x01.Pilot.avi (Season 1, Episode 1)

If you use leading 0's (for example, \Scrubs\01x01 - Pilot.avi instead of 1x1), and are having difficulty getting the TV Show scraper to work, try

##x## ([season#]x[episode#] all in filename : <xml> <tvshowmatching> <regexp>[0]*([0-9]+)x[0]*([0-9]+)[^\\/]*</regexp> </tvshowmatching> </xml> Example : \Scrubs\Season 1\01x01.Pilot.avi (Season 1, Episode 1) which simply strips leading 0's from the result.

s##e## (s[season#]e[episode#] at beginning of filename) <xml> <tvshowmatching> <regexp>[\\/]s([0-9]+)e([0-9])+</regexp> </tvshowmatching> </xml> Example videos\mytv-comedy\Scrubs\season 1\s01e01 - Pilot (hdtv.xvid).avi

Season ## - Episode ## (Season [season#] - Episode [episode#] in the beginning or middle of filename) <xml> <tvshowmatching> <regexp>Season ([0-9]+) - Episode ([0-9]+)[^\\/]*</regexp> </tvshowmatching> </xml> Example TV Shows\Scrubs\Season 1\Scrubs - Season 1 - Episode 01 - Pilot.avi

See Also

http://www.xboxmediacenter.com/forum/showthread.php?t=25349

http://en.wikipedia.org/wiki/Regular_expressions

Regular Expression Testing: http://www.regextester.com/