tautulli

Pubdev License

Dart library package to facilitate the connection to and from Tautulli's API, a Python based monitoring and tracking tool for Plex Media Server.

Getting Started

In order to use this package, you need to have enabled and created an API key within Tautulli. Please ensure you do not publicly reveal your API key, as it will give any user with access full control of your Tautulli instance. To get started simply import the tautulli package, and initialize a connection to your instance:

Tautulli tautulli = Tautulli(host: '<your instance URL>', apiKey: '<your API key>');

Once initialized, you can access any of the command handlers (detailed below) to quickly and easily make calls to Tautulli. For most calls that return data, model definitions have been created. Typings have also been created for parameters that have a set, finite list of options.

Optional Parameters

There are a few optional parameters when initializing a Tautulli instance.

headers | Map<dynamic, String> (default: null)

Allows you to add on any custom headers to each request.

Tautulli(
    host: '<your instance URL>',
    apiKey: '<your API key>',
    headers: {
        'authorization': '<auth_token>',
    },
);

strictTLS | Boolean (default: true)

Allows you to disable strict TLS validation. Strict TLS validation ensures that the SSL certificate on the host machine is valid by checking it against your device's certificate authorities (CAs). Disabling this feature will allow for successful connections to machines with self-signed SSL certificates, but should be left enabled when possible.

Tautulli(
    host: '<your instance URL>',
    apiKey: '<your API key>',
    strictTLS: false, // Disables strict TLS
);

followRedirects | Boolean (default: true)

Allows you to define if the HTTP client should follow redirects.

Tautulli(
    host: '<your instance URL>',
    apiKey: '<your API key>',
    followRedirects: false, // Disables following redirects
);

maxRedirects | Integer (default: 5)

Allows you to define the maximum amount of redirects the HTTP client should follow. If followRediects is set to false, then this parameter does nothing.

Tautulli(
    host: '<your instance URL>',
    apiKey: '<your API key>',
    maxRedirects: 1, // Only follow 1 redirect at most
);

Custom Dio HTTP Client

This package uses dio to make all HTTP connections. The default constructor will create the HTTP client for you, or you can create your own Dio instance and create a Tautulli instance from it using the factory constructor:

Dio dio = Dio(
    BaseOptions(
        baseUrl: '<your instance URL>',
        queryParameters: {
            'apikey': '<your API key>',
        },
    ),
);
Tautulli tautulli = Tautulli.from(dio);

You must ensure you set the BaseOptions specified above, specifically baseUrl and queryParameters otherwise the instance will not be able to create a successful connection to your machine.

Commands

All commands have been split into categories, each with their own respective handler, and can be accessed via an initialized Tautulli object.

Any command handler can be initialized directly, but will require you to create your own Dio HTTP client. You will still need to ensure you set the BaseOptions as specified above.

Activity

All commands that are activity related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_Activity instance.
  • activity within an initialized Tautulli object.
API CommandMethod
delete_temp_sessionsdeleteTempSessions()
get_activitygetActivity()
terminate_sessionterminateSession()

History

All commands that are history related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_History instance.
  • history within an initialized Tautulli object.
API CommandMethod
delete_historydeleteHistory()
get_historygetHistory()
get_home_statsgetHomeStats()
get_plays_by_dategetPlaysByDate()
get_plays_by_dayofweekgetPlaysByDayOfWeek()
get_plays_by_hourofdaygetPlaysByHourOfDay()
get_plays_by_source_resolutiongetPlaysBySourceResolution()
get_plays_by_stream_resolutiongetPlaysByStreamResolution()
get_plays_by_stream_typegetPlaysByStreamType()
get_plays_by_top_10_platformsgetPlaysByTopTenPlatforms()
get_plays_by_top_10_usersgetPlaysByTopTenUsers()
get_plays_per_monthgetPlaysPerMonth()
get_stream_datagetStreamData()
get_stream_type_by_top_10_platformsgetStreamTypeByTopTenPlatforms()
get_stream_type_by_top_10_usersgetStreamTypeByTopTenUsers()

Libraries

All commands that are library related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_Libraries instance.
  • libraries within an initialized Tautulli object.
API CommandMethod
delete_all_library_historydeleteAllLibraryHistory()
delete_librarydeleteLibrary()
delete_recently_addeddeleteRecentlyAdded()
edit_libraryeditLibrary()
get_librariesgetLibraries()
get_libraries_tablegetLibrariesTable()
get_librarygetLibrary()
get_library_media_infogetLibraryMediaInfo()
get_library_namesgetLibraryNames()
get_library_user_statsgetLibraryUserStats()
get_library_watch_time_statsgetLibraryWatchTimeStats()
get_metadatagetMetadata()
get_new_rating_keysgetNewRatingKeys()
get_old_rating_keysgetOldRatingKeys()
get_recently_addedgetRecentlyAdded()
get_synced_itemsgetSyncedItems()
refresh_libraries_listrefreshLibrariesList()
searchsearch()
undelete_libraryundeleteLibrary()
update_metadata_detailsupdateMetadataDetails()

Miscellaneous

All commands that couldn't be sorted into the other categories. All commands in this category can be accessed via:

  • A TautulliCommandHandler_Miscellaneous instance.
  • miscellaneous within an initialized Tautulli object.
API CommandMethod
arnoldarnold()
docsdocs()
docs_mddocsMd()
download_configdownloadConfig()
download_databasedownloadDatabase()
download_logdownloadLog()
download_plex_logdownloadPlexLog()
get_date_formatsgetDateFormats()
get_geoip_lookupgetGeoIPLookup()
get_logsgetLogs()
get_plex_loggetPlexLog()
get_server_friendly_namegetServerFriendlyName()
get_server_idgetServerID()
get_server_identitygetServerIdentity()
get_server_listgetServerList()
get_server_prefgetServerPref()
get_servers_infogetServersInfo()
get_whois_lookupgetWHOISLookup()
pms_image_proxypmsImageProxy()
sqlsql()

Notifications

All commands that are notification (newsletter/notifier) related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_Notifications instance.
  • notifications within an initialized Tautulli object.
API CommandMethod
add_newsletter_configaddNewsletterConfig()
add_notifier_configaddNotifierConfig()
delete_mobile_devicedeleteMobileDevive()
delete_newsletterdeleteNewsletter()
delete_notifierdeleteNotifier()
get_newsletter_configgetNewsletterConfig()
get_newsletter_loggetNewsletterLog()
get_newslettersgetNewsletters()
get_notification_loggetNotificationLog()
get_notifier_configgetNotifierConfig()
get_notifier_parametersgetNotifierParameters()
get_notifiersgetNotifiers()
notifynotify()
notify_newsletternotifyNewsletter()
notify_recently_addednotifyRecentlyAdded()
register_deviceregisterDevice()
set_mobile_device_configsetMobileDeviceConfig()
set_newsletter_configsetNewsletterConfig()
set_notifier_configsetNotifierConfig()

System

All commands that are system related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_System instance.
  • system within an initialized Tautulli object.
API CommandMethod
backup_configbackupConfig()
backup_dbbackupDB()
delete_cachedeleteCache()
delete_hosted_imagesdeleteHostedImages()
delete_image_cachedeleteImageCache()
delete_login_logdeleteLoginLog()
delete_lookup_infodeleteLookupInfo()
delete_media_info_cachedeleteMediaInfoCache()
delete_newsletter_logdeleteNewsletterLog()
delete_notification_logdeleteNotificationLog()
get_pms_tokengetPMSToken()
get_pms_updategetPMSUpdate()
get_settingsgetSettings()
restartrestart()
statusstatus()
updateupdate()
update_checkupdateCheck()

Users

All commands that are user related. All commands in this category can be accessed via:

  • A TautulliCommandHandler_Users instance.
  • users within an initialized Tautulli object.
API CommandMethod
delete_all_user_historydeleteAllUserHistory()
delete_userdeleteUser()
edit_usereditUser()
get_usergetUser()
get_user_ipsgetUserIPs()
get_user_loginsgetUserLogins()
get_user_namesgetUserNames()
get_user_player_statsgetUserPlayerStats()
get_user_watch_time_statsgetUserWatchTimeStats()
get_usersgetUsers()
get_users_tablegetUsersTable()
refresh_users_listrefreshUsersList()
undelete_userundeleteUser()

Not Implemented

All commands that have not been implemented by this package.

API CommandReason
get_apikeyIn order to use this package a user would need their API key, making it redundant.
import_databaseA function like importing a new database should be done through the web GUI to ensure no user errors occur.

Libraries

tautulli
Dart library package to facilitate the connection to and from Tautulli's API: a Python based monitoring and tracking tool for Plex Media Server. [...]
tautulli_commands
Library containing all logic and accessors to make calls to Tautulli's API.
tautulli_models
Library containing all model definitions for Tautulli data.
tautulli_types
Library containing all type definitions for Tautulli data.
tautulli_utilities
Library containing all utilty functions for Tautulli data.