MediaBrowser.Naming - A Kodi file parsing library
#1
This is a developer library designed to parse file names into objects with metadata describing the file. As part of the Media Browser project, we are aiming to support as many Kodi conventions as possible.

This isn't really an scraper but this is the most relevant section of the forum to put it in. The goal of this project is to create a managed library that supports the entire Kodi feature set in terms of naming movies, tv, music, and other file types. It will be unit tested and available on Nuget for other applications to utilize.

It will also support all of the configuration that is available in Kodi's advancedsettings.xml. You simply create options objects and you can configure various things such as file extensions, regex expressions, etc.

Github:
https://github.com/MediaBrowser/MediaBrowser.Naming


Nuget:
https://www.nuget.org/packages/MediaBrowser.Naming


Features:
  • Parse video directories into objects containing metadata that can be determined from the file names
  • For movies, extract the name, year, language, 3d format, multi-part info and quality level
  • For episodes, extract all of the above plus episode numbers
  • For subtitle files, extract the language, default and forced flags
  • Support all Kodi movie naming feaures: http://kodi.wiki/view/Naming_video_files/Movies
  • Support all Kodi tv naming features: http://kodi.wiki/view/Naming_video_files/TV_shows
  • The consumer should be able to configure all features in the same way Kodi parsing can be configured, e.g. no fixed, hard-coded algorithms
  • Extract extra files, e.g. trailers, theme songs, etc.
  • Determine the relationship between files, e.g. movie has three parts, three subtitle files, three extra videos
  • Support optional, injectable logging to write to the consumer's logging system
  • Unit tests

Anybody who would like to contribute or use the library is welcome to do so. Thanks.

Usage:


Code:
// Developers are encouraged to create their own ILogger implementation
var logger = new NullLogger();

// VideoOptions is based on Kodi wiki documentation
// ExpandedVideoOptions includes newly introduced Media Browser features
var options = new VideoOptions();

var result = new VideoResolver(options, logger).ResolveFile(file);



The result object will then have a number of properties, including:
  • Path
  • Container (mkv, ts, etc)
  • Name
  • Year
  • ExtraType (trailer, themesong, etc)
  • Is3D
  • Format3D (hsbs, fsbs, etc)
  • IsStub
  • StubType (dvd, hddvd, bluray, etc)

Different parts of the algorithm can be used separately as needed via the following classes:
  • CleanDateTimeParser
  • CleanStringParser
  • ExtraTypeParser
  • Format3DParser
  • StackResolver
  • StubResolver

See the unit tests for samples.

Status:

Parsing a single video file is done. Need to be able to parse a directory to determine groupings and relationships. TV and music also need to be done.
Reply

Logout Mark Read Team Forum Stats Members Help
MediaBrowser.Naming - A Kodi file parsing library0