Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(v21 Updates)
 
(91 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{frodo updated}}{{:Adding videos to the library/Contents}}
{{VideoLibraryCreate}}
{{#lst:Adding videos to the library/Naming files|naming files}}
{{mininav| [[Video library]] |[[HOW-TO:Create_Video_Library|Create Video Library]] }}


The TV Show lookup scraper relies on the following naming conventions in order to work as intended.


== Directory structure and file names ==
= Introduction =
[[File:Library.videos.tvshowsfanart.WSCR.jpg|right|400px]]
There are two components to TV Shows that need to be accurate for a successful scrape:
XBMC needs a TV show folder with just the TV show name and then it needs file names that contain both episode numbers and season numbers (optional, see below). There can be season/year/whatever folders between the TV show folder and the episode files, but XBMC will not use these to figure out what the seasons are. While XBMC and scrapers can sometimes be forgiving of extra data in the file name, it's best to keep it simple and avoid extra text outside of the examples below (such as group names, resolution, etc). Advanced users can tweak the matching patterns that XBMC uses for this with regex and [[advancedsettings.xml#.3Ctvshowmatching.3E|these advancedsettings.xml settings]].
# Correct '''naming''' of the TV Show
# Correct '''numbering''' of the Episodes


;Directory layout example
{{note|This page details the TV Show folder. Season folders and episodes are discussed in the following pages.}}
:{|
|
<pre>
TV Shows
  |----TV Show 1
  |      |----Season #
  |            |--Files
  |----TV Show 2 (year)
  |      |--Files
  |----TV Show 3
  |      |----2008
  |            |--Files
</pre>
|}
[[File:Library.videos.tvshowinfo.WSCR.jpg|right|400px]]
;Default TV show folder naming conventions
*'''(year)''' - can be helpful for some TV Shows such as "Battlestar Galactica", "Doctor Who" and "Knight Rider" which can yield multiple results.
:Name
:Name (year)


===Shows with seasons===
;Default episode file naming conventions
*'''name''' - can be the TV show name, episode name, something else, or you can exclude the name and only have the season and episode numbers. You can also place the name after the season and episode numbers.
*'''ext''' - The file extension, such as .mkv, .avi, .iso, etc.
*'''Spaces''' and underscores are interchangeable in the examples below.
*'''Periods''' can be used to break up text, but '''they cannot be used''' in between '''episode-number''' and '''episode-names''' that start with a '''number'''. For e.g. name.s01e01.1.0.ext (episode name is one poin zero} so must become name.s01e01_1.0.ext
:''name''.s01e01.''ext''
:''name''.s01.e01.''ext''
:''name''.s01_e01.''ext''
:''name'' [s01] [e01].''ext''
:''name''.1x01.''ext''
:''name''.101.''ext''


;Defaults for two-part TV Show Episode will match:
:''name''.s01e01-02.''ext''
:''name''_[s01]_[e01-02]_.''ext''
:''name''.1x01.1x02.''ext''


;Same with three- or four-part TV Show Episode:
= Naming =
:''name''.s01e01-02-03-04.''ext''
The naming of your TV Show folder is '''critical''' to ensure the scrapers can correctly identify the TV Show and its episodes.
:''name''_[s01]_[e01-02-03-04]_.''ext''
:''name''.1x01.1x02.1x03.1x04.''ext''


;No name
'''''TV Show name (Year)''''' - This is the correct naming format for both the movie files and movie folders.
To emphasize, you can also use any of the above examples with just the season/episode numbers:
:101.''ext''
:s01e01.''ext''
:01x01.''ext''
:etc


===Shows without seasons or only one season===
'''Note:''' If you are unsure of the name or year check it at the scraper site - either '''[https://www.themoviedb.org/ TheMovieDB website]''' or '''[https://thetvdb.com/ TheTVDB website]''' depending on which scraper you have set.
Single or no season shows, such as anime or many types of one-off series (including miniseries) will not have a season number. To scan in shows like this we use scrapers that support "absolute ordering", such as the [[TheTVDB.com (Video Library)|TVDB.com]] scraper. '''To use this you must change the [[Video_library/Setting_content_and_scanning#TV_show_content_options|scraper settings]] to use the absolute ordering option.''' This setting can be set on individual TV show folders, so that your default settings for all TV shows can support TV show seasons, or vice versa. See [[#DVD order]] for an example of how that would be set up. Absolute ordering can also simply be the default setting for an entire source if all TV shows within that source only have one/no season.


Naming conventions for absolute order follow similar conventions to normal episodes, but require "ep" rather than just "e" for the episode, and (obviously) do not have a season number.


;Default episode file naming conventions
== Filename identifiers ==
:''name'' ep01.''ext''
{{#lst:Naming_video_files/Movies|FilenameID}}
:''name''.ep01.''ext''
:''name'' ep 01.''ext''


{{-}}


==DVD order==
In TV Shows with series like '''Firefly''' you can set for instance the main TV Shows and set content to [[TheTVDB.com (Video Library)|TVDB]] with regular scraper settings, say '''No''' to scrapping content at this time, then navigate your way to the Firefly folder and set sub-content setting TVDB and changing scraper settings to.
# Folder contains a single TV show
# Either to absolute ordering single season or DVD order
# Scan everything by saying yes when you get prompted by XBMC at this time.


'''e.g.''' This will set main source with normal content and sub-folder with specific settings.
= TV Show Folders =
<pre>
{|
TV Shows                  <<TVDB normal Settings all seasons>>
! scope="row" colspan="10"  style="width:300px; text-align:left;"|
  |----TV Show 1
! scope="row" ! |  
  |       |----Season 0
|-
  |           |--Files
| [[File:Video-TVShow Folder.png|left|400px|Image 1- TV Show folders]] ||
  |----TV Show 2
'''{{resize|1.3em|{{red|Each TV Show requires its own folder in the Source folder}} }}'''
  |       |----Season #
  |           |--Files
  |----Firefly            <<TVDB Settings altered for single season and DVD order or absolute ordering>>
  |      |----Files
</pre>


== Multi-part episodes ==
Handling of multi-part episodes (two part episodes in one file, multiple episodes in DVD images, etc.) is supported. The first matched tvshowmatching regexp and "[-EeXx]+([0-9]+)" will be repeatedly applied against a file name until no more seasons or episodes are found.
;This allows for file names such as:
:showname_s01e01e02e03_s02e01e02
:showname.104-05-06-201-02
:showname.1x07x08x09


To break the file up in episodes that XBMC can work with you will have to create an nfo file with <epbookmark> tags.
* The TV Show folders are saved inside the '''''[[Source_folder|Source folder]]'''''
More information can be found on the [[Import - Export Library#TV Episodes|Import - Export Library]] page.
* Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
* When using TVDB scraper for '''Country of Origin''' TV Shows, the (Year) is replaced with the country code. eg ''Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU)'' etc. Check TheTVDB site to confrim.
* '''The title and (year) displayed at the scraper site is how you should name your show.'''


Note that when using a custom RegExp to match a custom file naming convention, add (.*) to the end of the RegExp so that the 3rd RegExp capture is found for the second episode.


<!--== Multi-file episodes ==
'''Note:''' If you are unsure of the name or year, then check which scraper you are using and visit the appropriate site for correct naming:
'''This feature has been temporarily disabled, the plan is to implement it in a better fashion at a future date.'''<br />
You can stack multiple files into one episode.
For that to be available the [[Videos Settings#Library|Stack Duplicate TV Shows]] Video Library setting needs to be enabled.
All the files must have the same season and episode number and they all have to be in the same folder. (This is to prevent unwanted stacking of true duplicates in different folders). The items will be automatically stacked in sequential order based off the filenames being sorted in a "natural" order (like this: -part1.avi, -part2.avi, ..., -part10.avi.)-->


== TV Show specials ==
* '''''[https://www.themoviedb.org/ TheMovieDB]''''' - ''(the default scraper)''
Special episodes are currently supported with [[TheTVDB.com (Video Library)|TheTVDB.com]] scraper. In order for the XBMC scraper regular expressions to recognize them, they should be part of season 0. (Specials naming order can be observed in the Specials Season of the relevant TV show at [http://TheTVDB.com TheTVDB.com]).
* '''''[https://www.thetvdb.com/ TVDB]'''''
;Example
* '''''[https://www.tvmaze.com/ TV Maze]'''''
:[http://thetvdb.com/?tab=season&seriesid=76736&seasonid=24194&lid=7 Black Adder's Christmas Carol] should have a file name that matches season 0 episode 3 (e.g. contain s00e03).
|-
 
! scope="row" colspan="10"  style="width:300px; text-align:left;"|
<pre>
|}
TV Shows
  |----BlackAdder
  |      |----Season 0
  |            |--filename.s00e01.tittle.*
  |            |--BlackAdder.s00e03.Blackadder's Christmas Carol.*
  |            |--etc...
</pre>
 
== Tweaking matches ==
''You can also use [[Add-on:XWMM]] to edit library entires from a web browser.''
 
=== The scraper picks the wrong TV Show ===
You can influence the search by having [[Import - Export Library#Video nfo Files|nfo]] files alongside your media
 
You can also try appending the year to the TV Show folder-name. (Note the showname on the selected site to be scraped must then include the year).
This might be needed for some TV Shows such as "Battlestar Galactica", "Doctor Who", "Jericho", and "Knight Rider" which will have multiple entries on a given TV metadata database because of remakes of the original show.
 
See the examples below:
<pre>
\TV Shows\Battlestar Galactica\Season 1\Battlestar Galactica - S01E01.avi (TheTVDB omits the year from the original shows)
\TV Shows\Battlestar Galactica 2003\Season 1\Battlestar Galactica - S01E01.avi (Remakes will include year at theTVDB.com)
\TV Shows\Cupid 1998\Season 1\Cupid - S01E01.avi
\TV Shows\Cupid 2003\Season 1\Cupid - S01E01.avi
\TV Shows\Cupid 2009\Season 1\Cupid - S01E01.avi
\TV Shows\Doctor Who\Season 1\Doctor Who - S01E01.avi
\TV Shows\Doctor Who 2005\Season 1\Doctor Who - S01E01.avi
\TV Shows\Jericho 1995\Season 1\Jericho - S01E01.avi
\TV Shows\Jericho 2006\Season 1\Jericho - S01E01.avi
\TV Shows\Knight Rider 1982\Season 1\Knight Rider - S01E01.avi
\TV Shows\Knight Rider 2008\Season 1\Knight Rider - S01E01.avi
</pre>
Note! "AVI" is just an example, as this applies to all video formats that XBMC supports.
 
Another good example is Merlin (which gets picked up as Mr Merlin series from 70's)and Merlin 2008 (which gets picked up as the current Merlin Series.
A directory structure should look something like.
 
<pre>
TV Shows
  |----Merlin 2008
  |      |----Season #
  |            |--Files
</pre>
 
[[File:Therenamer.JPG|right|thumb|500px|Settings can be changed to use '''s01e01''' or '''1x01''' or '''101''' capitalizing the S or E depending on how you like it.]]
To further simplify scraping you can cleanup the files before adding them to XBMC with [[Supplemental tools]]
An example of the settings for a popular tool [[Therenamer]] which should conform with the above naming conventions.
 
{{-}}
 
=== Custom directory structure and file names ===
You can make your own naming conventions / rules by adding or editing regular expressions in the [[advancedsettings.xml]] file, with the [[advancedsettings.xml#.3Ctvshowmatching.3E|tvshowmatching]] tag. 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) :
<source lang="xml">
<tvshowmatching>
    <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</source>
'''Example''' : \Battlestar Galactica\Season 3\01 - Occupation.avi (Season 3, Episode 1)


== Split folders ==
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.


'''###''' ([season#][episode#] with nothing in between all in filename, assumes episode number is always 2 digits) :
This may occur when a long running show is progressively saved on one drive but, over time, the drive has been filled with other content, forcing you to save new episodes on another drive.
<source lang="xml">
<tvshowmatching>
    <regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp>
</tvshowmatching>
</source>
'''Example''' : \24\Season 6\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)<br />
'''Example 2''' : \Lost\Season 1\Lost - 101.avi (Season 1, Episode 1)<br />
'''Example 3''' : \24\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)


To ensure these split TV Shows are correctly scraped as the same show, you '''must''' ensure that the TV Show folder names are identical. A slight variance could see a different show scraped for the second folder. If using NFO Files, then copy the NFO file from one location into the other split folders.


'''##x##''' ([season#]x[episode#] all in filename :
<source lang="xml">
<tvshowmatching>
  <regexp>([0-9]+)x([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</source>
'''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 :
<source lang="xml">
<tvshowmatching>
  <regexp>[0]*([0-9]+)x[0]*([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</source>
'''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)
<center>
<source lang="xml">
{| style="border: 1px solid black;"
<tvshowmatching>
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Mergefrom.gif|60px|link=Naming_video_files/Movies]]
  <regexp>[\\/]s([0-9]+)e([0-9]+)</regexp>
| style="width:200px; text-align:center;" | '''Previous step'''  
</tvshowmatching>
| style="width:200px; text-align:center;" | '''Next step'''
</source>
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Merge-arrow.gif|60px|link=Naming_video_files/Seasons]]
'''Example''' : videos\mytv-comedy\Scrubs\season 1\s01e01 - Pilot (hdtv.xvid).avi
|-
| style="width:200px; text-align:center;" | '''[[Naming_video_files/Movies|Movie Setup]]'''
| style="width:200px; text-align:center;" | '''[[Naming_video_files/Seasons|Seasons Setup]]'''
|}</center>


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


'''TV Shows in DVD Folders'''
Using the same directory structures as above, you can name DVD folders by adding the following xml to advancedsettings.xml. This information was gleaned from [[forum:55497|this forum thread]].
<source lang="xml">
<tvshowmatching append="no">
    <regexp>\[[Ss]([0-9]+)\]_\[[Ee]([0-9]+)\]?([^\\/]*)(?:(?:[\\/]video_ts)[\\/]video_ts.ifo)?</regexp>
    <regexp>[\._ \[\-\\/]([0-9]+)x([0-9]+)([^\\/]*)(?:(?:[\\/]video_ts)[\\/]video_ts.ifo)?</regexp>
    <regexp>[Ss]([0-9]+)[\.\-]?[Ee]([0-9]+)([^\\/]*)(?:(?:[\\/]video_ts)[\\/]video_ts.ifo)?</regexp>
    <regexp>[\._ \-\\/]([0-9]+)([0-9][0-9])([\._ \-][^\\/]*)(?:(?:[\\/]video_ts)[\\/]video_ts.ifo)?</regexp>
  </tvshowmatching>
</source>
===Understanding Season Ordering Options===
Please see the thetvdb [[Add-on:The_TVDB#Understanding_Season_Ordering_on_theTVDB.com|scraper settings page]] for information on how to set season ordering correctly ''for each folder'' to match your naming.<br />


{{top}}
{{updated|21}}


[[Category:Video]]
[[Category:Guides]]
[[Category:XBMC Manual]]
[[Category:Karellen]]
[[Category:Video library]]
[[Category:First time user]]

Latest revision as of 02:06, 22 April 2024

Create Video Libraries
1. The Basics
2. Source Folder
3. Movie Setup
4a. TV Show Setup
4b. Seasons Setup
4c. Episodes Setup
5. Music Videos Setup
6. Add Source & Scrape
7. Scraping Problems
Home icon grey.png   ▶ Video library ▶ Create Video Library ▶ TV shows


Introduction

There are two components to TV Shows that need to be accurate for a successful scrape:

  1. Correct naming of the TV Show
  2. Correct numbering of the Episodes

Note: This page details the TV Show folder. Season folders and episodes are discussed in the following pages.


Naming

The naming of your TV Show folder is critical to ensure the scrapers can correctly identify the TV Show and its episodes.

TV Show name (Year) - This is the correct naming format for both the movie files and movie folders.

Note: If you are unsure of the name or year check it at the scraper site - either TheMovieDB website or TheTVDB website depending on which scraper you have set.


Filename identifiers

Scrapers can optionally lookup via filename identifiers since Matrix (v21) if the scraper supports it. As of v21, TheMovieDB Python, TMDB TV Shows, and TV Maze scrapers support ID's in the folder or filename.

Filename identifiers are short tags added to the name of a file that directly provide metadata IDs to Kodi. This method streamlines the scraping process by giving Kodi explicit references to look for in its database. If an identifier could not be looked up using a filename identifier, Kodi falls back to the normal scraping process using title and year.

To take advantage of this feature, include the identifier within the filename and/or the folder (depending on the setting Movies are in separate folders that match the movie title in the Set Content screen) using one of the following supported formats:

  • Movie Name (Year) [sourceid=xxxx]
  • Movie Name (Year) [sourceid-xxxx]
  • Movie Name (Year) [source=xxxx]
  • Movie Name (Year) [source-xxxx]
  • Movie Name (Year) {sourceid=xxxx}
  • Movie Name (Year) {sourceid-xxxx}
  • Movie Name (Year) {source=xxxx}
  • Movie Name (Year) {source-xxxx}

Where:

sourceid / source - the appropriate site identifier of the ID (see Note below)
xxxx - the ID from the site

An example of a properly formatted filename would be:

/Blade Runner (2017) {tmdb=335984}/Blade Runner (2017) {tmdb=335984}.mkv


Note: Not all scraper sites accept all ID's. It is recommended that the sites own ID is used rather than a 3rd party site (eg imdb). 3rd party ID's at scraper sites rely on users to enter that data. It is not uncommon to have these ID's missing.

TheMovieDB for Movies and TV Shows - Use TMDB's own tmdb ID but the scapers will also accepted imdb and tvdb if that data is available at the site.
TV Maze - only acceptes tvmaze ID's
TVDB - As at the release of v21 Omega, the scraper requires updating by TheTVDB


TV Show Folders

Image 1- TV Show folders

Each TV Show requires its own folder in the Source folder


  • The TV Show folders are saved inside the Source folder
  • Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
  • When using TVDB scraper for Country of Origin TV Shows, the (Year) is replaced with the country code. eg Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU) etc. Check TheTVDB site to confrim.
  • The title and (year) displayed at the scraper site is how you should name your show.


Note: If you are unsure of the name or year, then check which scraper you are using and visit the appropriate site for correct naming:


Split folders

Split folders are TV Shows that have episodes split between two or more folders located in different Sources.

This may occur when a long running show is progressively saved on one drive but, over time, the drive has been filled with other content, forcing you to save new episodes on another drive.

To ensure these split TV Shows are correctly scraped as the same show, you must ensure that the TV Show folder names are identical. A slight variance could see a different show scraped for the second folder. If using NFO Files, then copy the NFO file from one location into the other split folders.



Mergefrom.gif Previous step Next step Merge-arrow.gif
Movie Setup Seasons Setup


Return to top