Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@authenticated
def movies(self, store=None, rating=None, **kwargs):
return self.get('movies', store, rating, **kwargs)
@authenticated
def movies(self, store=None, **kwargs):
return self.get(
'movies',
store,
**kwargs
)
@authenticated
def scrobble(self, title, year, season, episode, duration, progress, credentials=None, **kwargs):
"""Notify trakt that a user has finished watching a show.
This commits the show to the users profile. You should use show/watching
prior to calling this method.
:param title: Show title.
:type title: str
:param year: Show year.
:type year: int
:param season: Show season. Send 0 if watching a special.
:type season: int
:param episode: Show episode.
@authenticated
def add(self, items, **kwargs):
response = self.http.post(
data=items,
**popitems(kwargs, [
'authenticated',
'validate_token'
])
)
return self.get_data(response, **kwargs)
@authenticated
def likes(self, type=None, **kwargs):
if type and type not in ['comments', 'lists']:
raise ValueError('Unknown type specified: %r' % type)
if kwargs.get('parse') is False:
raise ValueError("Parse can't be disabled on this method")
# Send request
response = self.http.get(
'likes',
params=[type],
**popitems(kwargs, [
'authenticated',
'validate_token'
])
)
@authenticated
def episodes(self, store=None, **kwargs):
return self.get(
'episodes',
store,
**kwargs
)
@authenticated
def like(self, username, id, **kwargs):
# Send request
response = self.http.post(
'/users/%s/lists/%s/like' % (clean_username(username), id),
**popitems(kwargs, [
'authenticated',
'validate_token'
])
)
return 200 <= response.status_code < 300
@authenticated
def library(self, movies, **kwargs):
"""Add movies to your library collection.
:param movies: list of movies to add to your collection
:type movies: list of dict {title, year, [imdb_id]}
"""
return self.action(
'library', data={
'movies': movies
},
**kwargs
)
@authenticated
def update(self, username, id, name=None, description=None, privacy=None, display_numbers=None,
allow_comments=None, return_type='object', **kwargs):
data = {
'name': name,
'description': description,
'privacy': privacy,
'allow_comments': allow_comments,
'display_numbers': display_numbers
}
# Remove attributes with `None` values
for key in list(data.keys()):
if data[key] is not None:
continue
@authenticated
def seasons(self, store=None, rating=None, **kwargs):
return self.get('seasons', store, rating, **kwargs)