Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def userLibraryMoviesCollection(username, extended=None, *args, **argd):
ext = ""
if extended is not None: etx = "/"+str(extended)
data = Trakt.jsonRequest('POST', '/user/library/movies/collection.json/%%API_KEY%%/'+str(username)+ext, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'userLibraryMoviesCollection()'")
return data
def showUnlibrary(tvdbId, title, year, imdbId=None, *args, **argd):
data = Trakt.jsonRequest('POST', '/show/unlibrary/%%API_KEY%%', {'tvdb_id': tvdbId, 'title': title, 'year': year, 'imdb_id': imdbId}, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'showUnlibrary()'")
return data
def movieWatchingNow(title, *args, **argd):
data = Trakt.jsonRequest('POST', '/movie/watchingnow.json/%%API_KEY%%', {'title': title}, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'movieWatchingNow()'")
return data
def showEpisodeUnlibrary(tvdbId, title, year, episodes, imdbId=None, *args, **argd):
data = Trakt.jsonRequest('POST', '/show/episode/unlibrary/%%API_KEY%%', {'tvdb_id': tvdbId, 'title': title, 'year': year, 'episodes': episodes, 'imdb_id': imdbId}, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'showEpisodeUnlibrary()'")
return data
def userWatchlistShows(username, *args, **argd):
data = Trakt.jsonRequest('POST', '/user/watchlist/shows.json/%%API_KEY%%/'+str(username), *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'userWatchlistShows()'")
return data
def calendarPremieres(date=None, days=None, *args, **argd):
ext = ""
if date is not None:
ext = "/"+str(date) #YYYYMMDD
if days is not None:
ext += "/"+str(days)
data = Trakt.jsonRequest('POST', '/calendar/premieres.json/%%API_KEY%%'+ext, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'calendarPremieres()'")
return data
def listsAdd(name, description, privacy, *args, **argd):
data = Trakt.jsonRequest('POST', '/lists/add/%%API_KEY%%', {'name': name, 'description': description, 'privacy': privacy}, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'listsAdd()'")
return data
def showSeen(tvdbId, title, year, imdbId=None, *args, **argd):
data = Trakt.jsonRequest('POST', '/show/seen/%%API_KEY%%', {'tvdb_id': tvdbId, 'title': title, 'year': year, 'imdb_id': imdbId}, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'showSeen()'")
return data
def userLibraryShowsAll(username, extended=None, *args, **argd):
ext = ""
if extended is not None: etx = "/"+str(extended)
data = Trakt.jsonRequest('POST', '/user/library/shows/all.json/%%API_KEY%%/'+str(username)+ext, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'userLibraryShowsAll()'")
return data
def userLibraryMoviesAll(username, extended=None, *args, **argd):
ext = ""
if extended is not None: etx = "/"+str(extended)
data = Trakt.jsonRequest('POST', '/user/library/movies/all.json/%%API_KEY%%/'+str(username)+ext, *args, **argd)
if data == None:
Debug("[Trakt] Error in request from 'userLibraryMoviesAll()'")
return data