Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (syntaxhighligher fix)
(Updated for v18)
Line 1: Line 1:
{{VideoLibraryCreate}}
{{VideoLibraryCreate}}
{{mininav|[[Video library]]||[[Naming video files]]}}
{{mininav|[[Video library]]|[[Naming video files]]}}




= Introduction =
= Introduction =
<section begin="intro" />Setting up TV Shows correctly is a little bit more involved than the Movies section, but not more difficult. This page will describe the '''{{Kodi}} recommended method''' to name TV Shows and Episode files and to create the folder structure to save them in. These methods are proven to be the simplest, most accurate and robust methods which provide the most accurate scrape.<section end="intro" />
<section begin="intro" />Setting up TV Shows correctly is a little bit more involved than the Movies section. The first part of this page will describe the '''{{Kodi}} best practice''' to name TV Shows and Episode files and to create the folder structure to save them in. These methods are proven to be the simplest and most robust method which provides the most accurate scrape.<section end="intro" />


Any allowable variances to the recommended method will be mentioned (but not displayed in the images) throughout the page.




= TV Show Folder =
[[File:Video-TVShow Folder.png|500px|right]]
'''{{red|Each TV Show requires its own folder. The TV Show folder name is used to match the show at the scraper site.}}'''.
{{Kodi}} '''does not''' support the flat folder structure for TV Shows where all episodes from different TV Shows are in the same folder.
*The TV Show folders are located inside the '''''[[Naming_video_files#Source_Folder|Source folder]]'''''.
*The folder name will be '''''[[Userdata/advancedsettings.xml#.3Ccleanstrings.3E|cleaned]]''''' of commonly used strings, such as ''DVDRip, 1080p, x264,'' etc. before being passed to the scraper.  If the year of release is included, this will be '''''[[advancedsettings.xml#.3Ccleandatetime.3E|extracted]]''''' and used by the scraper to assist in making a match.
*Spaces, periods, or underscores may be used to separate words in the folder and file names, but should not be mixed. Note also the issue with Split-episodes regarding file names with periods.
Naming TV Shows follows the same guidelines as for Movies.
*Name the TV Show folder the same way as shown on the TV Show page at the scraper site.
*It is always best practice to include the year along with the title. This makes scraping more accurate and differentiates between original and remake versions.
*This guideline also applies to '''Country of Origin''' TV Shows. For example Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU), Hells Kitchen (IT) etc.
*'''The title and (year) displayed at the scraper site is how you should name your show.'''
The '''best practice''' method is detailed in the image to the right. (season folders are optional)
*''Angel (1999)''- TV Show folder containing Single File episodes
*''Battlestar Galactica (1978)''- TV Show folder containing DVD folders for episodes
*''Battlestar Galactica (2004)''- TV Show folder containing Bluray folders fore episodes
== 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.
= Season Folder =
Season folders are optional. They are useful to reduce clutter in the main TV Show folder.


= TheTVDB =
Even though {{kodi}} can accommodate the Season folder, it will ignore them. Instead it looks for the correctly numbered episode files.
The default scraper used by {{kodi}} for TV Shows is the TheTVDB (TVDB). Other scrapers are available and can be found by searching the {{kodi}} site '''''[https://kodi.tv/addons/browse?keyword=&category=1187&author=&sort=title+ASC here]'''''
:'''''See: [https://www.thetvdb.com/ TheTVDB]
:'''''See: [[Add-on:The_TVDB|TheTVDB Add-on]]


As a side note, once your TV Shows have been scanned into the Library, it is possible to rename the Season folder displayed by {{kodi}}. '''''See: [[Season_rename|Season Rename]]'''''


The TVDB scraper has three possible settings for determining episode order: '''Aired order, DVD order''', and '''Absolute order'''. These will affect how you name and number your files.


When scraping be aware that season numbers may not be basic numbers. Many shows use the '''Year''' as the season number. This is quite common with older shows, daytime soaps and talk shows. '''Always check the site'''
<gallery mode="packed-overlay" widths="500px" heights="283px">
File:TVDB04.JPG|Image 1- Standard Season Numbers
File:TVDB03.JPG|Image 2- '''Year''' as Season Number
</gallery>


== Episode Orders ==
;Aired Order
*TVDB lists all TV shows in the original '''Aired Order'''. The first time a show is ever broadcast, that is the listing shown. The site is not concerned with how it was broadcast the 2nd, 3rd or 15th time, or how it was broadcast in other countries, or during syndication. It only lists the order of the FIRST TIME ever broadcast, whether that be on Free To Air or Subscription Television.
*Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.




;DVD Order
= Episode Files =
*Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.  
'''Check the site of the information provider to confirm your files are in the same order and that the episodes exist at the scraper site. If not, images and metadata will not match your episode files or your scrape will fail if the episodes do not exist.'''
*In many cases, DVD's are released with a different episode listing, normally being the original order envisioned by the Director. To accommodate this, the site also has a '''DVD Order''' listing.
 
*There are many TV Shows on the TVDB site that do not have the DVD Order data entered. If this is the case, it is a simple matter to create an account and complete the listing. The scraper will default back to Aired Order if there is no DVD Order information listed.
*The episode files (or folders if using DVD or Bluray folders) are located inside the TV Show folder or inside Season folders if using them.
*Note: As the data at TVDB is created by the open community, it is not uncommon for errors to occur with DVD Order details. As it is seen as secondary information, the errors can go unnoticed. One major error that affects the scrapers is incomplete DVD Order details. For example, some episodes have no DVD Order data, while other episodes in the same season do have the data.
*The file name (or folder name) will be '''''[[Userdata/advancedsettings.xml#.3Ccleanstrings.3E|cleaned]]''''' of commonly used strings, such as ''DVDRip, 1080p, x264,'' etc. before being passed to the scraper.
*Early May 2018, TVDB upgraded their website to v2.0. Unfortunately a glitch has prevented the display of DVD Order and Absolute Order information. It is unknown when it will be rectified.
*Spaces, periods, or underscores may be used to separate words in the folder and file names, but should not be mixed. Note also the issue with Split-episodes regarding file names with periods.
 
All episode files must be named and numbered correctly for the scanner to match the correct episode to the ''<episodeguide>'' URL of the TV Show downloaded from the scraper site. You cannot nominate season and episode numbering through NFO Files.  
 
The following is the simplest and most accurate way to name your episode files:
 
:{| class="prettytable"
|-
! scope="row" colspan="2"  style="width:300px; background-color:#a1f5e4; text-align:center;"| Angel (1999) S01E01.mkv<br>
|-
|Where:
|'''''Angel (1999)''''' = TV Show name
|-
|
|'''''S01E01''''' = Season 1, Episode 1
|}
 
 
For information on alternate or advanced episode naming conventions, see the ''Advanced Setup'' section further down this page.
 
For information on '''''alternate episode orders''''', see the ''Episode Groups'' section further down this page.
 
 
 
== Specials Episodes ==
'''All Special Episodes use Season 00'''
:{| class="prettytable"
|-
! scope="row" ! style="width:300px; background-color:#a1f5e4; text-align:left;"| Doctor Who (2005) S00E50
|}
 
They are listed at TheMovieDB in the Specials section of the Season listing.  
 
Special Episdes are episodes that do not fit into the normal storyline of the TV Show. They may include items such as Christmas Specials, Season recap episodes, Made for TV Movies that extend the storyline, Unaired Pilots etc
 
Special Episodes can be displayed in amongst the regular episodes through the use of '''[[NFO_files/TV_shows|NFO Files]]'''. this is specified using the '''<displayepisode></displayepisode>''' and '''<displayseason></displayseason>''' tags.
 




;Absolute Order
= Episode Groups =
*A third Order option exists. The '''Absolute Order'''. This order ignores Seasons and gives each episode an incremental number starting at 1. This order is used for Anime type shows.
Episode Groups or Orders are listings with alternate episode orders. Some TV Shows are broadcast in one order but the DVD/Bluray release may have a different screening order. A well known example is the TV Show ''Firefly'' where the Studio opted to broadcast high action episodes for ratings first, while the Producer wanted a different order to correctly unfold the storyline.




== Correct Naming ==
== TheMovieDB-TV Shows ==
<section begin="TVDB" />To ensure you are using the correct TV Show title follow this simple guideline.
TheMovieDB uses Episode Groups for additional episode orders.
*Numerous Groups can be added which should cater to the different releases between countries
*Creating Groups and adding episodes is quite simplistic, using drag and drop which should encourage contributors to complete the entries
*Where available, the listings are easily accessible for viewing as shown in the images below


*The use of the '''(Year)''' in the title works differently for TV Shows. In TV Shows, the '''(Year)''' is only used when it is shown in the title at the scraper site. See the two images below.
<gallery mode="traditional" widths="500px" heights="283px">
*This guideline also applies to '''(Country of Origin)''' TV Shows. For example Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU), Hells Kitchen (IT) etc.
File:EpisodeGroups01.jpg|Image 1- Accessing Episode Groups
*'''What you see at TVDB is how you should name your show.'''
File:EpisodeGroups02.jpg|Image 2- Available Episode Groups
<gallery widths=500px heights=250px>
File:EpisodeGroups03.jpg|Image 3- Select a Group, then copy the address for use in a Parsing NFO file.
File:TVDB1.JPG|Image 1- No (Year) is displayed. Enter the TV Show name as shown without the year
File:TVDB2.JPG|Image 2- (Year) is displayed. Enter the TV Show name with the year.
</gallery>
</gallery>
<section end="TVDB" />
 
To use one of the orders for scraping, follow the images above and place the address in a '''''[[NFO_files#Parsing_nfo|Parsing NFO file]]''''' then scrape. The Parsing NFO File will point the scraper to the listing. <ref>https://forum.kodi.tv/showthread.php?tid=338467&pid=2801494#pid2801494</ref>
 
 
 
== The TVDB ==
The TVDB allows for three listing orders as detailed below.
*These are the only three orders available.
*The current web site is flawed and does not allow the display of the different orders.




= TV Show Folder =
;Aired Order
[[File:Video-TVShow Folder.png|500px|right]]
*This is the default order set in the scraper settings.
'''Each TV Show requires its own folder''' as the Show Title is extracted from the folder name for a match with with the Information Provider site. For this reason, {{Kodi}} '''cannot''' support the flat folder structure for TV Shows where all episodes from different TV Shows are in the same folder.
*TVDB lists all TV shows in the original '''Aired Order'''. The first time a show is ever broadcast, that is the listing shown. The site is not concerned with how it was broadcast the 2nd, 3rd or 15th time, or how it was broadcast in other countries, or during syndication. It only lists the order of the FIRST TIME ever broadcast, whether that be on Free To Air or Subscription Television.
*Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.


The TV Show folders are located inside the '''''[[Naming_video_files#Source_Folder|Source folder]]''''', explained in the previous page.
;DVD Order
*In many cases, DVD's are released with a different episode listing, normally being the original order envisioned by the Director. To accommodate this, the site also has a '''DVD Order''' listing.
*Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.
*There are many TV Shows on the TVDB site that do not have the DVD Order data entered. The scraper will default back to Aired Order if there is no DVD Order information listed.
*Note: As the data at TVDB is created by the open community, it is not uncommon for errors to occur with DVD Order details. As it is seen as secondary information, the errors can go unnoticed. One major error that affects the scrapers is incomplete DVD Order details. For example, some episodes have no DVD Order data, while other episodes in the same season do have the data.
*Early May 2018, TVDB upgraded their website to v2.0. Unfortunately a glitch has prevented the display of DVD Order and Absolute Order information. It is unknown when it will be rectified.


The folder name will be [[Userdata/advancedsettings.xml#.3Ccleanstrings.3E|cleaned]] of commonly used strings, such as ''DVDRip, 1080p, x264,'' etc. before being passed to the scraper. If the year of release is included, this will be [[advancedsettings.xml#.3Ccleandatetime.3E|extracted]] and used by the scraper to assist in making a match.
;Absolute Order
*This order ignores Seasons and gives each episode an incremental number starting at 1.  
*This order is used for Anime type shows.


Spaces, periods, or underscores may be used to separate words in the folder and file names, but shouldn't be mixed in the same folder name. Note also the issue with Split-episodes regarding file names with periods, discussed later.


The Order you use can be set in the settings page for the TVDB Scraper.




== Recommended ==
The '''Kodi Recommended Method''' is detailed in the image to the right. It has proven to be the simplest, most accurate and reliable method.


The image to the right displays the simplest folder structure and naming convention. The following, commonly used formats, are shown as examples
----
*Single File episodes (Angel),
'''{{big|{{red|The remainder of this page deals with Special Use cases and can be safely ignored. Most libraries will not require implementing the following additional name extensions.}}}}'''
*DVD folders (Battlestar Galactica)
----
*Bluray folders (Battlestar Galactica (2003))






= Advanced Setup =
The previous section details the simplest method to set up your TV Show library. It is considered the '''''best practice''''' method.


== Split folders ==
The sections from here onwards are alternate or advanced methods. With added complexity comes higher maintenance and more potential problems and scraping errors.
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 folder names are identical. A slight variance could see a different show scraped for the second folder.
{{-}}




== Other ==
== TV Show folder ==
'''{{red|These other methods are available but NOT recommended. The sub-folders are easily mistaken and scraped as false TV shows. While it is possible to find and fix the ghost entries, the extra time and work involved will override any possible benefits. If you need to re-build your library at a later stage, the problems will need to be solved again.}}'''
'''{{red|These other methods are available but NOT recommended. The sub-folders are easily mistaken and scraped as false TV shows. While it is possible to find and fix the ghost entries, the extra time and work involved will override any possible benefits. If you need to re-build your library at a later stage, the problems will need to be solved again.}}'''


Line 124: Line 203:




= Season Folder =
== Seasons ==
Season folders can be added to the TV Show and all episodes sorted into their respective Season folder.  
Nil availble options. Season folders are ignored by {{kodi}} which means you can name them as you please.


Even though {{kodi}} can accommodate the Season folder, it will ignore them. Instead it looks for the correctly numbered episode files.


As a side note, once your TV Shows have been scanned into the Library, it is possible to rename the Season folder displayed by {{kodi}}. '''''See: [[Season_rename|Season Rename]]'''''


== Single Episodes ==
Episode files are assumed to  contain a single episode. If you have files that contain two or more episodes, then read the '''''Multi-Episodes''''' section below.


= Episode Files =
The structure of the episode name is as follows:
 
All Episode files must be named correctly for the Kodi scraper to match the correct episode at the scraper site.
 
Kodi uses a series of regular expressions to determine the season and episode numbers from the file name. These are checked in a pre-determined order with the first match being the one used and everything else in the file name is ignored.
 
There are 8 default patterns, plus a separate multi-episode pattern. Using any other numbering convention will require you to edit your advancedsettings.xml to insert your custom RegEx.
 
Spaces, periods, or underscores may be used to separate words in the folder and file names, but shouldn't be mixed in the same name. The regex is not case-sensitive and either uppercase or lowercase may be used. The examples on this page use uppercase.


In the examples the following format will be used to demonstrate the naming conventions and regex patterns:
:{| class="prettytable"
:{| class="prettytable"
|-
|-
Line 148: Line 218:
|}
|}


where:
:where:
*'''name''' is the title of the show and is optional. It could just as easily be after the pattern, or excluded entirely.  
:*'''name''' is the title of the show and is optional. It could just as easily be after the pattern, or excluded entirely.  
*'''<<pattern>>''' is one of the expressions in the following tables and
:*'''<<pattern>>''' is one of the expressions in the following tables. ''S'' = Season number; ''E'' = Episode number
*'''.ext''' is a recognized video file extension, (mkv, avi, ts, mp4, etc) or ommitted entirely if using DVD or Bluray folders. (see image above)
:*'''.ext''' is a recognized video file extension, (mkv, avi, ts, mp4, etc) or ommitted entirely if using DVD or Bluray folders.


Any format will work, so long as the pattern is included somewhere in it.  
Kodi uses a series of regular expressions to determine the season and episode numbers from the file name. These are checked in a pre-determined order with the first match being the one used and everything else in the file name is ignored. NFO Files are '''never''' checked for season and episode numbers.


There are 8 default patterns, plus a separate multi-episode pattern. Using any other numbering convention outside of the ones provided in the list below will require you to edit your advancedsettings.xml and insert your custom RegEx.


It is also important to note that Season Numbers may not be basic numbers. Many shows use the '''Year''' as the Season number. This is quite common with older shows and also daytime soaps and talk shows. '''Always check the site'''
Spaces, periods, or underscores may be used to separate words in the folder and file names, but shouldn't be mixed in the same name. The regex is not case-sensitive and either uppercase or lowercase may be used. The examples on this page use uppercase.
<gallery widths=350px heights=350px>
File:TVDB03.JPG|Image 1- Extract from TVDB showing '''Year''' as the Season Number
File:TVDB04.JPG|Image 2- Extract from TVDB showing standard Season Numbers
</gallery>


== Special Episodes ==
Special Episdes are episodes that don't fit into the normal storyline of the TV Show. They may include items such as:
*Christmas Specials,
*Season recap episodes
*Made for TV Movies that extend the storyline
*Unaired Pilots
'''All Special Episodes use Season 00''' eg:
:{| class="prettytable"
|-
! scope="row" ! style="width:300px; background-color:#a1f5e4; text-align:left;"| Doctor Who (2005) S00E50
|}
Special Episodes can be displayed in amongst the regular episodes. The site of the information provider allows Specials to be ordered in one of the following three ways...
#Listed only in the Special season
#Before a certain episode
#After a certain Season.
If creating '''[[NFO_files/TV_shows|NFO Files]]''', this is specified using the '''<displayepisode></displayepisode>''' and '''<displayseason></displayseason>''' tags.
Check the site of the information provider to confirm your files are in the same order. If not, images and metadata will not match your files.
== Single Episodes ==
Most files should contain a single episode. This is the easist and most flexible method.


The following table lists:
The following table lists:
Line 196: Line 235:


;With Season
;With Season
:The most common scenario
:The most common usage and used for nearly all TV Shows.
;No Season
;No Season
:In cases where you only have one season (or are using absolute order in the TVDB scraper), you may want to forego the inclusion of the season number.
:In cases where you only have one season (or are using absolute order in the TVDB scraper), you may want to forego the inclusion of the season number.
Line 264: Line 303:
|style="width:50px; text-align:left;"|
|style="width:50px; text-align:left;"|
|}
|}
----
'''{{big|{{red|The remainder of this page deals with Special Use cases and can be safely ignored. Most libraries will not require implementing the following additional name extensions.}}}}'''
----




Line 280: Line 309:
In cases where the file contains more than one episode, it is possible to specify all the episodes included in that file. Everything after the first found pattern match will be checked for further matches to the same pattern.
In cases where the file contains more than one episode, it is possible to specify all the episodes included in that file. Everything after the first found pattern match will be checked for further matches to the same pattern.


When using a single video file for multiple episodes it is possible to tell Kodi when each episode starts using '''''[[bookmarks|Episode Bookmarks]]'''''
*When using a single video file for multiple episodes it is possible to tell Kodi when each episode starts using '''''[[bookmarks|Episode Bookmarks]]'''''
 
*Two versions are shown- Long version and Short version. Only the episodes in the file name will be added, e.g. ''name''.'''s01e01-03'''.ext will not include episode 2.
Two versions are shown- Long version and Short version. Only the episodes in the file name will be added, e.g. ''name''.'''s01e01-03'''.ext will not include episode 2.
*The patterns are the same for Single Episode numbering, but extended to include multiple episodes.
 
Using the patterns from the previous section, they have been extended to include multiple episodes. The Order has been ommitted.


:'''''See also: [[Userdata/advancedsettings.xml#.3Ctvmultipartmatching.3E|multi-episode pattern]]'''''
:'''''See also: [[Userdata/advancedsettings.xml#.3Ctvmultipartmatching.3E|multi-episode pattern]]'''''
Line 298: Line 325:
! style="background-color:#f5f5a1; width:200px" | Example Name
! style="background-color:#f5f5a1; width:200px" | Example Name
|-
|-
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''.ext
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|1
|style="width:150px; text-align:left;"|''name'' '''s01e01e02'''.ext
|style="width:150px; text-align:left;"|''name'' '''s01e01e02'''.ext
|-
|-
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-''episode1.title''-'''s01e02'''-''episode2.title''.ext
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-''episode1.title''-'''s01e02'''-''episode2.title''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|1
|style="width:150px; text-align:left;"|''name'' '''s01e01-02-03'''.ext
|style="width:150px; text-align:left;"|''name'' '''s01e01-02-03'''.ext
|-
|-
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''-'''s01e03'''.ext
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''-'''s01e03'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|5
|style="width:150px; text-align:left;"|''name'' '''1x01x02'''.ext
|style="width:150px; text-align:left;"|''name'' '''1x01x02'''.ext
|-
|-
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|5
|style="width:300px; text-align:left;"|''name'' '''1x01'''-'''1x02'''.ext
|style="width:300px; text-align:left;"|''name'' '''1x01'''-'''1x02'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|2
|style="width:150px; text-align:left;"|''name'' '''ep01-02'''.ext
|style="width:150px; text-align:left;"|''name'' '''ep01-02'''.ext
|-
|-
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|2
|style="width:300px; text-align:left;"|''name'' '''ep01'''-'''ep02'''.ext
|style="width:300px; text-align:left;"|''name'' '''ep01'''-'''ep02'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:center;"|
Line 327: Line 354:


== Split Episodes ==
== Split Episodes ==
'''{{red|This section applies to the TVDB site. It does not apply if you are using TheMovieDB-TV Shows scraper}}'''
Split-episodes are feature length episodes that were broadcast as two separate episodes. The Pilot episode can be a feature length episode for many TV Shows. These are re-combined on DVD releases as the original single episode. They are numbered by decimal sub parts eg S01E01.1, S01E01.2, S01E02 '''This is a common cause for failed scrapes of certain episodes'''. The entry must be checked at TVDB to ensure correct numbering has been applied. It is also typical for childrens cartoons, files which only contain a distinct part of an episode may be named as to which part, if the scraper supports it.
Split-episodes are feature length episodes that were broadcast as two separate episodes. The Pilot episode can be a feature length episode for many TV Shows. These are re-combined on DVD releases as the original single episode. They are numbered by decimal sub parts eg S01E01.1, S01E01.2, S01E02 '''This is a common cause for failed scrapes of certain episodes'''. The entry must be checked at TVDB to ensure correct numbering has been applied. It is also typical for childrens cartoons, files which only contain a distinct part of an episode may be named as to which part, if the scraper supports it.


Line 376: Line 405:
Each part will be added to the library just with its full episode number, the sub-part will not be displayed.
Each part will be added to the library just with its full episode number, the sub-part will not be displayed.


If you use periods in your file names and include material after the episode number (such as the episode title), you may get a false match to a split-episode pattern if that material begins with a number below 10. This will likely lead to the episode not being added to the library.  The recommendation is to use a space or underscore instead to separate the numbers for those files, e.g.
'''Note: '''If you use periods in your file names and include material after the episode number (such as the episode title), you may get a false match to a split-episode pattern if that material begins with a number below 10. This will likely lead to the episode not being added to the library.  The recommendation is to use a space or underscore instead to separate the numbers for those files, e.g.
 




Line 606: Line 636:
* [[advancedsettings.xml#discstubextensions|<discstubextensions>]]
* [[advancedsettings.xml#discstubextensions|<discstubextensions>]]


= References =
<references />




Line 613: Line 647:
<div style="{{linear-gradient|left|#a1f5e4, #f5f5a1}}">{{next|[[Video_File_Tagging|'''Video File Tagging''']]}} </div>
<div style="{{linear-gradient|left|#a1f5e4, #f5f5a1}}">{{next|[[Video_File_Tagging|'''Video File Tagging''']]}} </div>


{{updated|17}}
{{updated|18}}
[[Category:FAQ]]
[[Category:FAQ]]
[[Category:Index]]
[[Category:Index]]

Revision as of 03:21, 18 April 2019

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 ▶ Naming video files ▶ TV shows


Introduction

Setting up TV Shows correctly is a little bit more involved than the Movies section. The first part of this page will describe the Kodi best practice to name TV Shows and Episode files and to create the folder structure to save them in. These methods are proven to be the simplest and most robust method which provides the most accurate scrape.


TV Show Folder

Video-TVShow Folder.png

Each TV Show requires its own folder. The TV Show folder name is used to match the show at the scraper site..

Kodi does not support the flat folder structure for TV Shows where all episodes from different TV Shows are in the same folder.

  • The TV Show folders are located inside the Source folder.
  • The folder name will be cleaned of commonly used strings, such as DVDRip, 1080p, x264, etc. before being passed to the scraper. If the year of release is included, this will be extracted and used by the scraper to assist in making a match.
  • Spaces, periods, or underscores may be used to separate words in the folder and file names, but should not be mixed. Note also the issue with Split-episodes regarding file names with periods.


Naming TV Shows follows the same guidelines as for Movies.

  • Name the TV Show folder the same way as shown on the TV Show page at the scraper site.
  • It is always best practice to include the year along with the title. This makes scraping more accurate and differentiates between original and remake versions.
  • This guideline also applies to Country of Origin TV Shows. For example Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU), Hells Kitchen (IT) etc.
  • The title and (year) displayed at the scraper site is how you should name your show.


The best practice method is detailed in the image to the right. (season folders are optional)

  • Angel (1999)- TV Show folder containing Single File episodes
  • Battlestar Galactica (1978)- TV Show folder containing DVD folders for episodes
  • Battlestar Galactica (2004)- TV Show folder containing Bluray folders fore episodes


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.


Season Folder

Season folders are optional. They are useful to reduce clutter in the main TV Show folder.

Even though Kodi can accommodate the Season folder, it will ignore them. Instead it looks for the correctly numbered episode files.

As a side note, once your TV Shows have been scanned into the Library, it is possible to rename the Season folder displayed by Kodi. See: Season Rename


When scraping be aware that season numbers may not be basic numbers. Many shows use the Year as the season number. This is quite common with older shows, daytime soaps and talk shows. Always check the site


Episode Files

Check the site of the information provider to confirm your files are in the same order and that the episodes exist at the scraper site. If not, images and metadata will not match your episode files or your scrape will fail if the episodes do not exist.

  • The episode files (or folders if using DVD or Bluray folders) are located inside the TV Show folder or inside Season folders if using them.
  • The file name (or folder name) will be cleaned of commonly used strings, such as DVDRip, 1080p, x264, etc. before being passed to the scraper.
  • Spaces, periods, or underscores may be used to separate words in the folder and file names, but should not be mixed. Note also the issue with Split-episodes regarding file names with periods.

All episode files must be named and numbered correctly for the scanner to match the correct episode to the <episodeguide> URL of the TV Show downloaded from the scraper site. You cannot nominate season and episode numbering through NFO Files.

The following is the simplest and most accurate way to name your episode files:

Angel (1999) S01E01.mkv
Where: Angel (1999) = TV Show name
S01E01 = Season 1, Episode 1


For information on alternate or advanced episode naming conventions, see the Advanced Setup section further down this page.

For information on alternate episode orders, see the Episode Groups section further down this page.


Specials Episodes

All Special Episodes use Season 00

Doctor Who (2005) S00E50

They are listed at TheMovieDB in the Specials section of the Season listing.

Special Episdes are episodes that do not fit into the normal storyline of the TV Show. They may include items such as Christmas Specials, Season recap episodes, Made for TV Movies that extend the storyline, Unaired Pilots etc

Special Episodes can be displayed in amongst the regular episodes through the use of NFO Files. this is specified using the <displayepisode></displayepisode> and <displayseason></displayseason> tags.


Episode Groups

Episode Groups or Orders are listings with alternate episode orders. Some TV Shows are broadcast in one order but the DVD/Bluray release may have a different screening order. A well known example is the TV Show Firefly where the Studio opted to broadcast high action episodes for ratings first, while the Producer wanted a different order to correctly unfold the storyline.


TheMovieDB-TV Shows

TheMovieDB uses Episode Groups for additional episode orders.

  • Numerous Groups can be added which should cater to the different releases between countries
  • Creating Groups and adding episodes is quite simplistic, using drag and drop which should encourage contributors to complete the entries
  • Where available, the listings are easily accessible for viewing as shown in the images below

To use one of the orders for scraping, follow the images above and place the address in a Parsing NFO file then scrape. The Parsing NFO File will point the scraper to the listing. [1]


The TVDB

The TVDB allows for three listing orders as detailed below.

  • These are the only three orders available.
  • The current web site is flawed and does not allow the display of the different orders.


Aired Order
  • This is the default order set in the scraper settings.
  • TVDB lists all TV shows in the original Aired Order. The first time a show is ever broadcast, that is the listing shown. The site is not concerned with how it was broadcast the 2nd, 3rd or 15th time, or how it was broadcast in other countries, or during syndication. It only lists the order of the FIRST TIME ever broadcast, whether that be on Free To Air or Subscription Television.
  • Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.
DVD Order
  • In many cases, DVD's are released with a different episode listing, normally being the original order envisioned by the Director. To accommodate this, the site also has a DVD Order listing.
  • Episodes are grouped and listed into Seasons and each episode is numbered sequentially from 1, which resets for each season.
  • There are many TV Shows on the TVDB site that do not have the DVD Order data entered. The scraper will default back to Aired Order if there is no DVD Order information listed.
  • Note: As the data at TVDB is created by the open community, it is not uncommon for errors to occur with DVD Order details. As it is seen as secondary information, the errors can go unnoticed. One major error that affects the scrapers is incomplete DVD Order details. For example, some episodes have no DVD Order data, while other episodes in the same season do have the data.
  • Early May 2018, TVDB upgraded their website to v2.0. Unfortunately a glitch has prevented the display of DVD Order and Absolute Order information. It is unknown when it will be rectified.
Absolute Order
  • This order ignores Seasons and gives each episode an incremental number starting at 1.
  • This order is used for Anime type shows.


The Order you use can be set in the settings page for the TVDB Scraper.



The remainder of this page deals with Special Use cases and can be safely ignored. Most libraries will not require implementing the following additional name extensions.



Advanced Setup

The previous section details the simplest method to set up your TV Show library. It is considered the best practice method.

The sections from here onwards are alternate or advanced methods. With added complexity comes higher maintenance and more potential problems and scraping errors.


TV Show folder

These other methods are available but NOT recommended. The sub-folders are easily mistaken and scraped as false TV shows. While it is possible to find and fix the ghost entries, the extra time and work involved will override any possible benefits. If you need to re-build your library at a later stage, the problems will need to be solved again.

In more complex situations where your top-level directory is further sub-divided before the show folders, you can add the top-level as source but not set the content, and then set the content to TV shows on each sub-folder.

Example
TV Shows                  <<Source folder, Content: None>>
   |----A-M               <<Content: TV shows>>
   |      |----TV Show 1
   |              |--Files
   |----N-Z               <<Content: TV shows>>
   |      |----TV Show 2
   |              |--Files


It is also possible to have a sub-folder group multiple shows together in an otherwise normal directory structure. Just change the content on the sub-folder and de-select the "Selected folder contains a single TV show" setting.

Example
TV Shows                  <<Source folder, Content: TV shows>>
   |----TV Show 1
   |       |----Season #
   |            |--Files
   |----Star Trek Series  <<Content:TV shows>>
   |       |----Star Trek
   |       |       |--Files
   |       |----Star Trek The Next Generation
   |               |--Files

In these cases, it's best to refrain from scanning the files into the library until the content is set correctly for all folders, to avoid incorrect results and the need to rescan.


Seasons

Nil availble options. Season folders are ignored by Kodi which means you can name them as you please.


Single Episodes

Episode files are assumed to contain a single episode. If you have files that contain two or more episodes, then read the Multi-Episodes section below.

The structure of the episode name is as follows:

name <<pattern>>.ext
where:
  • name is the title of the show and is optional. It could just as easily be after the pattern, or excluded entirely.
  • <<pattern>> is one of the expressions in the following tables. S = Season number; E = Episode number
  • .ext is a recognized video file extension, (mkv, avi, ts, mp4, etc) or ommitted entirely if using DVD or Bluray folders.

Kodi uses a series of regular expressions to determine the season and episode numbers from the file name. These are checked in a pre-determined order with the first match being the one used and everything else in the file name is ignored. NFO Files are never checked for season and episode numbers.

There are 8 default patterns, plus a separate multi-episode pattern. Using any other numbering convention outside of the ones provided in the list below will require you to edit your advancedsettings.xml and insert your custom RegEx.

Spaces, periods, or underscores may be used to separate words in the folder and file names, but shouldn't be mixed in the same name. The regex is not case-sensitive and either uppercase or lowercase may be used. The examples on this page use uppercase.


The following table lists:

  • The pattern that Kodi will search for.
  • The order of the search. ie. Patterns numbered 1 will be matched first and those numbered 7 will be matched last.
With Season
The most common usage and used for nearly all TV Shows.
No Season
In cases where you only have one season (or are using absolute order in the TVDB scraper), you may want to forego the inclusion of the season number.
By date
Common for long-running daily shows, allows the use of aired date of the episode.
With Season No Season By Date
Order Episode Naming Order Episode Naming Order Episode Naming
1 Name S01E02.ext 2 Name ep02.ext 3 Name yyyy.mm.dd.ext
1 Name S1E2.ext 2 Name ep_02.ext 3 Name yyyy-mm-dd.ext
1 Name S01.E02.ext 7 Name part.II.ext 4 Name dd.mm.yyyy.ext
1 Name S01_E02.ext 7 Name pt.II.ext
1 Name S01xE02.ext 7 Name pt_II.ext
5 Name 1x02.ext
6 Name 102.ext


Multi-Episodes

In cases where the file contains more than one episode, it is possible to specify all the episodes included in that file. Everything after the first found pattern match will be checked for further matches to the same pattern.

  • When using a single video file for multiple episodes it is possible to tell Kodi when each episode starts using Episode Bookmarks
  • Two versions are shown- Long version and Short version. Only the episodes in the file name will be added, e.g. name.s01e01-03.ext will not include episode 2.
  • The patterns are the same for Single Episode numbering, but extended to include multiple episodes.
See also: multi-episode pattern
Complex Pattern Short Pattern
Order Example Name Order Example Name
1 name s01e01-s01e02.ext 1 name s01e01e02.ext
1 name s01e01-episode1.title-s01e02-episode2.title.ext 1 name s01e01-02-03.ext
1 name s01e01-s01e02-s01e03.ext 5 name 1x01x02.ext
5 name 1x01-1x02.ext 2 name ep01-02.ext
2 name ep01-ep02.ext


Split Episodes

This section applies to the TVDB site. It does not apply if you are using TheMovieDB-TV Shows scraper

Split-episodes are feature length episodes that were broadcast as two separate episodes. The Pilot episode can be a feature length episode for many TV Shows. These are re-combined on DVD releases as the original single episode. They are numbered by decimal sub parts eg S01E01.1, S01E01.2, S01E02 This is a common cause for failed scrapes of certain episodes. The entry must be checked at TVDB to ensure correct numbering has been applied. It is also typical for childrens cartoons, files which only contain a distinct part of an episode may be named as to which part, if the scraper supports it.

Up to 9 sub-parts are allowed (using either .1-.9 or a-i). These can also be combined with the multi-episode pattern, if your file contains all parts joined as a single episode.

Using the patterns from the Single Episodes section, they have been extended to include Split episodes. The Order has been ommitted.

Single Episodes Multi Part Episodes
Order Example Name Order Example Name
name s01e01.1.ext name s01e01.1.s01e01.2.ext
name s01e01a.ext name 1x01.1-x01.2.ext
name 1x01.1.ext name ep01a-01b.ext
name 1x01a.ext
name ep01.1.ext
name 101.1.ext

Each part will be added to the library just with its full episode number, the sub-part will not be displayed.

Note: If you use periods in your file names and include material after the episode number (such as the episode title), you may get a false match to a split-episode pattern if that material begins with a number below 10. This will likely lead to the episode not being added to the library. The recommendation is to use a space or underscore instead to separate the numbers for those files, e.g.



Stub and Stream Files

  • If you have a collection of DVD's and Bluray disks but do not want to rip them to a hard drive, then a Media Stub File allows you to add the collection of disks to the Kodi Video Library.
  • It is a simple text based file that is added to your Source in exactly the same way as any other Movie or TV Show, which is then scanned or scraped into the library.


Various internet video and audio streams can be played back in Kodi as if they were locally stored on your media center by using STRM files. As long as the format and streaming-method (network-protocol) is supported by Kodi, stream can be added. These are basic text files that look like <name>.strm and contain a URL to the internet stream. STRM files can also be added to the video library and can have cover art, summaries, etc.

Some internet sites may have an add-on available that can also access these media streams, rather than having to manually create STRM files. See Add-ons for more information on how to find and install add-ons.


Media Tags / Flags

480.png 1080.png 720.png 1080 n.png 480-1.png Divx.png Xvid.png H264.png Bluray.png Dvd.png Avc1.png 1.33.png 1.66.png 2.20.png 2.35.png


Media flags are icons in Kodi that displays the meta-information from the media file of a movie, TV show or music title. They are skin specific, and what works in one skin, may not work in another skin. It is always best to check with the skin sub-forum which flags and tags are used.

It is important to note that the skin will display these flags even when these extensions are not used. The only difference being that without the extensions, the movie must be played first in order for Kodi to read the audio and video codec data.

The actual audio and video codec data will override any extension used. This means that if you set the extension of, say, .ATMOS but the video file only has a stereo track, then the .ATMOS flag will be removed.


Example- note that movie folders are used, and the folder is simply named while the filename has been modified with extensions.

...\Paul (2011)\Paul (2011).4K.HDR.Atmos.mkv


3D Episodes

Some 3D episodes might need an additional file name extension to be identified by Kodi as 3D. See 3D for details on that additional extension, and when it is needed.


Custom Filenames

It's possible to use custom file names that don't match any of the default patterns by editing your advancedsettings.xml file to include a tvshowmatching tag containing regular expressions.

A tvshowmatching regexp needs up to three capturing groups:

1 capturing group = episode number (season will default to season 1), no multi-episode matches will be attempted
2 capturing groups = season number + episode number (in that order), no multi-episode matches will be attempted
3 capturing groups = season number + episode number + multi-episode matching part (typically just the remainder of the file name)

(A capturing group is essentially a part of the regexp contained inside brackets.)

To have no season but multi-episode matching, use three groups but leave the first empty.

Date-based regexps are also possible, and are marked by a bydate="true" attribute in the regexp. These also use three capturing groups, either as year-month-day or day-month-year, the lengths must be exactly 4-2-2 or 2-2-4.

Your custom tvshowmatching regexps can be either checked for before the default set using action="prepend", or after using action="append". Not including an action will result in only your regexps being tested. Care should be taken to ensure that the right regexp matches your file names, particularly in regard to the three digit "102" pattern seen above. The regexps should be grouped together inside a single tvshowmatching tag, although you can use two if you wish to prepend and append different regexps.

You can also change the multi-episode matching regexp by including a tvmultipartmatching tag in your advancedsettings.xml (separate from the tvshowmatching tag). There can be only one tvmultipartmatching expression, whatever you use will overwrite the default, so take care to only expand on the default pattern unless you are certain. The tvmultipartmatching requires one capturing group for the episode number.

For simplicity, the split-episode pattern has been excluded from the examples below. To allow for split-episodes, replace the [0-9]+ in the episode capturing group with [0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?


Examples

A fairly straightforward example to begin.

Season ## - Episode ##
"Season [season#] - Episode [episode#]" anywhere in the file name
 <tvshowmatching action="prepend">
     <regexp>Season ([0-9]+) - Episode ([0-9]+)([^\\/]*)$</regexp>
 </tvshowmatching>
Example : TV Shows\Scrubs\Season 1\Scrubs - Season 1 - Episode 01 - Pilot.avi
The first two capturing groups should be obvious, the third group ([^\\/]*) captures everything up to the end of the file name $, this allows for multi-part file names such as name.Season 1 - Episode 01 - Season 1 - Episode 02.ext as well as the simpler name.Season 1 - Episode 01-02.ext



The entire file path is passed to the regexps, so care should be taken to ensure the matches can't occur earlier in the path, but this does mean for example, you can capture the season number from a sub-folder name.

\Season #\##
Season [season#] at the end of the directory name, file name starts with [episode#]
 <tvshowmatching action="prepend">
     <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)([^\\/]*)$</regexp>
 </tvshowmatching>
Example : \Battlestar Galactica (2003)\Season 3\01 - Occupation.avi (Season 3, Episode 1)
Again we use three groups here to allow for multi-episode, but in this case (obviously) only the shorter multi-episode pattern can occur, e.g. Season 1\01x02 - Episode title.ext.



For numbering without a season, you should ensure that only the episode number gets matched against and not another number in the title or episode title, or a number as part of a different pattern.

- ## -
" - [episode#] - " anywhere in the file name
 <tvshowmatching action="prepend">
     <regexp> - ()([0-9]+)((?:-[0-9]+)*) - [^\\/]*$</regexp>
 </tvshowmatching>
Example : \One Piece\One Piece - 099 - Spirit of the Fakes! Heart of the Rebel Army, Kamyu!.avi ("Season 1", Episode 99) (Using Absolute order)
Here, the first capturing group is left empty, and there is a distinct pattern before and after the episode number to ensure only it gets matched. Also instead of capturing the remainder of the file name for multi-part matching, we only capturing a single repeating pattern so only a - 01-02-03 - format will work.



It's also possible to specify a different default season for without-season regexps.

\Specials\##
Directory name is Specials, file name starts with [episode#]
 <tvshowmatching action="prepend">
     <regexp defaultseason="0">Specials[\\/]()([0-9]+)([^\\/]*)$</regexp>
 </tvshowmatching>
Example : \Firefly\Specials\04 - Browncoats Unite.mkv (Season 0, Episode 4)
A combination of the previous two examples, allowing special episodes to reside in a "Specials" folder rather than a "Season 0" folder.



The default date-based regexps only allow for periods or hyphens as delimiters...

####_##_##
[year]_[month]_[day] anywhere in the file name
 <tvshowmatching action="prepend">
     <regexp bydate="true">([0-9]{4})_([0-9]{2})_([0-9]{2})[^\\/]*$</regexp>
 </tvshowmatching>
Example: : \The Colbert Report\2005_10_17.avi
The exact number of digits is specified for each group to ensure compliance. A separate [month]_[day]_[year] regexp would be needed if both formats are in use.



The default regexps don't allow for DVD folder structures, this can usually be remedied by replacing the final $ with (?:(?:[\\/]video_ts)?[\\/]video_ts\.ifo)$

S##E##\VIDEO_TS\VIDEO_TS.IFO
 <tvshowmatching action="append">
     <regexp>[Ss]([0-9]+)[ ._-]*[Ee]([0-9]+)([^\\/]*)(?:(?:[\\/]VIDEO_TS)?[\\/]VIDEO_TS\.IFO)$</regexp>
 </tvshowmatching>
Example: \Battlestar Galactica (2003)\The Mini-Series S00E01E02\VIDEO_TS\VIDEO_TS.IFO
The VIDEO_TS folder is optional, e.g. S01E01\VIDEO_TS.IFO will also work.



Similarly for Bluray folder structures, you can replace the final $ with (?:(?:[\\/]bdmv)?[\\/]index\.bdmv)$

#x##\BDMV\index.bdmv
 <tvshowmatching action="append">
     <regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?:(?:[\\/]bdmv)?[\\/]index\.bdmv)$</regexp>
 </tvshowmatching>
With Bluray folders, you'll also run into trouble with the various mpls and m2ts files incorrectly matching other patterns, so you should also exclude all the other folders and files from being scanned:
  <video>
    <excludetvshowsfromscan action="append">
      <regexp>[\\/](auxdata|backup|clipinf|playlist|stream|certificate)[\\/]</regexp>
      <regexp>movieobject\.bdmv</regexp>
    </excludetvshowsfromscan>
  </video>



Finally, a tvmultipartmatching example.

S##E##+##
Multiple episode numbers, separated by a + sign
 <tvmultipartmatching>^[-_EeXx+]+([0-9]+)</tvmultipartmatching>
Example: : \Lost\Lost.S01E23+24.Exodus.mkv
In this case we can simply add the + sign to the default symbols, thus preserving the defaults as well.


advancedsettings.xml

The following settings allow user customisation for TV Show and Episode matching.


References


Return to top


Next step: Video File Tagging