Package: retraktarr
retraktarrretraktarris a "reverse"Trakt.tvlist implementation forRadarr/Sonarrthat createsTrakt.tvlists for your movies/series using APIs.Introductionretraktarris a Python script to sync yourRadarr/Sonarrlibrary to aTrakt.tvlists using the respective APIs.The original idea stemmed from my wanting to have a list of monitored movies I could share with friends. This was to be the equivalent of a mdblist, but cherry-picked. Providing a more curated list of whatIbelieved was worth considering to watch for downloading.UsesThe goal was to add the list toRadarr, set up a filter for the list with Exists in Library and On Exclusion List = false, and allow friends to easily keep up to date with my recommended movies through the Discover tab.This use case was admittedly very narrow, and a few more use cases have emerged since.Backing up entire Radarr/Sonarr libraries, including movies/shows you do not already have downloaded. For example, if it's missing in Radarr, PlexTraktSync would not help.Restoring your library easily by importing an entire (backed up) list (in the case of migrating OSs or catastrophic failures)Giving someone the ability to browse media you have (without giving them access to Plex/Jellyfin/Emby)Sync multiple instances of Sonarr/RadarrPossibly more I have not considered...RequirementsPython 3(includingrequestsmodule if running from source)pip3 install requestsRadarrand/orSonarrATrakt.tvaccount withAPI App configuredArr Supportretraktarrsupports bothRadarrandSonarrin sourcing the media to sync to your lists. You can specify either or both for syncing, as well as filter what should be added with CLI arguments.retraktarrwill need API access to whichever Arr(s) you intend to use.Trakt.tvAPI App SetupATrakt.tvaccount with anAPI set upis obviously necessary.🚨Note:Trakt.tvlists have limits. You can read their official statementhere🚨Head toTrakt.tv API App Setup PageCreate a new application, you will onlyneedto fillNameandRedirectURII suggest usinghttps://google.comfor your redirect URI. We will need to steal a parameter from the redirect to complete the OAuth2 process.After creating the application, click on it and you will see yourClient ID,Client Secret, and anAuthorizebutton.ClickAuthorize. ClickYes. You will be redirected to Google (or your URI) and in the URL bar you will see?code=followed by 64 alphanumeric characters.Save this for now. This is your OAuth2 Authorization code.You can now complete the OAuth2 process when you're ready using theretraktarrscript.Installing retraktarrYou can either download the source yourself or install the package from PyPI using thepip3 install retraktarrcommand.Configuring retraktarrretraktarruses a config file, namedretraktarr.conf(by default) to get many of its settings. However, some of these can be overridden with an argument you pass. You can runretraktarrat any time to see the available options.To generate the config template, simply runretraktarrwithout a.conffile present. It will tell you exactly where the default config file was generated and it's location.Open in your favorite text editor and complete the necessary details for your usage.If you've never runretraktarrbefore, you will need to leave youroauth2_tokenandoauth2_refreshoptions blank and use the--oauthargument tocomplete the authorizationprocess and automatically save your tokens. They will be automatically refreshed if a valid refresh token is available upon expiration.Usage (CLI)options:-h,--helpshowthishelpmessageandexit--oauthOAUTH,-oOAUTHUpdateOAuth2BearerToken.AcceptstheauthcodeandrequiresvalidTraktconfigsettings(ex:-oCODE_HERE)--radarr,-rSynchronizeRadarrmovieswithTrakt.tv--sonarr,-sSynchronizeSonarrserieswithTrakt.tv--all,-all,-aSynchronizebothStarrappswithTrakt.tv--mon,-mSynchronizeonlymonitoredcontentwithTrakt.tv--qualityprofileQUALITYPROFILE,-qpQUALITYPROFILEThequalityprofileyouwishtosynctoTrakt.tv--tagTAG,-tTAGThearrtagyouwishtosynctoTrakt.tv--cat,-cAddtotheTrakt.tvlistwithoutdeletion(concatenate/appendtolist)--listLIST,-lLISTSpecifiestheTrakt.tvlistname.(overridesconfigfilesettings)--wipe,-wErasestheassociatedlistandperformsasync(requires-allor-r/s)--privacyPRIVACY,-pPRIVACYSpecifiestheTrakt.tvlistprivacysettings(private/friends/public-overridesconfigfilesettings)--refreshForcesarefresh_tokenexchange(oauth)andsetstheconfigtoanewtokens.--timeoutTIMEOUTSpecifiesthetimeoutinsecondstouseforPOSTcommandstoTrakt.tv--versionDisplaysversioninformation--configCONFIGIfapathisprovided,retraktarrwillusethisconfigfile,otherwiseitoutputsdefaultconfiglocation.TroubleshootingIf you are running from the source, you will need to runretraktarr.pyin the root directory, and not in the retraktarr directory.If you are having problems with old entries not being removed, feel free to use the -wipe command in addition, it will delete the entirecontentsof the listwithoutdeleting the list itself, and resync.If you want to sync multiple "filters" (tag, profile, etc) to one list, consider running multiple times with your filter arguments and the additional -cat parameter.Privacy can only be set when the list is first created, specifying privacy on an already created list will do nothing.Unless a list is specified using-list- when you use-allor-r -s- each Arr will sync to the list specified in the config.conf file.Using filtered syncs with-allis not recommended, consider chaining multiple runs.Syncing an instance will only remove non-syncing media in its associated type. If you have a list with movies and TV added and run a Sonarr sync to it, it will only removeSHOWSthat are not present in the sync. (excludes usage of -cat)If you repeatedly get the same movies reporting deleted, but not deleting, this is almost certainly due to an outdated ID (usually TMDB) being associated with the movie on Trakt. Report it and give them the correct link. If after it's updated it does not fix it, create an issue with details.If you're getting timeouts during runs, particularly during--wipeor large list processing, use the--timeout <sec>command. Default is 30, increase it until you're list is processed completely.