[{"data":1,"prerenderedAt":762},["ShallowReactive",2],{"\u002Fblog\u002Fsync-plex-with-trakt-tv-using-plextraktsync":3},{"id":4,"title":5,"body":6,"categories":750,"date":752,"description":753,"extension":754,"image":755,"meta":756,"navigation":123,"path":757,"seo":758,"sitemap":759,"stem":760,"tags":755,"__hash__":761},"blog\u002Fblog\u002Fsync-plex-with-trakt-tv-using-plextraktsync.md","Sync Plex with Trakt.tv using PlexTraktSync",{"type":7,"value":8,"toc":742},"minimark",[9,13,18,29,33,41,45,53,72,81,473,477,480,487,698,708,712,715,719,726,732,738],[10,11,12],"p",{},"As a big consumer of entertainment and data, one of my favorite tools out there is Trakt.tv, which allows me to keep track of movies and TV shows that I have watched. Since we use Plex for our home media server, it only made sense for me to find a way to keep that information in sync without any additional effort in my day-to-day workflow. Fortunately, there is an open source project out there that does the heavy lifting for me!",[14,15,17],"h2",{"id":16},"what-is-plex","What is Plex?",[10,19,20,21,28],{},"Plex is a self-hosted server that allows you to view and share your media with your friends and\u002For family. On top of being able to serve your local media files, you can have access to Live TV, podcasts, and streaming content through their services. ",[22,23,27],"a",{"href":24,"rel":25},"https:\u002F\u002Fwww.plex.tv\u002F",[26],"nofollow","Check out the Plex website for more details",".",[14,30,32],{"id":31},"what-is-trakttv","What is Trakt.tv?",[10,34,35,36,28],{},"Trakt.tv is a bootstrapped platform to aggregate TV\u002Fmovie data, track watch history, and discover new movies or TV shows. Trakt is a great way to track your consumption and to view a lot of great stats the entertainment you consume. ",[22,37,40],{"href":38,"rel":39},"https:\u002F\u002Ftrakt.tv\u002F",[26],"Check out the Trakt website for more details",[14,42,44],{"id":43},"getting-started-with-plextraktsync","Getting started with PlexTraktSync",[10,46,47,52],{},[22,48,51],{"href":49,"rel":50},"https:\u002F\u002Fgithub.com\u002FTaxel\u002FPlexTraktSync",[26],"PlexTraktSync"," is an open-source project that can add a two-way sync between a Plex server and your Trakt profile. It does require a Plex and Trakt account to use, but you do not need Trakt Premium or Plex Pass to get the full use of the software. Check out some of the features that you can config with PlexTraktSync:",[54,55,56,60,63,66,69],"ul",{},[57,58,59],"li",{},"Mark the Media in Trakt as collected, if it's part of your Plex server.",[57,61,62],{},"Ratings are synced, with preference on Trakt when available.",[57,64,65],{},"Watched statuses are synced, but dates are not reported from Trakt to Plex.",[57,67,68],{},"Watchlists are synced.",[57,70,71],{},"Options are all configured locally and can be changed at any time.",[10,73,74,75,80],{},"PlexTraktSync supports several different installation methods, including Python, Windows, Unraid, and Docker. For our purposes, we will be using Docker Compose. You should get started by ",[22,76,79],{"href":77,"rel":78},"https:\u002F\u002Fgithub.com\u002FTaxel\u002FPlexTraktSync#setup",[26],"visiting their Setup instructions"," for the latest configurations on setting up with Trakt. Next, you'll want to add a folder on your computer for your Docker volume, then add a config.yml file. Below is an example of what my file looks like, which is using the default settings:",[82,83,89],"pre",{"className":84,"code":85,"filename":86,"language":87,"meta":88,"style":88},"language-yaml shiki shiki-themes material-theme-lighter material-theme-palenight","cache:\n  path: $PTS_CACHE_DIR\u002Ftrakt_cache\n\n# Add as many libraries as needed to exclude from the Trakt sync\nexcluded-libraries:\n  - Private\n  - Family Holidays\n\nconfig:\n  dotenv_override: true\n\nplex:\n  timeout: 30\n\nlogging:\n  append: true\n  # Whether to show timestamps in console messages\n  console_time: false\n  debug: false\n  filename: plextraktsync.log\n\nsync:\n  plex_to_trakt:\n    collection: true\n    ratings: true\n    watched_status: true\n    watchlist: true\n  trakt_to_plex:\n    liked_lists: true\n    ratings: true\n    watched_status: true\n    watchlist: true\n    watchlist_as_playlist: false\n\nwatch:\n  add_collection: true\n  remove_collection: true\n  scrobble_threshold: 80\n  username_filter: true\n\nxbmc-providers:\n  movies: imdb\n  shows: tvdb\n","config.yml","yaml","",[90,91,92,105,118,125,132,140,149,157,162,170,182,187,195,207,212,220,230,236,247,257,268,273,281,289,299,309,319,329,337,347,356,365,374,384,389,397,407,417,428,438,443,451,462],"code",{"__ignoreMap":88},[93,94,97,101],"span",{"class":95,"line":96},"line",1,[93,98,100],{"class":99},"sbA4_","cache",[93,102,104],{"class":103},"s4Nzc",":\n",[93,106,108,111,114],{"class":95,"line":107},2,[93,109,110],{"class":99},"  path",[93,112,113],{"class":103},":",[93,115,117],{"class":116},"s9-rc"," $PTS_CACHE_DIR\u002Ftrakt_cache\n",[93,119,121],{"class":95,"line":120},3,[93,122,124],{"emptyLinePlaceholder":123},true,"\n",[93,126,128],{"class":95,"line":127},4,[93,129,131],{"class":130},"s742E","# Add as many libraries as needed to exclude from the Trakt sync\n",[93,133,135,138],{"class":95,"line":134},5,[93,136,137],{"class":99},"excluded-libraries",[93,139,104],{"class":103},[93,141,143,146],{"class":95,"line":142},6,[93,144,145],{"class":103},"  -",[93,147,148],{"class":116}," Private\n",[93,150,152,154],{"class":95,"line":151},7,[93,153,145],{"class":103},[93,155,156],{"class":116}," Family Holidays\n",[93,158,160],{"class":95,"line":159},8,[93,161,124],{"emptyLinePlaceholder":123},[93,163,165,168],{"class":95,"line":164},9,[93,166,167],{"class":99},"config",[93,169,104],{"class":103},[93,171,173,176,178],{"class":95,"line":172},10,[93,174,175],{"class":99},"  dotenv_override",[93,177,113],{"class":103},[93,179,181],{"class":180},"sOrAP"," true\n",[93,183,185],{"class":95,"line":184},11,[93,186,124],{"emptyLinePlaceholder":123},[93,188,190,193],{"class":95,"line":189},12,[93,191,192],{"class":99},"plex",[93,194,104],{"class":103},[93,196,198,201,203],{"class":95,"line":197},13,[93,199,200],{"class":99},"  timeout",[93,202,113],{"class":103},[93,204,206],{"class":205},"sRqct"," 30\n",[93,208,210],{"class":95,"line":209},14,[93,211,124],{"emptyLinePlaceholder":123},[93,213,215,218],{"class":95,"line":214},15,[93,216,217],{"class":99},"logging",[93,219,104],{"class":103},[93,221,223,226,228],{"class":95,"line":222},16,[93,224,225],{"class":99},"  append",[93,227,113],{"class":103},[93,229,181],{"class":180},[93,231,233],{"class":95,"line":232},17,[93,234,235],{"class":130},"  # Whether to show timestamps in console messages\n",[93,237,239,242,244],{"class":95,"line":238},18,[93,240,241],{"class":99},"  console_time",[93,243,113],{"class":103},[93,245,246],{"class":180}," false\n",[93,248,250,253,255],{"class":95,"line":249},19,[93,251,252],{"class":99},"  debug",[93,254,113],{"class":103},[93,256,246],{"class":180},[93,258,260,263,265],{"class":95,"line":259},20,[93,261,262],{"class":99},"  filename",[93,264,113],{"class":103},[93,266,267],{"class":116}," plextraktsync.log\n",[93,269,271],{"class":95,"line":270},21,[93,272,124],{"emptyLinePlaceholder":123},[93,274,276,279],{"class":95,"line":275},22,[93,277,278],{"class":99},"sync",[93,280,104],{"class":103},[93,282,284,287],{"class":95,"line":283},23,[93,285,286],{"class":99},"  plex_to_trakt",[93,288,104],{"class":103},[93,290,292,295,297],{"class":95,"line":291},24,[93,293,294],{"class":99},"    collection",[93,296,113],{"class":103},[93,298,181],{"class":180},[93,300,302,305,307],{"class":95,"line":301},25,[93,303,304],{"class":99},"    ratings",[93,306,113],{"class":103},[93,308,181],{"class":180},[93,310,312,315,317],{"class":95,"line":311},26,[93,313,314],{"class":99},"    watched_status",[93,316,113],{"class":103},[93,318,181],{"class":180},[93,320,322,325,327],{"class":95,"line":321},27,[93,323,324],{"class":99},"    watchlist",[93,326,113],{"class":103},[93,328,181],{"class":180},[93,330,332,335],{"class":95,"line":331},28,[93,333,334],{"class":99},"  trakt_to_plex",[93,336,104],{"class":103},[93,338,340,343,345],{"class":95,"line":339},29,[93,341,342],{"class":99},"    liked_lists",[93,344,113],{"class":103},[93,346,181],{"class":180},[93,348,350,352,354],{"class":95,"line":349},30,[93,351,304],{"class":99},[93,353,113],{"class":103},[93,355,181],{"class":180},[93,357,359,361,363],{"class":95,"line":358},31,[93,360,314],{"class":99},[93,362,113],{"class":103},[93,364,181],{"class":180},[93,366,368,370,372],{"class":95,"line":367},32,[93,369,324],{"class":99},[93,371,113],{"class":103},[93,373,181],{"class":180},[93,375,377,380,382],{"class":95,"line":376},33,[93,378,379],{"class":99},"    watchlist_as_playlist",[93,381,113],{"class":103},[93,383,246],{"class":180},[93,385,387],{"class":95,"line":386},34,[93,388,124],{"emptyLinePlaceholder":123},[93,390,392,395],{"class":95,"line":391},35,[93,393,394],{"class":99},"watch",[93,396,104],{"class":103},[93,398,400,403,405],{"class":95,"line":399},36,[93,401,402],{"class":99},"  add_collection",[93,404,113],{"class":103},[93,406,181],{"class":180},[93,408,410,413,415],{"class":95,"line":409},37,[93,411,412],{"class":99},"  remove_collection",[93,414,113],{"class":103},[93,416,181],{"class":180},[93,418,420,423,425],{"class":95,"line":419},38,[93,421,422],{"class":99},"  scrobble_threshold",[93,424,113],{"class":103},[93,426,427],{"class":205}," 80\n",[93,429,431,434,436],{"class":95,"line":430},39,[93,432,433],{"class":99},"  username_filter",[93,435,113],{"class":103},[93,437,181],{"class":180},[93,439,441],{"class":95,"line":440},40,[93,442,124],{"emptyLinePlaceholder":123},[93,444,446,449],{"class":95,"line":445},41,[93,447,448],{"class":99},"xbmc-providers",[93,450,104],{"class":103},[93,452,454,457,459],{"class":95,"line":453},42,[93,455,456],{"class":99},"  movies",[93,458,113],{"class":103},[93,460,461],{"class":116}," imdb\n",[93,463,465,468,470],{"class":95,"line":464},43,[93,466,467],{"class":99},"  shows",[93,469,113],{"class":103},[93,471,472],{"class":116}," tvdb\n",[14,474,476],{"id":475},"setting-up-your-docker-compose-stack","Setting up your Docker Compose stack",[10,478,479],{},"Next, you'll want to add setup your Docker Compose file. For my home server, I use Portainer to manage my Docker Compose stacks and monitor all of my containers, but you can use any Docker Compose setup to achieve this.",[10,481,482,483,486],{},"We will pull in two different containers for this. The first one is a scheduler container to run the sync command on a scheduled CRON time, preferably every 6 hours. The second is in the sync container itself. Since PlexTraktSync does not have a GUI, we have enabled ",[90,484,485],{},"stdin_open"," so we can run an exec command on our own to configure our Plex account.  Below is the Docker Compose file that I used to get setup:",[82,488,491],{"className":84,"code":489,"filename":490,"language":87,"meta":88,"style":88},"version: \"2.1\"\nservices:\n  scheduler:\n    image: mcuadros\u002Fofelia:latest\n    depends_on:\n      - plextraktsync\n    command: daemon --docker\n    volumes:\n      - \u002Fvar\u002Frun\u002Fdocker.sock:\u002Fvar\u002Frun\u002Fdocker.sock:ro\n    labels:\n      ofelia.job-run.plextraktsync.schedule: \"@every 6h\"\n      ofelia.job-run.plextraktsync.container: \"plextraktsync\"\n\n  plextraktsync:\n    image: ghcr.io\u002Ftaxel\u002Fplextraktsync\n    container_name: plextraktsync\n    restart: unless-stopped\n    command: watch\n    privileged: true\n    stdin_open: true\n    tty: true\n    volumes:\n      - \u002Frun\u002Fdesktop\u002Fmnt\u002Fhost\u002Ff\u002FDocker\u002Fplextraxtsync:\u002Fapp\u002Fconfig # Adjust this to match your folder with the config.yml file.\n","docker-compose.yml",[90,492,493,509,516,523,533,540,548,558,565,572,579,593,607,611,618,627,636,646,655,664,673,682,688],{"__ignoreMap":88},[93,494,495,498,500,503,506],{"class":95,"line":96},[93,496,497],{"class":99},"version",[93,499,113],{"class":103},[93,501,502],{"class":103}," \"",[93,504,505],{"class":116},"2.1",[93,507,508],{"class":103},"\"\n",[93,510,511,514],{"class":95,"line":107},[93,512,513],{"class":99},"services",[93,515,104],{"class":103},[93,517,518,521],{"class":95,"line":120},[93,519,520],{"class":99},"  scheduler",[93,522,104],{"class":103},[93,524,525,528,530],{"class":95,"line":127},[93,526,527],{"class":99},"    image",[93,529,113],{"class":103},[93,531,532],{"class":116}," mcuadros\u002Fofelia:latest\n",[93,534,535,538],{"class":95,"line":134},[93,536,537],{"class":99},"    depends_on",[93,539,104],{"class":103},[93,541,542,545],{"class":95,"line":142},[93,543,544],{"class":103},"      -",[93,546,547],{"class":116}," plextraktsync\n",[93,549,550,553,555],{"class":95,"line":151},[93,551,552],{"class":99},"    command",[93,554,113],{"class":103},[93,556,557],{"class":116}," daemon --docker\n",[93,559,560,563],{"class":95,"line":159},[93,561,562],{"class":99},"    volumes",[93,564,104],{"class":103},[93,566,567,569],{"class":95,"line":164},[93,568,544],{"class":103},[93,570,571],{"class":116}," \u002Fvar\u002Frun\u002Fdocker.sock:\u002Fvar\u002Frun\u002Fdocker.sock:ro\n",[93,573,574,577],{"class":95,"line":172},[93,575,576],{"class":99},"    labels",[93,578,104],{"class":103},[93,580,581,584,586,588,591],{"class":95,"line":184},[93,582,583],{"class":99},"      ofelia.job-run.plextraktsync.schedule",[93,585,113],{"class":103},[93,587,502],{"class":103},[93,589,590],{"class":116},"@every 6h",[93,592,508],{"class":103},[93,594,595,598,600,602,605],{"class":95,"line":189},[93,596,597],{"class":99},"      ofelia.job-run.plextraktsync.container",[93,599,113],{"class":103},[93,601,502],{"class":103},[93,603,604],{"class":116},"plextraktsync",[93,606,508],{"class":103},[93,608,609],{"class":95,"line":197},[93,610,124],{"emptyLinePlaceholder":123},[93,612,613,616],{"class":95,"line":209},[93,614,615],{"class":99},"  plextraktsync",[93,617,104],{"class":103},[93,619,620,622,624],{"class":95,"line":214},[93,621,527],{"class":99},[93,623,113],{"class":103},[93,625,626],{"class":116}," ghcr.io\u002Ftaxel\u002Fplextraktsync\n",[93,628,629,632,634],{"class":95,"line":222},[93,630,631],{"class":99},"    container_name",[93,633,113],{"class":103},[93,635,547],{"class":116},[93,637,638,641,643],{"class":95,"line":232},[93,639,640],{"class":99},"    restart",[93,642,113],{"class":103},[93,644,645],{"class":116}," unless-stopped\n",[93,647,648,650,652],{"class":95,"line":238},[93,649,552],{"class":99},[93,651,113],{"class":103},[93,653,654],{"class":116}," watch\n",[93,656,657,660,662],{"class":95,"line":249},[93,658,659],{"class":99},"    privileged",[93,661,113],{"class":103},[93,663,181],{"class":180},[93,665,666,669,671],{"class":95,"line":259},[93,667,668],{"class":99},"    stdin_open",[93,670,113],{"class":103},[93,672,181],{"class":180},[93,674,675,678,680],{"class":95,"line":270},[93,676,677],{"class":99},"    tty",[93,679,113],{"class":103},[93,681,181],{"class":180},[93,683,684,686],{"class":95,"line":275},[93,685,562],{"class":99},[93,687,104],{"class":103},[93,689,690,692,695],{"class":95,"line":283},[93,691,544],{"class":103},[93,693,694],{"class":116}," \u002Frun\u002Fdesktop\u002Fmnt\u002Fhost\u002Ff\u002FDocker\u002Fplextraxtsync:\u002Fapp\u002Fconfig",[93,696,697],{"class":130}," # Adjust this to match your folder with the config.yml file.\n",[10,699,700,701,703,704,707],{},"If you are using Portainer (or Docker Desktop), you can open up the console and run the command ",[90,702,604],{}," to configure the application and run the initial sync. If you setup the stack through a ternimal, then you can run ",[90,705,706],{},"docker-compose exec plextraktsync"," to get started. You'll be prompted to enter your Plex information and Trakt API information, then the sync will run immediately afterwards.",[14,709,711],{"id":710},"enable-scrobbling","Enable Scrobbling",[10,713,714],{},"Scrobbling is the process of automatically tracking what you're watching back to Trakt without any interaction needed. The Compose file above is set to use the command watch which will look for activity for the synced user and update Trakt in real time, including any partial watches. This will not run the sync between Plex and Trakt, but will mark the media as watched on Trakt when the media is finished.",[14,716,718],{"id":717},"things-to-know","Things to Know",[10,720,721,725],{},[722,723,724],"strong",{},"This does not allow you to sync statuses for multiple users."," You can setup multiple containers for each user, if you want to sync other users.",[10,727,728,731],{},[722,729,730],{},"This does not sync information for multiple servers at the same time."," You can setup multiple containers for each server though.",[10,733,734,737],{},[722,735,736],{},"Watch is optional and only for the synced user."," If you are using another account to watch TV, or others are using your account on a device, then that watch history will be synced in real-time.",[739,740,741],"style",{},"html pre.shiki code .sbA4_, html code.shiki .sbA4_{--shiki-default:#E53935;--shiki-dark:#F07178}html pre.shiki code .s4Nzc, html code.shiki .s4Nzc{--shiki-default:#39ADB5;--shiki-dark:#89DDFF}html pre.shiki code .s9-rc, html code.shiki .s9-rc{--shiki-default:#91B859;--shiki-dark:#C3E88D}html pre.shiki code .s742E, html code.shiki .s742E{--shiki-default:#90A4AE;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sOrAP, html code.shiki .sOrAP{--shiki-default:#FF5370;--shiki-dark:#FF9CAC}html pre.shiki code .sRqct, html code.shiki .sRqct{--shiki-default:#F76D47;--shiki-dark:#F78C6C}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":88,"searchDepth":107,"depth":120,"links":743},[744,745,746,747,748,749],{"id":16,"depth":107,"text":17},{"id":31,"depth":107,"text":32},{"id":43,"depth":107,"text":44},{"id":475,"depth":107,"text":476},{"id":710,"depth":107,"text":711},{"id":717,"depth":107,"text":718},[751],"Home Server","2022-09-30","Use PlexTraktSync to automate your media consumption between Plex and Trakt.tv.","md",null,{},"\u002Fblog\u002Fsync-plex-with-trakt-tv-using-plextraktsync",{"title":5,"description":753},{"loc":757,"lastmod":752},"blog\u002Fsync-plex-with-trakt-tv-using-plextraktsync","4khDnSfzlmHieW5DFiva42goE6vlSmw24z8tjPjbZcg",1786138781024]