Naming video files/TV shows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Gamester17
(Updated for v20)
(226 intermediate revisions by 28 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}}
{{mininav| [[Video library]] |[[HOW-TO:Create_Video_Library|Create Video Library]] }}


== TV show support in XBMC ==
{|
|
[[image:Tv.shows.jpg|360px]]
| valign="top" |
TV show support is through new [[How To use Scrapers|scrapers]] and requires a connection to the internet.
The information gathered is stored locally in the [[Video Library]] so that it is available when you are offline. The scrapers scan your TV shows and retrieve the information about them from sites like [http://www.tv.com TV.com] and [http://TheTVDB.com TheTVDB.com].<br>
'''Note!''' you can refresh the main TV show information without rescanning all episode information by selecting ''refresh'' from the information screen and say no to the 'refresh information for all episodes' question.
|}
== TV show filenaming conventions ==
{|
| valign="top" |
The TV show lookup relies on the following naming conventions in order to work as intended.


=== Directory Structure & File Names ===
= Introduction =
The directory structure and filenames for tvshows have to be matched by the regular expressions set in [[advancedsettings.xml#.3Ctvshowmatching.3E|tvshowmatching]].
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


The defaults will match the following structures/filenames:
{{note|This page details the TV Show folder. Season folders and episodes are discussed in the following pages.}}


foo_[s01]_[e01]
= TV Show Folders =
foo.1x09*
{|
foo.s01.e01, foo.s01_e01
! scope="row" colspan="10"  style="width:300px; background-color:#; text-align:left;"|
foo.103*
! scope="row" ! |
|-
| style="background-color:#;"| [[File:Video-TVShow Folder.png|left|400px|Image 1- TV Show folders]] || style="background-color:#;"|
'''{{resize|1.3em|{{red|Each TV Show requires its own folder in the Source folder}} }}'''


Defaults for two-parters will match:
The naming of your TV Show folder is '''critical''' to ensure the scrapers can correctly identify the TV Show and its episodes.


foo_[s01]_[e01-02]
'''''TV Show Name (Year)''''' - This is the correct naming format for the TV Show folder
foo.s01.e01-02
foo.1x09 1x10


As of rev 10494, handling for multi-part episodes (twopart episodes, multiple episodes on DVD images, etc) is supported. The first matched tvshowmatching regexp and "[-EeXx]+([0-9]+)" will be repeatedly applied against a filename until no more seasons or episodes are found. This allows for filenames such as:
* The TV Show folders are saved inside the '''''[[Source_folder|Source folder]]'''''
 
* Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
foo_s01e01e02e03_s02e01e02,
* 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.  
foo104-05-06-201-02,
* '''The title and (year) displayed at the scraper site is how you should name your show.'''
foo1x07x08x09
<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)''
[[image:Wide1.jpg|right|360px]]
* '''''[https://www.thetvdb.com/ TVDB]'''''
* '''''[https://www.tvmaze.com/ TV Maze]'''''
|-
! scope="row" colspan="10"  style="width:300px; background-color:#; text-align:left;"|  
|}
|}


==== TV Show Specials ====
Special episodes are currently supported with [[TheTVDB.com (Video Library)|TheTVDB.com]] scraper.  In order for the XBMC scraper regular expressions to recognize them, they should be part of season 0. (Specials naming order can be observed in the Specials Season of the relevant TV show at [http://TheTVDB.com TheTVDB.com]).
;Example
[http://thetvdb.com/?tab=season&seriesid=76736&seasonid=24194&lid=7 Blackadder's Christmas Carol] should have a filename that matches season 0 episode 2 (e.g. contain s00e02).
==Troubleshooting TV Shows lookup==
===The scraper picks the wrong TV Show===
Try adding the year within parenthes to the end of the TV Show folder-name, (this might be need for some TV Shows such as "Doctor Who and "Knight Rider" which has multiple entries on a TV metadata database). See the exampel bellow:
\TV Shows\Battlestar Galactica (1978)\Season 1\Battlestar Galactica - S01E01.avi
\TV Shows\Battlestar Galactica (2003)\Season 1\Battlestar Galactica - S01E01.avi
\TV Shows\Doctor Who (1963)\Season 1\Doctor Who - S01E01.avi
\TV Shows\Doctor Who (2005)\Season 1\Doctor Who - S01E01.avi
\TV Shows\Knight Rider (1982)\Season 1\Knight Rider - S01E01.avi
\TV Shows\Knight Rider (2008)\Season 1\Knight Rider - S01E01.avi
=== Custom Directory Structure & File Names ===
You can make your own naming conventions / rules by adding or editing regular expressions in the [[advancedsettings.xml]] file, with the [[advancedsettings.xml#.3Ctvshowmatching.3E|tvshowmatching]] tag. When enumerating episodes for a series, XBMC '''only''' cares about the season and episode, so when designing regexps you should '''only''' be concerned with these things.


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


'''\Season #\##''' (Season# is at very end of directory name, and filename starts with episode name, neither have to be a specific number of digits) :
== Split folders ==
<xml>
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.<br>
<tvshowmatching>
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.
    <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</xml>
'''Example''' : \Battlestar Galactica\Season 3\01 - Occupation.avi (Season 3, Episode 1)


To ensure these split TV Shows are correctly scraped as the same show, you '''must''' ensure that the TV Show folder names are identical. A slight variance could see a different show scraped for the second folder.


'''###''' ([season#][episode#] with nothing in between all in filename, assumes episode number is always 2 digits) :
If using NFO Files, copy the NFO file from one location into the other split folders.
<xml>
<tvshowmatching>
    <regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp>
</tvshowmatching>
</xml>
'''Example''' : \24\Season 6\601 - 6:00am to 7:00am.avi (Season 6, Episode 1)<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)




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


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


'''##x##''' ([season#]x[episode#] all in filename :
<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>[0]*([0-9]+)x[0]*([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''' : \Scrubs\Season 1\01x01.Pilot.avi (Season 1, Episode 1)
|-
which simply strips leading 0's from the result.
| 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>


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


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


== See Also ==
{{top}}
* [[IMDb (Video Library)]]
{{updated|20}}
* http://forum.xbmc.org/showthread.php?t=25349
* http://en.wikipedia.org/wiki/Regular_expressions
* Regular Expression Testing: http://www.regextester.com/


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

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