Kodi Community Forum

Full Version: [RELEASE] Tag Generator (IMDb, Trakt, Oscars + Stand-up)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
This addon searches chosen IMDb and Trakt watchlists then writes tags locally for matching entries in your database. This requirement came about because my partner wanted to see only her movies in a dynamic list, and since we use IMDb, their lists were an obvious choice. It will take up to 5 URLs in various IMDb formats (watch lists, events, top250 etc), and up to 5 Trakt lists. The list limit can be extended without too much effort - see comments below.

For Trakt, you can add lists from your own account, from public accounts, or shared lists from anyone you are friends with (people you follow, who follow you back). Trakt requires you to get a token from Trakt.tv by entering a pin code into this application. The pin code grants you an oauth token, which you use to interact with their API. It's simpler than it sounds; follow the on-screen prompts for more info.

As an added bonus it also creates tags for Stand-up comedy. No such genre exists today, and I don't want comedy movies next to stand-up DVDs when browsing by genre. The comedians list comes from the wiki standup comic lists for UK, US, Canadian, Australian and international comedians. If you want someone to match that isn't there, just add them to one of these wiki lists and trigger a manual generation.

Oscar tagging lets you tag winners and/or nominees with each award for each movie in the following format 'Oscar Winner: Best Motion Picture', 'Oscar Nominee: Best Supporting Actor'. Credit for the idea and initial implementation goes to Jorge: https://github.com/bluesauce

The current release only works on Krypton (use older versions for Frodo/Gotham). Tested on linux and windows up to Kodi 17, the script runs as a service at a configurable time interval.

Available in the Kodi repo under Addons/Services.
Download 0.6 here, 0.5 here, 0.4 here, 0.3 here, or 0.2 here. 0.1 still available for those who are not yet on Frodo. Get it here.

With the new Trakt functionality I received openssl errors when testing on linux. If this happens to you, ensure that your ssl module is up to date:
Code:
pip install --upgrade pyopenssl
If that fails, ensure you've got the build tools:
Code:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev

Final note on Trakt: the docs suggest that these tokens expire after 3 months. If that happens just request a new code from the options page.

For those using the IMDb RSS URLs, it seems that rss.imdb.com now has an invalid certificate (which will cause an exception in my request; by design). Use http://rss.imdb.com, or https://www.imdb.com

########## v0.6 ############################
# Added Oscar award/nominee tagging (inspired by Jorge: https://github.com/bluesauce)
# Updated regex to support IMDb lists of all types (Top250, Academy Awards, Sundance etc)
# Added notifications (can be disabled in Settings)
# Service interval now relies on local machine time
# Fixed bug that prevented service from exiting cleanly in some situations
# Trakt token in settings is now read-only
# Replaced urllib2 with requests
# Code cleanup (a lot of string IDs have changed)
########## v0.5 ############################
# added Trakt support for 2.0 API (depends on PyTrakt by Jon Nappi, included in this release). PyTrakt repo, Pytrakt docs.
# Trakt lists for multiple users. Lists of other users need to be public, or shared by your friends.
# code cleanup and text amendments
# wikipedia URLs updated
# Kodi 17 adjustments (addon.xml, folder structure, etc)
# Removed inline dependencies in 0.5.1
# Corrected oauth version number in 0.5.2
########## v0.4 ############################
# Kodi support (14 and 15)
# IMDB lists now in RSS format.
# removed trakt (other addons do this now)
# removed music
########## v0.3 ############################
# Added Trakt support for movie watchlist and custom watchlists
# Custom Trakt lists are tagged by their name
# Added debug mode
# Made a pretty icon
# code cleanup and speed tweaks
########## v0.2 ############################
# Uses JSON to write the tags so now it's much more portable.
# Should work for people using MySQL just fine.
# MUCH better progress updates, logging and error checking.
# Writes tags instead of playlists - much more flexible
# Preserves existing tags and only writes as needed
# New feature - much slower! That's just how JSON rolls I'm afraid.
# Background music (to comfort you while you wait)
# Uses the xbmc "label" to make a match (no more folder name dependence)
# Option to wipe all your tags if you want to start from scratch
##########################################################
TODO:
* Python3 refactor
* Investigate RunScript deprecation
* Handle and retry IMDb awards timeouts for large libaries

Image
Image
Image
Image
Image
Image
hey i'm receiving the error service.playlist-generator 01 . do you know how i can get this to work?
i got it to work by restarting it but now it says that everything is successful and that it put 24 movies in my playlist but there isn't any in the created playlist.
Sorry for answering most of my questions. but i think i found the problem, it is looking for paths and in the path it has the file name so its not finding anything usefull. i think it's because all of my movies are all in the same folder instead of each being in individual folders. i'm wandering if there is a way to modify the script so that it finds the file name only and in the smart playlist it would change it from path to file?
any chance of getting this working for mysql installations?
Thank you for this smashing generator!

It seems like the generator only works for the main watchlist, when trying with an public "custom list" i get an error message.

Would it be possible to compare two of the playlists (say mine and my wifes) and to generate a list with movies that are in XBMC that appears in both of the playlists. This would then be a list of movies that both my wife and I want to see.

Very cool to see that others enjoyed this functionality too! I've just changed job so things are a bit too intense to sit down and code at the moment, but here are some quick answers:

@xtremeshow:
- you're correct, the script is looking for folder names, as file names are frequently meaningless. The assumption was that if XBMC movie scrapers couldn't resolve the name from the file (as in my case - my filenames are garbage) then my script wouldn't stand a chance. I could change the behaviour quite easily and add a radio button in the options screen.

@akuiraz
- That's coming up next - I've gone to my own sql setup too.

@SirClayman
- theoretically possible, sure. Hadn't thought about that. Maybe better with smart playlists in Frodo.

----

The plan was actually to wait for Frodo before making any updates. This script really exists due to a lack of customisable tags in the v11 database. If we could programmatically tag our movies with "Jim's IMDB" and "Janet's IMDB" then a simple smart playlist requiring both of those criteria would present the movies appearing in both (as in SirClayman's example).
Finally got a quiet moment in the new job - 0.2 released.

@xtremeshow:
now it looks for the 'label' field in the XBMC database

@akuiraz:
fixed - 0.2 uses JSON, so it doesn't matter what the backend DB is hosted with.

@SirClayman
please post some example URLs. I can update the regex. Your other wish has been granted: With tags instead of playlists you have the ability to create any playlist you like based on the new metadata.
I see you have trakt as a potential future feature. What I see even more exciting than the trakt watchlist, would be to create tags for the "trakt personal lists". Ideally, I wouldn't need to create a separate URL entry for all my 10 trakt lists, but just add it once and get different tags based on the name of the trakt list.

Any chance? Thanks for considering!
Shouldn't be too hard - trakt has an API for this sort of thing. I was thinking that you'd have to punch in your username and password, but no URLs.
(2013-05-12, 12:20)wellspokenman Wrote: [ -> ]Shouldn't be too hard - trakt has an API for this sort of thing. I was thinking that you'd have to punch in your username and password, but no URLs.

That would be fantastic - looking forward to some great news for the next release!
check out the 2.3 beta of the official trakt addon for xbmc - it creates tags from trakt watchlists:
http://forum.xbmc.org/showthread.php?tid=138745
Nevermind - that didn't actually work at all (it's beta though, so we can't complain). I just got Trakt watchlist and custom list tag writing working in Tag-Gen 0.3 - should have it polished and ready within a week. Update: done - see OP.
i keep getting the error main.py error. does anyone know how i can fix this?
This is a really great and usefull add-on. Thanks a lot for the fantastic work :-)

Is it possible at some point to add support for imdb public lists (http://www.imdb.com/list/xxxxxxxxxxx)?
Pages: 1 2 3 4 5 6