• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 13
Beta Library Integration Tool - Automatically add videos from plugins to your library
#1
Image


Source | Repository | Donate

With Library Integration Tool, you will be able to add any movie or TV show from video plugins into your library.  These videos will show up in your library and play just like any other local file.  And to make the whole process easier, you can sync all of the videos from plugins with a single click, so new videos are automatically available to your library, and old videos videos are quietly removed.  This tool also provides you with complete control over any custom metadata you want to use for your videos added from plugins.

Library Integration Tool is currently in beta.  I've done extensive software testing to ensure this is a quality add-on, but it's not possible for me to test all systems.  If you encounter a bug, please post a description and a full debug log.  It is also recommended you maintain a backup of your managed folder in case you run into issues when updating.

Requirements
  • Kodi 17+

Installation
  1. Download this zip for the LibraryTools repository
  2. In Kodi, go to Settings --> Add-ons --> Install from zip file --> then select the downloaded zip.  After installing the repo, "Library Tools repository" will be available in Kodi.
  3. While in Add-ons, go to Install from repository --> Library Tools repository --> Program add-ons --> Select Library Integration Tool
  4. By default, the managed folder is in the addon userdata folder.  You may open the settings for Library Integration Tool if you want to choose a custom managed folder instead.
  5. Run Library Integration Tool for the first time.  You will get a message letting you know the managed folder was configured.
  6. From Kodi Settings, go to Media Settings --> Library --> Videos....  If you are using a custom managed folder, add it as a source here, otherwise add `special://userdata/addon_data/script.library.integration.tool/`.  Set content for ManagedMovies to Movies and check "Movies are in separate folders that match the movie title".  Set content for ManagedTV to TV shows.  If you plan on using your own metadata, you may want to select "Local information only".
DISCLAIMER: Do not directly edit the contents of ManagedMovies, ManagedTV, or managed.db; you need to use the Library Integration Tool menu to edit these items.

Change Log

v0.4.1 (2018-8-12)
- Fix xml parsing issue

v0.4.0 (2018-8-12)
- Allow directories to be loaded recursively
- Added recursion limit in settings
- Updating synced directories moved to background
- Added percentage to all progress windows
- Option to update only movies or tv shows
- Option to remove unused movie metadata stubs
- Option to read metadata to get episode id
- Option to skip staging for items
- Use addon folder as default managed folder
- Added setting to use custom metadata folder
- Cleaned and refactored project

v0.3.2 (2018-6-28)
- Fix crash on Windows

v0.3.1 (2018-4-28)
- remove Windows illegal characters from filename
- bugfix for incorrect sql formatting

v0.3.0 (2018-4-25)
- moved to SQLite database for performance improvements
    - .pkl files will be converted first time you run the program
- better handling of text encoding and pattern matching
- added labels to synced directories in menu
    - old directories without labels still function normally
    - re-adding synced directories will update the label
- all lists are sorted and ignore "the"
- depreceated use of blocked type "keyword"
- many more bug fixes and performance improvements

v0.2.2 (2018-1-28)
- add setting to use tvshow artwork when episode thumb is unavailable
- better file name handling when "Part #" is in episode name
- use universal fs module when on unrecognized platform

v0.2.1 (2018-1-25)
- fix for items with quotes in name
- fix for renaming thumbnails for episodes

v0.2.0 (2018-1-24)
- Windows support
- new icon
- check if managed directory exists when first called
- various improvements

v0.1.0 (2018-1-22)
- Initial release
Reply
#2
User Guide

Image Image

Tutorial - Staging Items

To start using this add-on, you need to begin adding content from a video plugin. Crackle (in the Kodi Add-on repository) provides a ton of free content, so let's start there. Open Crackle, then select and click Movies. From the context menu, you can select "Add selected item to library" or "Sync directory to library". If you choose to sync the directory, new movies that are added to Crackle will automatically become available to your library, and unavailable movies will be removed. Select this option, and it will "stage" all the movies in this list.

Return to the top level of Crackle, and select TV. Scroll down to "Seinfeld" and choose "Add selected item to library". It may ask you to choose the content type, which should be "TV Show". Library Integration Tool will load all of the episodes and add them to staging. Now that we have selected movies and TV shows to add to the library, return to Program Add-ons and run Library Integration Tool.

Tutorial - Adding Items to the Library

Running Library Integration Tool will open the main menu where you can view all of your staged and managed media, as well as synced directories and blocked items. Select "View Staged Movies" to see all of the movies in the directory you just synced from Crackle. You can select any item in the list to see available actions, or you can scroll to the bottom of the list to perform an action on all items.

If you have your ManagedMovies folder set to use an online scraper, you may want to go to the bottom of the list and choose "Add all movies". This action will move all of the movies from "Staged" to "Managed" and create the appropriate folders and .strm files necessary for Kodi to recognize them. After adding any staged media to managed, don't forget to "Update Library" from the main menu (or from Kodi settings).

Tutorial - Using Metadata

You may be tempted to immediately add all the Seinfeld episodes like you did for the movies, however there is an issue with the episodes we got from Crackle: none of them have episode numbers! Because Kodi and scrapers can't recognize episodes that don't have an episode number in the file name, the tool won't move any of these episodes to managed. To fix this issue, we have two options...

1) Renaming episodes within Library Integration Tool

The first option is to select each episode, click "Rename", and include the correct episode id at the beginning of the file. For example, if "The Busboy" is in your list, you can rename it to "02x12 - The Busboy" or "S02E12 - The Busboy". Now you will be able to add the item to your library.

2) Using an external media manager

The second option is to use a media manager to generate .nfo files for each of the episodes. In order to make the staged items visible to media managers, click on "Generate all metadata items" while viewing the Seinfeld episodes. This will generate a folder for Seinfeld in Metadata/TV/ and populate it with empty files, and the titles will be appended by '-0x0'. This tag is so the media manager will recognize the file as an episode.

Have your favorite media manager (MediaElch works great) scan the Metadata/TV/ directory. It will find all the items that have generated metadata items. Now, you can create .nfo files and download artwork automatically for every episode and tvshow. Once you've gotten .nfo files saved with the correct episode numbers, you are ready to add the episodes.

In Library Integration Tool, you can select "Add all episodes" or "Add all episodes with metadata". Both options will automatically rename the episodes using the episode number in their .nfo files, but you can also select "Automatically rename using metadata" on an episode to test it first. Now, all of your Seinfeld episodes from Crackle (with their metadata) are in the library. Don't forget to update!

Note: Do NOT rename files directly in the Metadata folder; you must use the built-in rename tool or .nfo files.

Tutorial - Updating Directories

Now that you've added this content from Crackle to your library, you can continue to add movies and TV shows from all of your favorite plugins. Refer to the list at the bottom of the README for several suggested addons that work well with Library Integration Tool. However, after you've been using this add-on for a while, the availability of streamed content may change.

To quickly update your directories, open "View Synced Directories" from the main menu and choose "Update all" at the bottom of the list. This action will reload all synced directories and automatically find old managed and staged items that have become unavailable, and new items to stage. Depending on how many directories need to be loaded, and which plugins you use, this may take a while. Once the tool is done loading all the items, it will ask for your confirmation before proceeding.

After the directories are updated, you can review and add your staged items. And remember to clean and/or update your library!

Tutorial - Blocking Items

After updating, you may notice that you already have a local copy of one of the new staged movies. Rather than just removing it from staged movies, you should consider blocking it. If you block an item, it will not be automatically re-staged when updating directories again.

From "View Staged Movies", select the movie you already have. Choose the option "Remove and block". You can block episodes and entire TV shows as well. Keep in mind that any metadata files you've generated for items you block will be deleted from the Metadata folder.

Sometimes when you sync a directory, items may show up that aren't actually videos. For example, Popcornflix includes items called "Next Page", which will also be added to staged movies. You can block these like you would for normal content. And if you change your mind later, you can select any blocked item from the list and choose "Remove".

Tutorial - Settings

You can customize the behavior of this addon from the settings.  The following options can be changed:

General
Use custom managed folder - Lets you select a custom managed folder instead of the default addon userdata folder.  This folder may be used by multiple Kodi instances. Sharing a managed folder between Windows and non-Windows computers is not recommended.
Use custom metadata folder - Lets you select a custom metadata folder, instead of creating a Metadata subfolder in the managed folder.  This folder may be used by multiple Kodi instances. Sharing a metadata folder between Windows and non-Windows computers is not recommended.
Max recursion when finding videos - Some plugins have content spread across multiple pages.  This setting specifies how many pages should be loaded before stopping.  Use a value of 0 to load all pages.

Movies
Add movies without staging - By default, all new synced movies will be moved to staging.  This option allows you to automatically add movies directly to the library.  There is also an option to only automatically add movies that already have metadata.

TV Shows
Add TV show items without staging - By default, all new synced TV show items will be moved to staging.  This option allows TV show items with properly formatted episode IDs to be automatically added to the library.  There is also an option to only add automatically TV show items that already have metadata.
Use TV show artwork if episode thumb is unavailable - Kodi can't create thumbnails from stream files, so this option will allow the addon to attempt copying the TV show thumb/fanart instead if an episode thumb isn't available.

Development
Enable development options - Keep this option disabled, as it may slow down the addon.

Recommended Addons

Video Plugins
  • ABC Family by t1m - Seems to be broken at the moment
  • Classic Cinema by Jonathan Beluch (jbel)
  • Cooking Channel by t1m
  • Comedy Central by Lunatixz - Great content and all videos have correct episode numbers
  • Crackle by eracknaphobia
  • DIY Network by t1m
  • Food Network by t1m
  • HGTV by t1m
  • Pluto.tv by Lunatixz - Add individual OnDemand movie channels as directories
  • Popcornflix by t1m - Lots of content, but most have low ratings and the lists constantly change
  • Travel Channel by t1m
  • TV Land by Lunatixz - Double check episode numbers before scraping
  • WABC Programs by t1m - Do not sync entire directory due to infinite load times for some items, but works well with individual TV shows
  • WNBC Programs by t1m - Huge amount of content, but slow to update

Other Addons

Skin Helper Service Widgets BETA by marcelveldt - The latest versions include a new recommendation system that dynamically shows you personalized content on your homescreen. So if you decide to add every possible directory and end up with 4000+ new items in your library, this addon will help ensure you only see the most relevant titles

WatchedList by schapplm - Because you'll potentially remove and re-add streamed content several times with Library Integration Tool, WatchedList makes your watched status persistent by storing it in an independent database
Reply
#3
Thanks for the contribution, if there is an issue regarding episode numbering in any of my plug-ins; simply post your concerns in the proper thread.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#4
I edited the wording in case it came across as criticism before.  I doubt it's an issue with your addon, I looked at the urls and it just looks like the episode numbers TV Land provides usually don't match up with TheTVDB.  Regardless, I appreciate the fact your addon includes the episode number in title.
Reply
#5
I added your repo but it seems to be empty?

I tried downloading the addon from github and install it from the zip file, but Kodi says it's has the wrong addon structure. I also tried adding it manually into the addon directory but it still won't show up in Kodi. Any suggestions?

I'm running Kodi 18 nightly on Windows 10.
Reply
#6
Check my post again, your system doesn't meet the requirements.  It's only supported on Mac & Linux.
Reply
#7
Oops, sorry... Sad

Do you have any plans for Windows support later down the line?
Reply
#8
No worries :)

The issue is the addon relies on system commands through BASH to manage the folders and stream files.  Managing the metadata also requires symlinks, which just aren't available on Windows.  Unfortunately I don't have enough experience with Windows to develop alternatives, so I won't be able to add that functionality on that platform.

However,  I do plan on making my code more modular soon, which would make it much easier for someone else to add Windows support.  I'll definitely make an announcement when that is ready!


Edit: Just added Windows support, it was easier than I thought to do everything in Python
Reply
#9
Just pushed version 0.2.0 to the repo, which adds support for Windows!

If you're on Windows, the program will use OS-independent Python commands instead of system commands.  The only downside is your custom metadata will be copied instead of using symlinks.
Reply
#10
I installed the tool, I can see what is added to the staged area.  When I go from staged page and select add all movies, or add all TV shows, all that shows when I look at the managed section is they are empty.  I reall like the concept of the tool and I want to use it very much.  Can you help me to get it to work.

I am running Kodi 17.6 on a windows 10 computer

Thanks
Reply
#11
I grabbed the repo from your link above, and it is only v1.0  Do U have a newer version of the tool? and if you do how do I get it
Reply
#12
When you say .strm files aren't automatically marked as watched by Kodi, if the trakt app was installed, would that scrobble fine to be marked as watched?

Also, there has been a lot of work on KN with OSMOSIS, if there are any features you could bring over. Dandy also released a strm generator.
Reply
#13
Osmosis is a poorly written script based on a fork of my code written years ago. Trust me when I say this project is well written, and the best strm utility currently available to Kodi...

As for stop actions, strms are not treated as media, but rather a playlist...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#14
(2018-03-27, 18:34)Lunatixz Wrote: Osmosis is a poorly written script based on a fork of my code written years ago. Trust me when I say this project is well written, and the best strm utility currently available to Kodi...

As for stop actions, strms are not treated as media, but rather a playlist...
 Awesome! Thanks for the quick reply.

https://github.com/xbmc/xbmc/pull/13566

I was keeping up with this a bit, could this assist this addon to make it better for kodi 18, maybe so it acts as media?
Reply
#15
No, when I say its treated like a playlist... I mean to say currently Kodis core player treats it like that... no amount of metadata can change this.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 13

Logout Mark Read Team Forum Stats Members Help
Library Integration Tool - Automatically add videos from plugins to your library0