fracpete / kodi-nfo-generator

Simple Python-based command-line tool to generate .nfo files for movies and TV series used by Kodi.
GNU General Public License v3.0
45 stars 8 forks source link

Add support for TV Shows #1

Closed z-vap closed 1 year ago

z-vap commented 3 years ago

I would love if there was support added for television shows. Airdate and DVD order choices. Thanks for a great tool

fracpete commented 3 years ago

NFO for episodes: https://kodi.wiki/view/NFO_files/Episodes

The Expanse URL: https://www.imdb.com/title/tt3230854/

Whether episodes are available: <a href="episodes/?ref_=tt_ov_epl" ...

The URL for overview of seasons (append /episodes/ to URL): https://www.imdb.com/title/tt3230854/episodes/ The season numbers are available from select with id bySeason

The URL for season 1: https://www.imdb.com/title/tt3230854/episodes?season=1

Details:

Example XML:

<episodedetails>
  <title>Dulcinea</title>
  <plot>In the asteroid belt near Saturn, James Holden and the crew of the ice freighter Canterbury, on its way to Ceres Station, investigate a distress call from an unknown derelict ship, the Scopuli.</plot>
  <uniqueid type="imdb" default="true">tt3982200</uniqueid>
  <aired>2015-11-23</aired>
  <season>1</season>  <!-- unused, only for info; kodi uses filename S01E01 -->
  <episode>1</episode>  <!-- unused, only for info; kodi uses filename S01E01 -->
  <ratings>
    <rating name="imdb" max="10" default="true">
       <value>7.7</value>
       <votes>4512</votes>
    </rating>
  </ratings>
</episodedetails>
fracpete commented 3 years ago

Added experimental support with 0edd4fbb7306236662e8939234d20bd965475cb2

IronBlood commented 2 years ago

According to https://kodi.wiki/view/NFO_files/TV_shows

NFO files for TV Shows are a little bit more complex as they require the following NFO files:

  • One nfo file for the TV Show. This file holds the overall TV show information
  • One nfo file for each Episode. This file holds information specific to that episode

For one TV Show with 10 episodes, 11 nfo files are required.

An extra tvshow.nfo is needed, it looks like this

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<tvshow>
    <title></title>
    <plot></plot>
    <userrating></userrating>
    <mpaa></mpaa>
    <uniqueid type="" default="true"></uniqueid>  <!-- add a value to type="" eg imdb, tmdb, home, sport, docu, see sample below -->
    <genre></genre>
    <premiered></premiered> <!-- yyyy-mm-dd -->
    <status></status>
    <studio></studio>
    <actor>
        <name></name>
        <role></role>
        <order></order>
        <thumb></thumb>
    </actor>
    <namedseason number="1"></namedseason>
</tvshow>
IronBlood commented 2 years ago

Sorry for another update, it took me a while to figure out how it works according to https://kodi.wiki/view/Naming_video_files/TV_shows

I guess the input and output should be like this:

Input

The imdb url or simply the id of the series, e.g. tt4786824 for The Crown (2016– ).

Output

The Crown (2016– )
├── Season 1
│   ├── The Crown (2016– ) S01E01.mkv
│   ├── The Crown (2016– ) S01E01.nfo
│   └── ......
├── Season 2
├── Season 3
├── Season 4
└── tvshow.nfo

Kodi has its critical way to ensure the scrapers can correctly identify the TV Show and its episodes, so the good news is that the output is almost predictable, but the bad news might be, we can't reuse the *.imdb files.

fracpete commented 2 years ago

Thanks for that. I don't use episode information myself. But we should be able to still use the *.imdb files, since we can tell from the website whether there are episodes present or not. That way we can simply toggle between movie/tv show output. Will look into it in the near future.

dejudicibus commented 2 years ago

You developed a great project. Any plan to have TV series support? Just consider that folder structure is usually

SeriesName |- Season01 |- Season02 |- Season03 ...

IronBlood commented 2 years ago

@dejudicibus I wrote a commandline tool during the weekend, but haven't finished the README part. I'll put the source here https://github.com/IronBlood/kodi-tvshow-nfo-generator

fracpete commented 1 year ago

OK, that's taken me while to get back to, but it think commit b30b57b83d21233c38ca69cfe1a32262157ba5d9 solves it now.