Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Kodi-Addon - API V1+V2] The Sports Database Python
#1
Project Kodi - The Sports Database Python
metadata.thesportsdb.python - Version 1.1.8 for Kodi 21 (Omega) and Kodi 22 (Piers)

Download: Use the Project Kodi Repository in Kodi: https://project-kodi.github.io/ or Project Kodi Repository
Direct download of the repository (but then no auto update): repository.project.kodi
Direct download of the add-on: The Sports Database Python - metadata.thesportsdb.python V.1.1.8.zip
Example files: Example files for naming.zip (or use the NFO Generator)

Tip: Supports local, SMB and NFS paths including SQL databases in Kodi. For large environments where 1 server provides the video database, texture database and thumbnail folder for all clients: use the texturecache utility in exe/python/kodi/exe-gui version to cache the series and actors immediately on the server [tvshow and artists]: https://github.com/Project-Kodi/texturecache.py
This scraper can also create NFO files, save artwork locally, rename videos without SxxEyy and show missing events, upcoming events and the latest results of your leagues!

What's new in 1.1.8
  • Rewritten for Kodi 21 and Kodi 22 - many bugs of 1.1.7 fixed, your settings of 1.1.7 are kept.
  • API V2 only with the built-in premium key, faster with a cache, automatic waiting at the API limit.
  • Results, match details (kick-off, venue, round, TV, referee, spectators), race results and lineups in the description - with spoiler protection.
  • Lineups as cast (with player cutouts / renders), race results with position, teams with badge.
  • More artwork: clearlogo, clearart, landscape, character art, season posters, episode poster / banner / square / map.
  • Videos without SxxEyy are found by date + teams.
  • NFO files: read them ("NFO first") or keep them up to date ("Update from TheSportsDB").
  • New tools and a context menu in the library.
  • New settings for the look of the description, the numbering and the season names.

Documentation
  • Add-on download and installation
  • Folder and file names
  • Add-on settings
  • Tools and context menu
  • Add-on using
  • Examples after scraping


Add-on Download and Installation

1. Install - Project Kodi Repository
  • Go to the Kodi file manager.
  • Click on "Add source".
  • The path for the source is: https://Project-Kodi.github.io/ (give it the name "Project Kodi Repository").
  • Go to "Add-ons".
  • Choose "Install from zip file". When it asks for the location, select "Project Kodi Repository" and install repository.project.kodi-1.0.1.zip.
  • Now the repository is available in Kodi.
  • Turn on automatic updating: go to "Add-ons", select "My add-ons", then "Add-on repository", select "Project Kodi Repository" and activate "Auto update".

[Image: software12.jpg]

2. Install - The Sports Database Python
  • Go to "Add-ons", select "Install from repository".
  • Select the "Project Kodi Repository".
  • Go to "Information providers", "TV information" and choose "The Sports Database Python".
Or without the repository: "Add-ons" > "Install from zip file" > metadata.thesportsdb.python V.1.1.8.zip

[Image: addon01.jpg]

3. Set up your sports folder
  • Videos > Files > Add videos > your sports folder.
  • This directory contains: TV shows.
  • Information provider: The Sports Database Python.
  • Optional: "Settings" of the provider only for this folder (e.g. another language or numbering).

Update from 1.1.7: just install the update - the settings stay. You do not need a new library. For new data (results, lineups, artwork) select the league in the library > "Refresh" or use "Update library".


Folder and file names

Code:
Sports/                                   <- source, content type "TV shows"
  English Premier League/                 <- league = TV show (name or "Name [tsdb-4328]")
    Season 2023-2024/
      English Premier League 2023-08-11 Burnley vs Manchester City.S2023E1.mkv
  • League: one folder per league. The league is found by its name, alternate names or by its id in the folder name: "Formula 1 [tsdb-4370]" or "Formula 1 {tsdb=4370}" (always the right league, no search).
  • Season = first year of the season (2023-2024 => S2023).
  • Episode = position of the event in the season on TheSportsDB (1, 2, 3 ...). The same numbering as the NFO Generator and the Plex plugin.
  • Files with only a date (NFL.2021-09-12.Atlanta.Falcons.vs.Philadelphia.Eagles.mkv): Kodi finds them by the date when there is one event on that day. Otherwise use the tool "Rename videos without SxxEyy" - it finds the event by date + teams and adds S2021E1.
  • The NFO Generator creates the folders, file names and NFO files for whole seasons.


Add-on Settings
Settings marked (expert) are only visible with the settings level "Expert" (button at the bottom left of the settings).

Add-on Settings - General

- Language
Preferred language (fallback English): titles, descriptions and other texts are retrieved in this language. If TheSportsDB has no text in this language, the English text is used. "Kodi language" (default) uses the language of the Kodi interface.

- Recognition
Use the league id in the folder name: a folder like "Formula 1 [tsdb-4370]" is matched directly to this league.
Search only in this sport: limits the league search, e.g. to Soccer.

- Seasons and numbering
Episode numbering: Per season (S2023E1) = like the NFO Generator, or Absolute (one season) = all events in one season, numbered 1, 2, 3 ... over all seasons.
Season number for the absolute numbering: default 1.
Season name before the season: empty = the seasons are called "2023-2024", with "Season" they are called "Season 2023-2024".

- TheSportsDB API
Own API key: if you are a supporter of TheSportsDB.com you can enter your own key. This is not necessary - a premium key is already built in.
Max. API calls per minute: TheSportsDB allows 100 calls per minute (default 95). After an "API limit" answer the add-on waits automatically and continues.
Extra pause per API call (expert): normally 0, only for slow devices.

[Image: addon02.jpg]

Add-on Settings - Episodes

- Episode title
Episode title: Event (Arsenal vs Chelsea) | Event - date (Arsenal vs Chelsea - Sat 12 Aug) | Date - event | Round - event | Event with score (spoiler!).
Leagues without changed title: for these leagues the title is always only the event. Example: Formula 1, Copa America, French Ligue 1
Tip: if a league is not shown correctly with a changed title, add it to this list.

- Description
Show results in the description: score, result and winner (race results with the top 10).
Spoiler protection: hides scores and results everywhere (description, title, tools).
Hide results only for events of the last days: e.g. 7 = results of the last week stay hidden, older results are shown. 0 = always hidden.
Show match details: kick-off, venue, round, TV station, referee, spectators, status.
Show the lineup in the description.
Description from the event name if TheSportsDB has none.

- Look of the description
Headings: Bold, Bold and colored (gold, sky blue, green, orange, red, white) or Plain text (for skins that show the formatting codes).
Order: Description, result, details or Result, details, description (scoreboard style).

- More information
TV station as studio of the episode.
Referee as director of the episode: Kodi then lists all matches of a referee (Videos > Directors).
Country of the venue as country of the episode.

- Players / cast
Episode cast: None | Only the teams | Lineup + teams (default; races / fights: the results with position P1, P2 ...) | Lineup, else both squads + teams.
Player photo: Cutout | Action render | Photo.
Max. players per episode: default 40.
Tags for teams, round and venue: smart playlists like "all matches of Arsenal".
Teams of the league as cast of the TV show (with badge).

- Highlights / trailer
Highlights video as trailer: the YouTube highlights of TheSportsDB are played with the YouTube or Tubed add-on.

Add-on Settings - Artwork

- League (TV show)
Clearlogo, clearart (badge), landscape, keyart.
Trophy as extra fanart.

- Seasons
League poster for every season: off = the season posters of TheSportsDB, the league poster only for seasons without one. On = the league poster for all seasons.
Tip: not every season has a poster on TheSportsDB yet - please upload season posters to thesportsdb.com.

- Episodes
Episode image: Thumb (else fanart / league fanart) | Fanart (else thumb) | Poster (portrait).
Poster, banner, square poster and map for episodes.

- Player art
Player art as character art of the league: one player per team.
Player art version: Player action render (players in motion) or Player cutout (from the front).
Max. player images: default 10.

Add-on Settings - NFO & export

- Existing NFO files
Use existing NFO files:
NFO first (offline): Kodi uses the data of the NFO files (fast, offline, e.g. packages of the NFO Generator). TheSportsDB only fills what is missing.
Update from TheSportsDB: the league is found with the NFO, the add-on writes new NFO files with the current data after every library update, and Kodi reads them.
The league is found in the NFO with: <uniqueid type="tsdb">4328</uniqueid>, <tsdb>4328</tsdb>, <episodeguide>{"tsdb":"4328"}</episodeguide>, {tsdb:4328} or a thesportsdb.com link.
Search by title even if the NFO has a TheSportsDB id (expert, old option).

- Write NFO files
Write NFO files (export): tvshow.nfo, season.nfo and one NFO per episode in the Kodi format of the NFO Generator (Kodi wiki). The season.nfo also gets a summary like "38 events from 2023-08-11 to 2024-05-19".
Overwrite existing NFO files.
Save in the TV show / season / episode folder, or choose your own folder (any path, any operating system).
NFO file name TV show: tvshow.nfo or (tvshowfoldername).nfo.
NFO file name season: season.nfo in the season folder or seasonXX.nfo in the TV show folder.
Artwork links in the NFO files.

- Automatic export
Export NFO + artwork files after every library update (in the background, for all leagues of this add-on).
Notification when the export is finished.
Progress bar in the background during the export.

[Image: addon03.jpg]

[Image: addon04.jpg]

Add-on Settings - Artwork files

- League folder
Download poster, fanart (up to 4), banner, clearlogo, badge (clearart), trophy - each with the file name poster.jpg or (tvshowfoldername)-poster.jpg etc.

- Seasons
Download season posters: season2023-poster.jpg in the season folder or in the TV show folder.

- Episode files (next to the video)
Download thumb, poster, fanart, banner, square poster, map: (episodefilename)-thumb.jpg, -poster.jpg, -fanart.jpg, -banner.jpg, -squareposter.jpg, -map.jpg.

- Player art files
Download player art (max. 10 images): characterart.png - characterart9.png or (tvshowfoldername)-characterart.png ...
Overwrite existing image files.


[Image: addon06.jpg]

[Image: addon07.jpg]

[Image: addon07-1.jpg]

Add-on Settings - Logging & support

- Logging
Verbose logging: many details in the normal Kodi log. In normal operation this should be off.
Log every API answer (expert): very large log! Only for support.

- Tools
Upcoming events: days ahead (default 14).
Latest results: days back (default 7).
Missing events: only events that already took place / also seasons without any video.

- Cache
Keep TheSportsDB data (hours): default 24. Finished seasons are kept 30 days, the league list 7 days.
Clear the cache now.

- Support
Open the tools. Help.

[Image: addon08.jpg]


Tools and context menu

Tools: Add-ons > My add-ons > Information providers > TV information > The Sports Database Python > Run
Context menu: in the library press the context menu on a league, season or episode > TheSportsDB tools
  • Export NFO + artwork files: all leagues / choose a league - for the leagues in your Kodi library (local, SMB and NFS paths).
  • Create NFO files for a folder - for new folders before you add them to the library, also for files without SxxEyy.
  • Rename videos without SxxEyy - finds the event by date + teams, shows a preview and renames the video together with its NFO, subtitle and image files.
  • Missing events of a league - which events of your seasons are not in the library, with the right file name for each one.
  • Upcoming events of my leagues - calendar of the next days with time (your time zone), round and TV station.
  • Latest results of my leagues - results of the last days (respects the spoiler protection).
  • League information - seasons, number of events, season posters, artwork and the folder name with the league id.
  • Statistics - leagues and videos in the library, cache size, API calls.
  • Test the TheSportsDB API, clear the cache, help, settings.
In the context menu the tools work directly for the selected league: export this league, missing events, upcoming events, latest results, league info.


Add-on using

Kodi default skin - TV show view: League Widelist, Wall, Shift, Poster, List, Infowall, Fanart, Banner

Leage Wideist:
[Image: addon_view_league_widelist.jpg]

Leage Wall:
[Image: addon_view_league_wall.jpg]

League Shift:
[Image: addon_view_league_shift.jpg]

League Poster:
[Image: addon_view_league_poster.jpg]

League List:
[Image: addon_view_league_list.jpg]

League Infowall:
[Image: addon_view_league_infowall.jpg]

League Fanart:
[Image: addon_view_league_fanart.jpg]

League Banner:
[Image: addon_view_league_banner.jpg]

Kodi default skin - season view: Season Widelist, Wall, Shift, Poster, List, Infowall, Fanart

Season Widelist:
[Image: addon_view_season_widelist.jpg]

Season Wall:
[Image: addon_view_season_wall.jpg]

Season Shift:
[Image: addon_view_season_shift.jpg]

Season Poster:
[Image: addon_view_season_poster.jpg]

Season List:
[Image: addon_view_season_list.jpg]

Season Infowall:
[Image: addon_view_season_infowall.jpg]

Season Fanart:
[Image: addon_view_season_fanart.jpg]

Kodi default skin - episode view: Episode Widelist, Wall, Infowall

Episode Widelist:
[Image: addon_view_episode_widelist.jpg]

Episode Wall:
[Image: addon_view_episode_wall.jpg]

Episode Infowall:
[Image: addon_view_episode_infowall.jpg]

Kodi default skin - actor view: players and teams of a league; which episodes do I have with this player?

Actor, view from more information in league:

[Image: addon_view_actor01.jpg]

Actor, same view, which episodes do I have with these player?
[Image: addon_view_actor02.jpg]

Actor, same view, get all player from this league:
[Image: addon_view_actor03.jpg]

Tip: with "Tags for teams" you can make a smart playlist "Tag is Team: Arsenal" = all matches of your team. With "Referee as director" you find all matches of a referee under Videos > Directors.


Examples after scraping
English Premier League: (season poster in root)
NFL: (season poster in season folder)

English Premier League: (season poster in root)
[Image: addon_season_folder01.jpg]

NFL: (season poster in season folder)
[Image: addon_season_folder02.jpg]

Example files as ZIP after scraping / example NFO file after scraping:

[Image: addon_example_files01.jpg]

Exampe NFO file, show UFC - after scrapping: (Feature is still being improved. You see the local NFO version here.)
[Image: addon_example_nfo01.jpg]

- Thank you for reading! You can find me on Discord!
- Support: Support thread or Discord.
- Thanks also to ZAG, the operator of thesportsdb.com, which supports all Kodi and Plex users with its data. Helping hands are always needed for content creation - visit the Discord channel: https://discord.gg/pFvgaXV
- Support us on Patreon: patreon.com/ProjectKodi
- Source and documentation: GitHub Project Kodi

Not all screenshots are up to date; I will provide them later.

Note: Use the texturecache utility in exe/python/kodi/exe-gui version to cache the series and actors immediately [tvshow and artists]: https://github.com/Project-Kodi/texturecache.py
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)