Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Sho
(v21 Updates)
 
(244 intermediate revisions by 31 users not shown)
Line 1: Line 1:
Since build 8044, date: 2007-03-08, XBMC has had the ability to lookup and present information on TV Shows in the [[Video Library]].
{{VideoLibraryCreate}}
TV show support is through new [[How To use Scrapers|scrapers]] and requires a connection to the internet.
{{mininav| [[Video library]] |[[HOW-TO:Create_Video_Library|Create Video Library]] }}
The information gathered is cached locally so that it is later available when you are offline. In order to get the most out of your video library, you need to scan your TV shows and retrieve the information about them from sites like [http://www.tv.com tv.com] and [http://tvdb.zsori.com/ The Online TV Database].
 
 
= Introduction =
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.}}
 
 
 
= Naming =
The naming of your TV Show folder is '''critical''' to ensure the scrapers can correctly identify the TV Show and its episodes.
 
'''''TV Show name (Year)''''' - This is the correct naming format for both the movie files and movie folders.
 
'''Note:''' If you are unsure of the name or year check it at the scraper site - either '''[https://www.themoviedb.org/ TheMovieDB website]''' or '''[https://thetvdb.com/ TheTVDB website]''' depending on which scraper you have set.


{|
|
== TV show filenaming conventions ==
[[image:Tv.shows.jpg|right|360px]]The TV show lookup relies on the following naming conventions in order to work as intended.


=== Directory Structure & File Names ===
== Filename identifiers ==
The directory structure and filenames for tvshows have to be matched by the regular expressions set in [[AdvancedSettings.xml#.3Ctvshowmatching.3E|tvshowmatching]].
{{#lst:Naming_video_files/Movies|FilenameID}}


The defaults will match the following structures/filenames:


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


Defaults for two-parters will match:
= TV Show Folders =
{|
! scope="row" colspan="10"  style="width:300px; text-align:left;"|
! scope="row" ! |
|-
| [[File:Video-TVShow Folder.png|left|400px|Image 1- TV Show folders]] ||
'''{{resize|1.3em|{{red|Each TV Show requires its own folder in the Source folder}} }}'''


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


==== TV Show Specials ====
* The TV Show folders are saved inside the '''''[[Source_folder|Source folder]]'''''
Special episodes are currently supported with theTVDB.com scraper.  In order for the XBMC scraper regular expressions to recognize them, the should be part of season 0.
* Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
;Example
* When using TVDB scraper for '''Country of Origin''' TV Shows, the (Year) is replaced with the country code. eg ''Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU)'' etc. Check TheTVDB site to confrim.
[http://thetvdb.com/?tab=season&seriesid=80146&seasonid=27486&lid=7 Blackadder's Christmas Carol] should have a filename that matches season 0 episode 1 (e.g. contain s00e01).
* '''The title and (year) displayed at the scraper site is how you should name your show.'''


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


=== Custom Directory Structure & File Names ===
'''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:
When enumerating episodes for a series, XBMC '''only''' cares about the season and episode, so when designing regexps you should '''only''' be concerned with these things.


Here are several common naming schemes and corresponding regexps and examples.
* '''''[https://www.themoviedb.org/ TheMovieDB]''''' - ''(the default scraper)''
* '''''[https://www.thetvdb.com/ TVDB]'''''
* '''''[https://www.tvmaze.com/ TV Maze]'''''
|-
! scope="row" colspan="10"  style="width:300px; text-align:left;"|
|}


'''\Season #\##''' (Season# is at very end of directory name, and filename starts with episode name, neither have to be a specific number of digits) :
<xml>
<tvshowmatching>
    <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</xml>
'''Example''' : \Battlestar Galactica\Season 3\01 - Occupation.avi (Season 3, Episode 1)




'''###''' ([season#][episode#] with nothing in between all in filename, assumes episode number is always 2 digits) :
== Split folders ==
<xml>
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.
<tvshowmatching>
    <regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp>
</tvshowmatching>
</xml>
'''Example''' : \24\Season 6\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)<br>
'''Example 2''' : \Lost\Season 1\Lost - 101.avi (Season 1, Episode 1)<br>
'''Example 3''' : \24\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)


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.


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


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


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


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


'''Season ## - Episode ##''' (Season [season#] - Episode [episode#] in the beginning or middle of filename)
<center>
<xml>
{| style="border: 1px solid black;"
<tvshowmatching>
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Mergefrom.gif|60px|link=Naming_video_files/Movies]]
<regexp>Season ([0-9]+) - Episode ([0-9]+)[^\\/]*</regexp>
| style="width:200px; text-align:center;" | '''Previous step'''
</tvshowmatching>
| style="width:200px; text-align:center;" | '''Next step'''
</xml>
| scope="row" rowspan="2" style=" text-align:center;" | [[File:Merge-arrow.gif|60px|link=Naming_video_files/Seasons]]
'''Example''' TV Shows\Scrubs\Season 1\Scrubs - Season 1 - Episode 01 - Pilot.avi
|-
| style="width:200px; text-align:center;" | '''[[Naming_video_files/Movies|Movie Setup]]'''
| style="width:200px; text-align:center;" | '''[[Naming_video_files/Seasons|Seasons Setup]]'''
|}</center>


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


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


Regular Expression Testing:
{{top}}
http://www.regextester.com/
{{updated|21}}


[[category:Scraper]]
[[Category:Guides]]
[[Category:Karellen]]
[[Category:Video library]]
[[Category:First time user]]

Latest revision as of 02:06, 22 April 2024

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


Introduction

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

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

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


Naming

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

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

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


Filename identifiers

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

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

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

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

Where:

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

An example of a properly formatted filename would be:

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


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

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


TV Show Folders

Image 1- TV Show folders

Each TV Show requires its own folder in the Source folder


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


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


Split folders

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

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

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



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


Return to top