Trakt['scrobble']

class trakt.interfaces.scrobble.ScrobbleInterface(client)
action(action, movie=None, show=None, episode=None, progress=0.0, **kwargs)

Perform scrobble action.

Parameters:
  • action (str) – Action to perform (either start, pause or stop)
  • movie (dict) –

    Movie definition (or None)

    Example:

    {
        'title': 'Guardians of the Galaxy',
        'year': 2014,
    
        'ids': {
            'tmdb': 118340
        }
    }
    
  • show (dict) –

    Show definition (or None)

    Example:

    {
        'title': 'Breaking Bad',
        'year': 2008,
    
        'ids': {
            'tvdb': 81189
        }
    }
    
  • episode (dict) –

    Episode definition (or None)

    Example:

    {
        "season": 3,
        "number": 11
    }
    
  • progress (float) – Current movie/episode progress percentage
  • kwargs (dict) – Extra request options
Returns:

Response (or None)

Example:

{
    'action': 'start',
    'progress': 1.25,

    'sharing': {
        'facebook': true,
        'twitter': true,
        'tumblr': false
    },

    'movie': {
        'title': 'Guardians of the Galaxy',
        'year': 2014,

        'ids': {
            'trakt': 28,
            'slug': 'guardians-of-the-galaxy-2014',
            'imdb': 'tt2015381',
            'tmdb': 118340
        }
    }
}

Return type:

dict

pause(movie=None, show=None, episode=None, progress=0.0, **kwargs)

Send the scrobble “pause’ action.

Use this method when the video is paused. The playback progress will be saved and Trakt['sync/playback'].get() can be used to resume the video from this exact position. Un-pause a video by calling the Trakt['scrobble'].start() method again.

Parameters:
  • movie (dict) –

    Movie definition (or None)

    Example:

    {
        'title': 'Guardians of the Galaxy',
        'year': 2014,
    
        'ids': {
            'tmdb': 118340
        }
    }
    
  • show (dict) –

    Show definition (or None)

    Example:

    {
        'title': 'Breaking Bad',
        'year': 2008,
    
        'ids': {
            'tvdb': 81189
        }
    }
    
  • episode (dict) –

    Episode definition (or None)

    Example:

    {
        "season": 3,
        "number": 11
    }
    
  • progress (float) – Current movie/episode progress percentage
  • kwargs (dict) – Extra request options
Returns:

Response (or None)

Example:

{
    'action': 'pause',
    'progress': 75,

    'sharing': {
        'facebook': true,
        'twitter': true,
        'tumblr': false
    },

    'movie': {
        'title': 'Guardians of the Galaxy',
        'year': 2014,

        'ids': {
            'trakt': 28,
            'slug': 'guardians-of-the-galaxy-2014',
            'imdb': 'tt2015381',
            'tmdb': 118340
        }
    }
}

Return type:

dict

start(movie=None, show=None, episode=None, progress=0.0, **kwargs)

Send the scrobble “start” action.

Use this method when the video initially starts playing or is un-paused. This will remove any playback progress if it exists.

Note: A watching status will auto expire after the remaining runtime has elapsed. There is no need to re-send every 15 minutes.

Parameters:
  • movie (dict) –

    Movie definition (or None)

    Example:

    {
        'title': 'Guardians of the Galaxy',
        'year': 2014,
    
        'ids': {
            'tmdb': 118340
        }
    }
    
  • show (dict) –

    Show definition (or None)

    Example:

    {
        'title': 'Breaking Bad',
        'year': 2008,
    
        'ids': {
            'tvdb': 81189
        }
    }
    
  • episode (dict) –

    Episode definition (or None)

    Example:

    {
        "season": 3,
        "number": 11
    }
    
  • progress (float) – Current movie/episode progress percentage
  • kwargs (dict) – Extra request options
Returns:

Response (or None)

Example:

{
    'action': 'start',
    'progress': 1.25,

    'sharing': {
        'facebook': true,
        'twitter': true,
        'tumblr': false
    },

    'movie': {
        'title': 'Guardians of the Galaxy',
        'year': 2014,

        'ids': {
            'trakt': 28,
            'slug': 'guardians-of-the-galaxy-2014',
            'imdb': 'tt2015381',
            'tmdb': 118340
        }
    }
}

Return type:

dict

stop(movie=None, show=None, episode=None, progress=0.0, **kwargs)

Send the scrobble “stop” action.

Use this method when the video is stopped or finishes playing on its own. If the progress is above 80%, the video will be scrobbled and the action will be set to scrobble.

If the progress is less than 80%, it will be treated as a pause and the action will be set to pause. The playback progress will be saved and Trakt['sync/playback'].get() can be used to resume the video from this exact position.

Note: If you prefer to use a threshold higher than 80%, you should use Trakt['scrobble'].pause() yourself so it doesn’t create duplicate scrobbles.

Parameters:
  • movie (dict) –

    Movie definition (or None)

    Example:

    {
        'title': 'Guardians of the Galaxy',
        'year': 2014,
    
        'ids': {
            'tmdb': 118340
        }
    }
    
  • show (dict) –

    Show definition (or None)

    Example:

    {
        'title': 'Breaking Bad',
        'year': 2008,
    
        'ids': {
            'tvdb': 81189
        }
    }
    
  • episode (dict) –

    Episode definition (or None)

    Example:

    {
        "season": 3,
        "number": 11
    }
    
  • progress (float) – Current movie/episode progress percentage
  • kwargs (dict) – Extra request options
Returns:

Response (or None)

Example:

{
    'action': 'scrobble',
    'progress': 99.9,

    'sharing': {
        'facebook': true,
        'twitter': true,
        'tumblr': false
    },

    'movie': {
        'title': 'Guardians of the Galaxy',
        'year': 2014,

        'ids': {
            'trakt': 28,
            'slug': 'guardians-of-the-galaxy-2014',
            'imdb': 'tt2015381',
            'tmdb': 118340
        }
    }
}

Return type:

dict