Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
mNo edit summary
(Updated for v20)
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{VideoLibraryCreate}}
{{VideoLibraryCreate}}
{{mininav|[[Video library]]|[[Naming video files]]}}
{{mininav| [[Video library]] |[[HOW-TO:Create_Video_Library|Create Video Library]] }}




= Introduction =
= Introduction =
<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" />
There are two components to TV Shows that need to be accurate for a successful scrape:
# Correct '''naming''' of the TV Show
# Correct '''numbering''' of the Episodes


{{note|This page details the TV Show folder. Season folders and episodes are discussed in the following pages.}}


 
= TV Show Folders =
= TV Show Folder =
{|
[[File:Video-TVShow Folder.png|500px|right]]
! scope="row" colspan="10"  style="width:300px; background-color:#; text-align:left;"|  
'''{{red|Each TV Show requires its own folder. The TV Show folder name is used to match the show at the scraper site.}}'''.
! scope="row" ! |
 
{{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 '''''[[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 for 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|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'''
<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 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 '''''[[Advancedsettings.xml#.3Ccleanstrings.3E|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:
 
:{| class="prettytable"
|-
! scope="row" colspan="2"  style="width:300px; background-color:#a1f5e4; text-align:center;"| Angel (1999) S01E01.mkv<br>
|-
|-
|Where:
| style="background-color:#;"| [[File:Video-TVShow Folder.png|left|400px|Image 1- TV Show folders]] || style="background-color:#;"|
|'''''Angel (1999)''''' = TV Show name
'''{{resize|1.3em|{{red|Each TV Show requires its own folder in the Source folder}} }}'''
|-
|
|'''''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.


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 the TV Show folder


== Specials Episodes ==
* The TV Show folders are saved inside the '''''[[Source_folder|Source folder]]'''''
'''All Special Episodes use Season 00'''  
* Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
:{| class="prettytable"
* 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.
* '''The title and (year) displayed at the scraper site is how you should name your show.'''
<br>
<br>
'''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:
* '''''[https://www.themoviedb.org/ TheMovieDB]''''' - ''(the default scraper)''
* '''''[https://www.thetvdb.com/ TVDB]'''''
* '''''[https://www.tvmaze.com/ TV Maze]'''''
|-
|-
! scope="row" ! style="width:300px; background-color:#a1f5e4; text-align:left;"| Doctor Who (2005) S00E50
! scope="row" colspan="10"  style="width:300px; background-color:#; text-align:left;"|  
|}
|}


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.
== Split folders ==
 
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.<br>
 
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.
 
= 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.


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.


== TheMovieDB-TV Shows ==
If using NFO Files, copy the NFO file from one location into the other split folders.
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


<gallery mode="traditional" widths="500px" heights="283px">
File:EpisodeGroups01.jpg|Image 1- Accessing Episode Groups
File:EpisodeGroups02.jpg|Image 2- Available Episode Groups
File:EpisodeGroups03.jpg|Image 3- Select a Group, then copy the address for use in a Parsing NFO file.
</gallery>


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>




 
<center>
== The TVDB ==
{| style="border: 1px solid black;"
The TVDB allows for three listing orders as detailed below.
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Mergefrom.gif|60px|link=Naming_video_files/Movies]]
*These are the only three orders available.
| style="width:200px; text-align:center;" | '''Previous step'''  
*The current web site is flawed and does not allow the display of the different orders.
| style="width:200px; text-align:center;" | '''Next step'''
 
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Merge-arrow.gif|60px|link=Naming_video_files/Seasons]]
 
;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.
{{warning|DVD, Absolute and Flexible Orders at TVDB are partly broken. This is not expected to be fixed until the TVDB v4 API is released mid 2021}}
;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.
 
 
 
----
'''{{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.}}}}'''
----
 
<div style="{{linear-gradient|left|#a1f5e4, #f5f5a1}}">{{next|[[Adding_video_sources|'''Add Source & Scrape''']]}} </div>
 
 
 
= 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 ==
'''{{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.}}'''
 
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
 
:{| class="prettytable" style="width:500px; background-color:#a1f5e4; text-align:left;"
|
<pre>
TV Shows                  <<Source folder, Content: None>>
  |----A-M              <<Content: TV shows>>
  |      |----TV Show 1
  |              |--Files
  |----N-Z              <<Content: TV shows>>
  |      |----TV Show 2
  |              |--Files
</pre>
|}
 
 
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
 
:{| class="prettytable" style="width:500px; background-color:#a1f5e4; text-align:left;"
|
<pre>
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
</pre>
|}
 
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:
 
:{| class="prettytable"
|-
|-
! scope="row" ! style="width:300px; background-color:#a1f5e4; text-align:left;"| name <<pattern>>.ext
| 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>
: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.
 
{| class="prettytable"
|-
! colspan="2" style="background-color:#a1f5e4;" | With Season
! colspan="2" style="background-color:#a1f5e4;" | No Season
! colspan="2" style="background-color:#a1f5e4;" | By Date
|+
! style="background-color:#f5f5a1;" | Order
! style="background-color:#f5f5a1; width:200px" | Episode Naming
! style="background-color:#f5f5a1;" | Order
! style="background-color:#f5f5a1; width:200px" | Episode Naming
! style="background-color:#f5f5a1;" | Order
! style="background-color:#f5f5a1; width:200px" | Episode Naming
|-
|style="width:50px; text-align:center;"|1
|style="width:50px; text-align:left;"|''Name'' '''S01E02'''.ext {{resize|70%|(most accurate)}}
|style="width:50px; text-align:center;"|2
|style="width:50px; text-align:left;"|''Name'' '''ep02'''.ext
|style="width:50px; text-align:center;"|3
|style="width:50px; text-align:left;"|''Name'' '''yyyy.mm.dd'''.ext
|-
|style="width:50px; text-align:center;"|1
|style="width:50px; text-align:left;"|''Name'' '''S1E2'''.ext
|style="width:50px; text-align:center;"|2
|style="width:50px; text-align:left;"|''Name'' '''ep_02'''.ext
|style="width:50px; text-align:center;"|3
|style="width:50px; text-align:left;"|''Name'' '''yyyy-mm-dd'''.ext
|-
|style="width:50px; text-align:center;"|1
|style="width:50px; text-align:left;"|''Name'' '''S01.E02'''.ext
|style="width:50px; text-align:center;"|7
|style="width:50px; text-align:left;"|''Name'' '''E02'''.ext
|style="width:50px; text-align:center;"|4
|style="width:50px; text-align:left;"|''Name'' '''dd.mm.yyyy'''.ext
|-
|style="width:50px; text-align:center;"|1
|style="width:50px; text-align:left;"|''Name'' '''S01_E02'''.ext
|style="width:50px; text-align:center;"|7
|style="width:50px; text-align:left;"|''Name'' '''Part II'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:left;"|
|-
|style="width:50px; text-align:center;"|1
|style="width:50px; text-align:left;"|''Name'' '''S01xE02'''.ext
|style="width:50px; text-align:center;"|7
|style="width:50px; text-align:left;"|''Name'' '''Pt II'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:left;"|
|-
|style="width:50px; text-align:center;"|5
|style="width:50px; text-align:left;"|''Name'' '''1x02'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:left;"|''Name'' '''Part II'''.ext
|style="width:50px; text-align:center;"|
|style="width:50px; text-align:left;"|
|-
|style="width:50px; text-align:center;"|6
|style="width:50px; text-align:left;"|''Name'' '''102'''.ext {{resize|70%|(least accurate)}}
|style="width:50px; text-align:left;"|
|style="width:50px; text-align:left;"|
|style="width:50px; text-align:left;"|
|style="width:50px; text-align:left;"|
|}
 
 
 
== 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 '''''[[Bookmarks_and_chapters|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: [[Advancedsettings.xml#.3Ctvmultipartmatching.3E|multi-episode pattern]]'''''
 
{| class="prettytable"
|-
! colspan="2" style="background-color:#a1f5e4;" | Complex Pattern
! colspan="2" style="background-color:#a1f5e4;" | Short Pattern
|+
! style="background-color:#f5f5a1;" | Order
! style="background-color:#f5f5a1; width:350px" | Example Name
! style="background-color:#f5f5a1;" | Order
! style="background-color:#f5f5a1; width:200px" | Example Name
|-
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''.ext
|style="width:50px; text-align:center;"|1
|style="width:150px; text-align:left;"|''name'' '''s01e01e02'''.ext
|-
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-''episode1.title''-'''s01e02'''-''episode2.title''.ext
|style="width:50px; text-align:center;"|1
|style="width:150px; text-align:left;"|''name'' '''s01e01-02-03'''.ext
|-
|style="width:50px; text-align:center;"|1
|style="width:300px; text-align:left;"|''name'' '''s01e01'''-'''s01e02'''-'''s01e03'''.ext
|style="width:50px; text-align:center;"|5
|style="width:150px; text-align:left;"|''name'' '''1x01x02'''.ext
|-
|style="width:50px; text-align:center;"|5
|style="width:300px; text-align:left;"|''name'' '''1x01'''-'''1x02'''.ext
|style="width:50px; text-align:center;"|2
|style="width:150px; text-align:left;"|''name'' '''ep01-02'''.ext
|-
|style="width:50px; text-align:center;"|2
|style="width:300px; text-align:left;"|''name'' '''ep01'''-'''ep02'''.ext
|style="width:50px; text-align:center;"|
|style="width:150px; text-align:left;"|
|}
 
 
 
== Split Episodes ==
{{warning|{{resize|1.4em|The November 2019 upgrade of the TVDB site has removed the ''E01.1, E01.2'' type numbering of episodes.<br> This naming technique no longer applies for any scraper and has been removed from the wiki.}}}}
If your files still contain this numbering scheme, and you intend to re-scrape your library, check the episode listing at [https://www.thetvdb.com/ TheTVDB] to ensure your episodes are numbered correctly.
 
 
= Stub and Stream Files =
{{main|Media_stubs}}
{{#lst:Media_stubs|intro}}
 
 
{{main|Internet_video_and_audio_streams}}
{{#lst:Internet_video_and_audio_streams|intro}}
 
 
 
= Media Tags / Flags =
{{main|Media flags}}
 
[[File:480.png|50px]] [[File:1080.png|50px]] [[File:720.png|50px]] [[File:1080 n.png|50px]] [[File:480-1.png|50px]]
[[File:Divx.png|80px]] [[File:Xvid.png|80px]] [[File:H264.png|80px]] [[File:Bluray.png|80px]] [[File:Dvd.png|80px]] [[File:Avc1.png|80px]]
[[File:1.33.png|50px]] [[File:1.66.png|50px]] [[File:2.20.png|50px]] [[File:2.35.png|50px]]
 
 
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.
{| class="prettytable"
|-
! scope="row" ! style="width:400px; background-color:#a1f5e4; text-align:left;"| ...\Paul (2011)\Paul (2011).4K.HDR.Atmos.mkv
|}
 
 
 
== 3D Episodes ==
{{Main|3D}}
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 [[advancedsettings.xml#.3Ctvshowmatching.3E|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 <code>action="prepend"</code>, or after using <code>action="append"</code>.  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 [[#Single_Episodes|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 [[Advancedsettings.xml#.3Ctvmultipartmatching.3E|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 <code>[0-9]+</code> in the episode capturing group with <code>[0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?</code>
 
 
 
== Examples ==
A fairly straightforward example to begin.
;Season ## - Episode ##
:"Season [season#] - Episode [episode#]" anywhere in the file name
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="prepend">
    <regexp>Season ([0-9]+) - Episode ([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''Example''' : TV Shows\Scrubs\Season 1\Scrubs - '''Season 1 - Episode 01''' - Pilot.avi
:The first two capturing groups should be obvious, the third group <code>([^\\/]*)</code> captures everything up to the end of the file name <code>$</code>, 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#]
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="prepend">
    <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''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
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="prepend">
    <regexp> - ()([0-9]+)((?:-[0-9]+)*) - [^\\/]*$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''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#]
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="prepend">
    <regexp defaultseason="0">Specials[\\/]()([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''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...
;<nowiki>####_##_##</nowiki>
:[year]_[month]_[day] anywhere in the file name
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="prepend">
    <regexp bydate="true">([0-9]{4})_([0-9]{2})_([0-9]{2})[^\\/]*$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''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 <code>$</code> with <code>(?:(?:[\\/]video_ts)?[\\/]video_ts\.ifo)$</code>
;S##E##\VIDEO_TS\VIDEO_TS.IFO
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="append">
    <regexp>[Ss]([0-9]+)[ ._-]*[Ee]([0-9]+)([^\\/]*)(?:(?:[\\/]VIDEO_TS)?[\\/]VIDEO_TS\.IFO)$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
:'''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 <code>$</code> with <code>(?:(?:[\\/]bdmv)?[\\/]index\.bdmv)$</code>
;<nowiki>#</nowiki>x##\BDMV\index.bdmv
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvshowmatching action="append">
    <regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?:(?:[\\/]bdmv)?[\\/]index\.bdmv)$</regexp>
</tvshowmatching>
</syntaxhighlight>
|}
: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:
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
  <video>
    <excludetvshowsfromscan action="append">
      <regexp>[\\/](auxdata|backup|clipinf|playlist|stream|certificate)[\\/]</regexp>
      <regexp>movieobject\.bdmv</regexp>
    </excludetvshowsfromscan>
  </video>
</syntaxhighlight>
|}
 
 
 
----
Finally, a tvmultipartmatching example.
;S##E##+##
:Multiple episode numbers, separated by a + sign
:{| class="prettytable" style="width:900px; background-color:#a1f5e4; text-align:left;"
|-
|
<syntaxhighlight lang=xml enclose="div">
<tvmultipartmatching>^[-_EeXx+]+([0-9]+)</tvmultipartmatching>
</syntaxhighlight>
|}
:'''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 =
{{main|advancedsettings.xml}}
The following settings allow user customisation for TV Show and Episode matching.
 
* [[advancedsettings.xml#tvshowmatching|<tvshowmatching>]]
* [[advancedsettings.xml#tvmultipartmatching|<tvmultipartmatching>]]
* [[advancedsettings.xml#excludetvshowsfromscan|<excludetvshowsfromscan>]]
* [[advancedsettings.xml#cleanstrings|<cleanstrings>]]
* [[advancedsettings.xml#videoextensions|<videoextensions>]]
* [[advancedsettings.xml#discstubextensions|<discstubextensions>]]
 
 
 
= References =
<references />






{{top}}
{{top}}
{{updated|20}}


<div style="{{linear-gradient|left|#a1f5e4, #f5f5a1}}">{{next|[[Adding_video_sources|'''Add Source & Scrape''']]}} </div>
{{updated|18}}
[[Category:FAQ]]
[[Category:Index]]
[[Category:How-to]]
[[Category:Guides]]
[[Category:Guides]]
[[Category:Manual]]
[[Category:Karellen]]
[[Category:Karellen]]
[[Category:Video library]]
[[Category:Video library]]
[[Category:General topics]]
[[Category:First time user]]
[[Category:First time user]]
[[Category:Quick Start Guide]]

Revision as of 04:01, 13 February 2023

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.

TV Show Folders

Image 1- TV Show folders

Each TV Show requires its own folder in the Source folder

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 the TV Show 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.
  • 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.
  • 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, 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