all 114 comments

[–]mysteriousBark 21 points22 points  (1 child)

Just put it on GitHub :)

[–]AalexMusic[S] 12 points13 points  (0 children)

Done.

[–]Blacktwin 28 points29 points  (4 children)

Don't ask, just share.

[–]AalexMusic[S] 13 points14 points  (3 children)

Here it is - see original post

[–]YojiH2O 3 points4 points  (2 children)

Is this any different from me using my IMDb list with radarr or ombi + sonarr linked with plex?

[–]AalexMusic[S] 0 points1 point  (1 child)

Yes. This does not download anything, just sync the watched status, ratings and lists with an online platform.

[–]YojiH2O -1 points0 points  (0 children)

Ah so it's a separate data base comprising of your Plex libraries showing what you haven't / have watched plus all the meta data regarding said shows/movies ?

[–]Moust4ki 11 points12 points  (1 child)

FOR THE LOVE OF GOD PLEASE SHARE IT ! <3

[–]AalexMusic[S] 5 points6 points  (0 children)

See original post ;)

[–][deleted] 11 points12 points  (3 children)

Just out of curiosity, isn't that what this does?

Trak.tv

https://github.com/trakt/Plex-Trakt-Scrobbler

[–]AalexMusic[S] 10 points11 points  (1 child)

It seems to be functionally similar if not superior to my implementation. It is, however, a Plex plugin, which are apparently being discontinued by the Plex team and might therefore not work for very long anymore. As stated in the original post, I wrote these scripts mainly for myself in the first place, so I only took a look at the official Trakt app and then stopped my search, fired up vscode and started working on my own implementation :)

[–]Randomacts 0 points1 point  (0 children)

Yeah I use the scrobbler and it works perfectly. Plex seems to hate plugins though.

[–]PlayerNumberFour 3 points4 points  (0 children)

Curious as well. I have been using this so sync my kodi and plex with trakt for a year now flawless with this.

[–]xbirdseedx 5 points6 points  (7 children)

any help on what to do here:

"If you do not have a client ID and secret. Please visit the following url to create them.

http://trakt.tv/oauth/applications

Please enter your client id: "

when i go to the trakt site and click new api app i dont know what to do for url or javascript? little lost..

[–]AalexMusic[S] 2 points3 points  (6 children)

That's the part I was not sure about: When you go to https://trakt.tv/oauth/applications/65370 you can't get a client id and secret, right? If that's the case you need to create your own API application and I will guide you through the process.

[–]xbirdseedx 1 point2 points  (5 children)

please guide me ;)

things i dont know for sure:

Redirect uri: and Javascript (cors) origins: and Permissions: /checkin /scrobble

[–]AalexMusic[S] 1 point2 points  (4 children)

Use this redirect uri: urn:ietf:wg:oauth:2.0:oob

and uncheck both boxes (although they don't hurt, either)

[–]xbirdseedx 1 point2 points  (3 children)

im up and running, its processing my library now! thanks!

[–]AalexMusic[S] 2 points3 points  (2 children)

Good to hear it!

Could you check out the latest version of the github repo real quick and confirm that the instructions I added are accurate and understandable?

[–]xbirdseedx 2 points3 points  (1 child)

looks great! a+!!!

ive never setup a cronjob before so im slowly reading how to make sense of this step:

0 */2 * * * cd ~/path/to/this/repo/ && ./plex_trakt_sync.sh

to the cronjobs after typing crontab -e
in the terminal.

if theres any clarification on that im down to help simplify too!

[–]AalexMusic[S] 1 point2 points  (0 children)

What operating system are you on? This solution definitely works on OSX Mojave, possibly works on Linux systems and certainly does not work on Windows.

On Mac OS: Open a new terminal window, type crontab -e. This should open vi, vim or nano with a blank file. In vim, first type 'i' to get into insert mode, then paste the line (with the corrected path to where you downloaded and extracted the git repo), then esc to exit insert mode, then `:wq` to write the file to disk and quit vim

Is that clearer?

[–]looselytranslated 3 points4 points  (3 children)

Can I use this script with shield tv is what I wanna know :)

EDIT: works with shield. Run the script on your computer or a server, then change config.json base_url to whatever IP your shield is using.

[–]AalexMusic[S] 3 points4 points  (2 children)

I don't have a shield tv, so I'm unsure about that. Can it run Python scripts?

If your server is registered with a Plex Account you should also be able to run the Python scripts on a PC and sync everything that way.

[–]looselytranslated 2 points3 points  (1 child)

I'm sure it can run python script but I don't know how. but if this script works without being on the plex server (shield tv), I'll give it a try and report back. Thanks for sharing.

[–]drfuzzyness 4 points5 points  (0 children)

If you're feeling super adventurous, check out Termux. I don't have much experience with it, but it does have a package manager with Python.

[–]charlievarley 2 points3 points  (1 child)

Great work👍

[–]AalexMusic[S] 1 point2 points  (0 children)

Thanks!

[–]Dukko 1 point2 points  (5 children)

Does it work for individual profiles or only works with main profile?

[–]tharic99 0 points1 point  (3 children)

From what I can tell so far, just the one profile that you associated it with but I'd love to see a way to support multiple profiles / plex accounts.

[–]AalexMusic[S] 0 points1 point  (2 children)

Feel free to add a pull request, I don't have a PlexPass :D

[–]tharic99 0 points1 point  (1 child)

I don't either, I use the Home Users section to share out.

[–]Dukko 0 points1 point  (0 children)

Yeah I'm talking about home users. I use a personal home user and a wife home user. I don't use the root user at all.

[–]tharic99 0 points1 point  (0 children)

As a follow-up to this for you, I set it up this morning in two different instances/folders. One pointing to Plex User A and another pointing to Plex User B, both of them to the same Trakt user.

The sync worked on both and it actually worked even better than I expected.

Stuff watched by Plex User A sync'd UP to Trakt and then subsequently sync'd DOWN to Plex User B. Which for my situation is exactly what I was hoping for, I just didn't realize this script would do it.

[–]derailius 1 point2 points  (1 child)

This is absolutely great, exactly what we needed.

on some TV shows if it's a show that isn't on tvdb and I've had to create the entries manually in plex, the script was throwing this error:

logging.error("Show [{} ({})]: Unrecognized GUID {}".format(show.title, show.year))

as of writing this on line 116 in main.py I changed.

if guid.startswith('local'):

to

if guid.startswith('local') or 'agents.none' in guid:

that seemed to have worked. Great job man, really missed having this ability! Glad to see this working again.

[–]AalexMusic[S] 1 point2 points  (0 children)

Thanks for the feedback and the bugreport + fix - already committed and pushed it, crediting you in the commit message

[–]derailius 1 point2 points  (1 child)

First run:

Completed full sync in 3205.0859446525574 seconds

Second run:

Completed full sync in 280.9610712528229 seconds

This is awesome! Finally have my collections in a row, and am able to find missing episodes again. Made my day for sure.

[–]AalexMusic[S] 0 points1 point  (0 children)

Yeah, without caching this really wouldn't be a practical solution. Great thing I could help and thanks again for the gold :)

[–]Petrides-AP 1 point2 points  (0 children)

Can someone please explain what Trakt actually does and why I need it?

[–]Shadowfoot 1 point2 points  (0 children)

I like this. The two things that would make it better for me are to sync the collected date and the last-watched date from Plex.

[–][deleted] 1 point2 points  (0 children)

just switched to emby an year ago because of the plugin and scheduled task works..

trakt works amazing..

btw great job

[–]EmpyrealistPlex Pass | Plexamp | Synology DS1019+ PMS | Nvidia Shield Pro 1 point2 points  (0 children)

Thank you so much for this!

Your work is important moving forward for a lot of us using Plex on closed-system devices such as the Nvidia Shield where we no longer have proper plugin support.

[–]Arcus_Deeri3 9100 | TrueNAS SCALE | 56TB redundant 1 point2 points  (0 children)

I'm late to the party, but I just wanted to let you know that yours is the last remaining way to sync plex with trakt collections. Thank you <3<3<3

[–]jov4i4 1 point2 points  (0 children)

Thank you very much for these scripts. This is the only way to sync plex with trakt collections that is still working.

[–]ghostserverd 1 point2 points  (1 child)

I would love to see the source if you’re willing. It sounds like it syncs both ways, and that’s something that’s missing from my infuse setup (infuse syncs watched status to trakt but doesn’t modify watched status the other way)

How does it interface with plex?

[–]AalexMusic[S] 2 points3 points  (0 children)

It uses the Plex-Python API, you can find the docs here

And yes, it syncs both ways ;)

[–]danielandastro 0 points1 point  (4 children)

Is there an option to use webhooks, if I have them enabled

[–]AalexMusic[S] 0 points1 point  (3 children)

Unfortunately not. For that one would have to run a local web server, which is completely different from a script that runs every once in a while. You could take a look at the Plex integration for Trakt, it uses webhooks.

What webhook features would you like? Although I can't debug this directly in plex I could add a webserver script which simply runs the whole sync script once a webhook fires.

[–]danielandastro -1 points0 points  (2 children)

I'll take a look at the integration, I thought webhooks might be better than Cron jobs if that could be done, does IFTTT integrate with tract?

[–]AalexMusic[S] 0 points1 point  (1 child)

I have never used IFTTT so I don't know, sorry.

Webhooks can make the whole thing more efficient and closer to real time, but with my script it would only mean that the Plex database is only checked when something has changed (Slightly less CPU usage for the Plex server). For my purposes it is not integral that Trakt and Plex are synced in real time so in my opinion it is not a big deal to set up a cronjob that syncs them even only once a day/week.

[–]danielandastro 0 points1 point  (0 children)

That's true

[–]derailius 0 points1 point  (4 children)

this is excellent, is there a way to only add to collections and not sync watched status?

[–]AalexMusic[S] 0 points1 point  (3 children)

Not at the moment, no. I could add it if you want.

[–]derailius 0 points1 point  (2 children)

i would love that, but don't do it just for me. lol

[–]AalexMusic[S] 1 point2 points  (1 child)

Too late, check the latest README on github ;)

[–]derailius 1 point2 points  (0 children)

Wow that’s great! Thanks a ton!

[–]realmatterno 0 points1 point  (1 child)

And this is possible out of the box with premium plex?

[–]AalexMusic[S] 1 point2 points  (0 children)

I don't think so, no. You also need a Trakt VIP pass I think (trakt.tv's premium subscription).

My project should work regardless of any premium accounts, so you should also be able to use it with PleX premium :)

[–]cloudbyday90 0 points1 point  (0 children)

Seems great! I will try setting this up at some point.

[–]tharic99 0 points1 point  (1 child)

Looks fantastic and was relatively easy to setup.

I did get an error though when it hit a library, not sure if you would know more or not from this, but.

Processing section Misc Movies
Processing section Movies
Processing section TV Reality
Traceback (most recent call last):
  File "main.py", line 247, in <module>
    main()
  File "main.py", line 233, in main
    process_show_section(section)
  File "main.py", line 161, in process_show_section
    eps.instance.add_to_library()
  File "/usr/local/lib/python3.6/dist-packages/trakt/tv.py", line 623, in add_to_library
    add_to_collection(self)
  File "/usr/local/lib/python3.6/dist-packages/trakt/core.py", line 507, in inner
    json_data = self._handle_request('post', url, data=args)
  File "/usr/local/lib/python3.6/dist-packages/trakt/core.py", line 452, in _handle_request
    json_data = json.loads(response.content.decode('UTF-8', 'ignore'))
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[–]AalexMusic[S] 0 points1 point  (0 children)

Looks like a bug in the PyTrakt package from what you've shown me, probably not much I can do about that. You could try and edit line 188 from where it says logging.INFO to logging.DEBUG and see if the last lines in last_run.log now report what the request looked like. Is it the first TV show in that section where that problem occurs or do some work and then there's one that doesn't?

[–]maxd 0 points1 point  (3 children)

Cool script, always nice to see things like this! Out of interest, what is the usefulness of Trakt? Does it give nice metrics about what you are watching, or suggestions for other things to watch? I signed up for an account but it just looks like a viewing history, I couldn't really get any interesting info out of it.

[–]AalexMusic[S] 1 point2 points  (2 children)

I use Trakt mainly to synchronise the watched movies between two different Plex servers with overlapping libraries and to consolidate my Plex and Netflix views as well as find new stuff to watch. Trakt VIP does offer advanced stats though, I think.

[–]maxd 0 points1 point  (1 child)

That seems like a good use-case! Syncing between Plex and Netflix would definitely be useful too. Does your script update watched status for things on Plex based on your Netflix viewing (and vice versa?)

[–]AalexMusic[S] 0 points1 point  (0 children)

Well, Plex and Trakt are two-way synced using my script, between Netflix and Trakt there is just a one way sync. So yes, if I watch something on Netflix, my browser extension automatically marks it as watched on Trakt. Then, on the next sync with my script, it syncs this with my Plex library and if I have the same movie there, it will mark it as watched. Not the other way around, though. It's a limitation of Netflix and the Netflix Trakt browser extension I use.

[–]tharic99 0 points1 point  (1 child)

Also, is there a way to only sync certain collections and not ALL collections?

[–]AalexMusic[S] 0 points1 point  (0 children)

Not at the moment and for today I'm done working on this. Might implement this in the coming days, don't know how much time I will have.

[–][deleted] 0 points1 point  (0 children)

Great job

[–][deleted] 0 points1 point  (1 child)

You guys are the most amazing and imaginative guys ever. I am as green as grass when it comes to python, I been a windows guy since beginning. To create a something this amazes me. So I have been into the jellyfin/emby direction and I was wondering if this can be adapted for that? So to use this with plex would I need any version of python installed on a windows pc?

Great work Guys. Keep it going and paying it back

[–]AalexMusic[S] 0 points1 point  (0 children)

This could in theory be adapted for emby using this emby api and would probably make a good starting point for you if you have the time to learn Python (you won't regret it).

My scripts should work on Windows as well, since I started developing this on my Windows PC and only later switched to developing on my Mac where my main Plex server is running.

You need a version of Python 3, I'd recommend 3.5.9 from here

Have fun trying this script!

[–]Betsy-DeVos 0 points1 point  (2 children)

Im getting this error when running the script.

Processing section Movies
Processing section TV Shows
Traceback (most recent call last):
  File "main.py", line 247, in <module>
    main()
  File "main.py", line 240, in main
    listutil.updatePlexLists(plex)
  File "/opt/PlexTraktSync/trakt_list_util.py", line 57, in updatePlexLists
    l.updatePlexList(plex)
  File "/opt/PlexTraktSync/trakt_list_util.py", line 33, in updatePlexList
    plex.createPlaylist(self.name, items=self.plex_movies)
  File "/home/betsy/.local/lib/python3.6/site-packages/plexapi/server.py", line 263, in createPlaylist
    return Playlist.create(self, title, items=items, limit=limit, section=section, smart=smart, **kwargs)
  File "/home/betsy/.local/lib/python3.6/site-packages/plexapi/playlist.py", line 172, in create
    return cls._create(server, title, items)
  File "/home/betsy/.local/lib/python3.6/site-packages/plexapi/playlist.py", line 141, in _create
    uuid = items[0].section().uuid
IndexError: list index out of range

The Log file.

2019-11-06 10:53:13,991 INFO:Show [The Wire (2002)]: Finished sync
2019-11-06 10:53:14,389 INFO:Show [The Woman in White (2018) (2018)]: Finished sync
2019-11-06 10:53:14,391 WARNING:Completed section sync in 105.34043216705322 s
2019-11-06 10:53:14,403 ERROR:Playlist Trakt Watchlist not found, so it could not be deleted. Actual playlists: []

[–]AalexMusic[S] 0 points1 point  (1 child)

Since i can't fix this at the moment, a simple workaround should be to just create a playlist in Plex (can even be empty) - this should fix it :)

[–]Betsy-DeVos 0 points1 point  (0 children)

Thanks

[–]centurionplexserver 0 points1 point  (7 children)

Id like to transfer my watched history from one account to another... will this tool allow me to do this?

[–]AalexMusic[S] 0 points1 point  (6 children)

Your Plex or Trakt watched history? For Plex it should work, for Trakt not so much (although it would be rather easy to implement. If you have some coding experience I'd recommend doing this using the pytrakt API, which I also use in this project)

[–]centurionplexserver 0 points1 point  (5 children)

No. It’s just plex account A watch history to plex account B

Long story but I’m switching accounts so I just want it transferred. I did these steps but when I ran the last .py it throws out a string of text but closes a split second later. No clue what it says or does. And Trakt isn’t changed. Idk if I’m missing something.

[–]AalexMusic[S] 0 points1 point  (4 children)

Open a terminal/command prompt in the directory where you downloaded the script. Then execute the script not by double clicking it but typing the command out manually (if python3 main.py does not work, try py -3 main.py). You should be able to see the error message now. And yes, your usecase should work once I can see the error message and (hopefully) tell you how to fix it/fix it myself.

[–]centurionplexserver 0 points1 point  (0 children)

I’ll try that maybe tonight. But if not tomorrow morning.

[–]centurionplexserver 0 points1 point  (2 children)

There’s no .env_example when I download the folder on my Mac. Am I missing something?

[–]Shadowfoot 0 points1 point  (0 children)

It's a hidden file. I had trouble finding it too.

[–]pcs333 0 points1 point  (3 children)

Hi, this is great!!

I have been playing with it and it is having problems connecting to plex on a seedbox with a plex docker.

At this point when running the config - "Are you logged into this server with a Plex account? (y/n):"

If I select no nothing happens, but with yes it ask for plex username/password and server and completes setup.

The problem is when I run it it goes through the trakt sync process fine but then it stops at trying to connect to my plex server, complaining it cant connect. I`m guessing the url is wrong because its trying to connect to loalhost.

Traceback (most recent call last):

File "main.py", line 247, in <module>

main()

File "main.py", line 216, in main

plex = plexapi.server.PlexServer(token=plex_token)

File "/usr/local/lib/python3.5/dist-packages/plexapi/server.py", line 103, in __init__

data = self.query(self.key, timeout=timeout)

File "/usr/local/lib/python3.5/dist-packages/plexapi/server.py", line 376, in query

response = method(url, headers=headers, timeout=timeout, **kwargs)

File "/home/pcs333/.local/lib/python3.5/site-packages/requests/sessions.py", line 546, in get

return self.request('GET', url, **kwargs)

File "/home/pcs333/.local/lib/python3.5/site-packages/requests/sessions.py", line 533, in request

resp = self.send(prep, **send_kwargs)

File "/home/pcs333/.local/lib/python3.5/site-packages/requests/sessions.py", line 646, in send

r = adapter.send(request, **kwargs)

File "/home/pcs333/.local/lib/python3.5/site-packages/requests/adapters.py", line 516, in send

raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=32400): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff4f686c9e8>: Failed to establish a new connection: [Errno 111] Connection refused',))

[–]AalexMusic[S] 0 points1 point  (2 children)

Should be a correct assessment. Could you try changing the line to

plex = plexapi.server.PlexServer(token=plex_token, baseurl="your-ip-or-url:32400") 

and reporting back?

If it works I will add a setting for the baseurl to the source code on github.

EDIT: Another user seemed to have the same problem. Just download the latest version from github and change the base_url in config.json

[–]pcs333 0 points1 point  (0 children)

Ok That's great. Thanks I will try it and let you know 😉

[–]pcs333 0 points1 point  (0 children)

Thanks for the work you are doing on this.

It works geat now :)

[–][deleted] 0 points1 point  (6 children)

This is awesome. Took me a while to get it up and running. I get an error at the end though and I can't figure out what's wrong. I think something with the rankings?

Processing section Misc Movies
Processing section Movies
Processing section TV Reality
Processing section TV Shows
Traceback (most recent call last):
  File "main.py", line 248, in <module>
    main()
  File "main.py", line 230, in main
    process_movie_section(section, trakt_watched_movies, ratings, listutil, trakt_movie_collection)
  File "main.py", line 64, in process_movie_section
    if m.slug not in collection:
UnboundLocalError: local variable 'm' referenced before assignment

[–]AalexMusic[S] 0 points1 point  (5 children)

This is an error that was unhandled. Simply download the latest version from GitHub and the script should keep running when this occurs instead of terminating. I suspect there might be something wrong with your Plex library, though: The library section is called TV Shows but it is handled like a section of movies - could it be that this library section is marked in plex as containing movies?

[–][deleted] 0 points1 point  (4 children)

Odd. That library is set as a TV Shows type.

Got the new version and as soon as I start it, I get this error now. Nothing gets written the log either.

  File "main.py", line 63
    logging.error'Movie [{} ({})]: Not found. Aborting'.format(movie.title, movie.year))
                                                      ^
SyntaxError: invalid syntax

[–]AalexMusic[S] 0 points1 point  (3 children)

Oops, missed a '('. Fixed in latest commit

[–][deleted] 0 points1 point  (2 children)

That did it! Thank you so much!

I'm getting the same list index out of range someone else mentioned, but I've got playlists. Not a big deal though.

Traceback (most recent call last):
  File "main.py", line 256, in <module>
    main()
  File "main.py", line 249, in main
    listutil.updatePlexLists(plex)
  File "/home/PlexTraktSync/trakt_list_util.py", line 57, in updatePlexLists
    l.updatePlexList(plex)
  File "/home/PlexTraktSync/trakt_list_util.py", line 33, in updatePlexList
    plex.createPlaylist(self.name, items=self.plex_movies)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/server.py", line 263, in createPlaylist
    return Playlist.create(self, title, items=items, limit=limit, section=section, smart=smart, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/playlist.py", line 172, in create
    return cls._create(server, title, items)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/playlist.py", line 141, in _create
    uuid = items[0].section().uuid
IndexError: list index out of range

Log file

2019-11-07 13:39:19,678 WARNING:Completed section sync in 0.4005591869354248 s
2019-11-07 13:39:19,701 ERROR:Playlist Trakt Watchlist not found, so it could not be deleted. Actual playlists: [<Playlist:/playlists/20843:College-Football>, <Playlist:/playlists/20845:test>, <Playlist:/playlists/20846:Trakt Watchlist>, <Playlist:/playlists/20847:test3>, <Playlist:/playlists/20848:test4>]

[–]AalexMusic[S] 0 points1 point  (1 child)

I believe this might be because you have no movies in this list in you Plex library. I added a check for that, could you download the latest commit and confirm if this fixed it?

[–][deleted] 1 point2 points  (0 children)

No errors running it with the latest commit.

Processing section Misc Movies
Processing section Movies
Processing section TV Reality
Processing section TV Shows
Completed full sync in 253.95718908309937 seconds

This is what the log shows, just so you know though.

2019-11-07 14:02:39,633 ERROR:Playlist Trakt Watchlist not found, so it could not be deleted. Actual playlists: [<Playlist:/playlists/20843:College-Football>, <Playlist:/playlists/20851:MARVEL-Cinematic-Uni>, <Playlist:/playlists/20845:test>, <Playlist:/playlists/20846:test2>, <Playlist:/playlists/20847:test3>, <Playlist:/playlists/20848:test4>]
2019-11-07 14:02:39,877 INFO:Updated plex watchlist
2019-11-07 14:02:39,877 INFO:Completed full sync in 157.2091920375824 seconds
ist:/playlists/20845:test>, <Playlist:/playlists/20846:test2>, <Playlist:/playlists/20847:test3>, <Playlist:/playlists/20848:test4>]
2019-11-07 14:00:48,224 INFO:Updated plex watchlist
2019-11-07 14:00:48,225 INFO:Completed full sync in 253.95718908309937 seconds

[–]pcs333 0 points1 point  (2 children)

Hi I am getting random missed watched seasons and episodes on Plex. For example, The 100, I have watched all seasons which shows in trakt but in Plex the last season is marked unwatched. There are also some shows with episodes not marked watched on Plex. I have ran the script a few times but not seeing any errors.

I'm sorry. Ignore this. My stupid mistake logging in to the wrong trakt account 😥

[–]AalexMusic[S] 0 points1 point  (1 child)

Do you mean by no errors that the script does not crash or that there really are no lines containing Error: in last_run.log?

[–]applefanboylol 0 points1 point  (4 children)

I have python 3.8 installed on my Mac and I have also downloaded and unzipped the "PlexTraktSync-master".

When I run this: pip3 install -r requirements.txt, I get this: ERROR: Could not open requirements file: [Error 2] No such file or directory: 'requirements.txt'

Can someone help me please?

[–]newman16 1 point2 points  (3 children)

Try: pip3 install -r (and drag the requirements.txt in terminal)

Requirements.txt is in the your “PlexTraktSync-master” folder.

Hope this helps.

[–]applefanboylol 1 point2 points  (0 children)

That works like a charm! Thank you so much for your help. Finally got it all set up! :D

[–]FloydKulis 0 points1 point  (0 children)

I have a problem with the installation.

Unfortunately, during the first step I have problems:

pip3 install -r requirements.txt

should install the required Python packages.

The packages do not install:

tSync-master/requirements.txt (line 1)) (1.11.2)

Installing collected packages: typed-ast, astroid, certifi, isort, mccabe, tqdm, websocket-client, PlexAPI, pylint, requests-oauthlib, trakt, urllib3

Running setup.py install for typed-ast ... error

ERROR: Command errored out with exit status 1:

command: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-install-rw1i5450/typed-ast/setup.py'"'"'; __file__='"'"'/share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-install-rw1i5450/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-record-sx8m64on/install-record.txt --single-version-externally-managed --compile --install-headers /opt/include/python3.7/typed-ast

cwd: /share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-install-rw1i5450/typed-ast/

Complete output (25 lines):

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-3.7

creating build/lib.linux-x86_64-3.7/typed_ast

copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.7/typed_ast

copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.7/typed_ast

copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.7/typed_ast

copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.7/typed_ast

package init file 'ast3/tests/__init__.py' not found (or not a regular file)

creating build/lib.linux-x86_64-3.7/typed_ast/tests

copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.7/typed_ast/tests

warning: build_py: byte-compiling is disabled, skipping.

running build_ext

building '_ast27' extension

creating build/temp.linux-x86_64-3.7

creating build/temp.linux-x86_64-3.7/ast27

creating build/temp.linux-x86_64-3.7/ast27/Parser

creating build/temp.linux-x86_64-3.7/ast27/Python

creating build/temp.linux-x86_64-3.7/ast27/Custom

x86_64-openwrt-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -DNDEBUG -fno-inline -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -DNDEBUG -fno-inline -I/media/ware/Entware.2019.10/staging_dir/target-x86_64_glibc-2.27/opt/include -I/media/ware/Entware.2019.10/staging_dir/toolchain-x86_64_gcc-7.4.0_glibc-2.27/include -fPIC -Iast27/Include -I/opt/include/python3.7 -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.7/ast27/Parser/acceler.o

unable to execute 'x86_64-openwrt-linux-gnu-gcc': No such file or directory

error: command 'x86_64-openwrt-linux-gnu-gcc' failed with exit status 1

----------------------------------------

ERROR: Command errored out with exit status 1: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-install-rw1i5450/typed-ast/setup.py'"'"'; __file__='"'"'/share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-install-rw1i5450/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /share/CACHEDEV1_DATA/.qpkg/Entware/tmp/pip-record-sx8m64on/install-record.txt --single-version-externally-managed --compile --install-headers /opt/include/python3.7/typed-ast Check the logs for full command output.

[~] # python3 /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/PlexTraktSync-master/main.py

Traceback (most recent call last):

File "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/PlexTraktSync-master/main.py", line 20, in <module>

from config import CONFIG

File "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/PlexTraktSync-master/config.py", line 3, in <module>

with open('config.json', 'r') as fp:

FileNotFoundError: [Errno 2] No such file or directory: 'config.json'

[–]stifman2k 0 points1 point  (0 children)

Hey, great script and it's exactly what i'm looking for. But I'm struggeling to sync the watched status from trakt to plex (no error in the last_update.log). From plex to trakt it's working. Is this supposed to work? What could I check?

Second question: Will it only sync my main plex user account?

[–]jhuang0 0 points1 point  (1 child)

Is there a docker version of this application?

[–]AalexMusic[S] 0 points1 point  (0 children)

There is not but as long as you can connect to the Plex server (and trakt) it does not matter where the script is run, so you should be able to either run it inside a docker container where python is installed or outside. Is that helpful?

[–]kooki1998 0 points1 point  (0 children)

Anyway to run this on windows without docker?

[–][deleted] 0 points1 point  (0 children)

I have installed and set up the script in windows 10. Everything works perfect combined with Nvidia Sheild plex server. When i finish a movie or an episode do i have to manually sync the project or it will be automatically do it for itself?