FuzzyGrim / Yamtrack

A self hosted media tracker.
GNU Affero General Public License v3.0
172 stars 1 forks source link

Feature: Tracktv integration #144

Closed PedroBuffon closed 4 weeks ago

PedroBuffon commented 6 months ago

I'm on the process of ditching simkl and tracktv all together and Yamtrack does exactly what i need and is selfhosted, i tried importing my simkl csv to yamtrack but isn't quite the same type of csv. It's for that reason that i'll not ditch completely simkl and tracktv. Is there a roadmap or future plan to integrate those APIs or csv files?

FuzzyGrim commented 6 months ago

Yes, they are planned features

Azmarine13 commented 6 months ago

Would love to have SIMKL API Integration as well 👍

P.S- SIMKL has various ID's connected like TVDB, TMDB, Anilist, MyAnimeList, etc

reitenth commented 6 months ago

also would like a trakt import option. cant get my movies and tv shows in atm.

sahara101 commented 2 months ago

Yes, trakt import would be awesome. I will never stop using trakt because it is a spectacular page but I would also like something selfhosted.

Cwavs commented 1 month ago

I see trakt integration was added, I can't seem to get it to import, whenever I enter my username in, it say's "User cwavs not found." I presume I'm missing something and I need to put an ID in as the box says username slug, not username.

FuzzyGrim commented 1 month ago

The error message was caused by Trakt giving invalid TMDB ids for certain media, I just created a new release that will ignore these media and indicate which they are in the result and also improved error handling.

Cwavs commented 1 month ago

Thanks! It does look to be working now, although it looks to be importing completed seasons/shows as watching rather than complete, is this intended?

FuzzyGrim commented 1 month ago

The seasons that are marked as watching are the ones that either you haven't completed or the ones that have episodes with multiple watches that with some previous code logic detected it as rewatching.

Although, seeing how many episodes you've rewatched with no intention of rewatching the season, I wonder if what I have now is a correct approach.

Cwavs commented 1 month ago

Hmmm I think I know the cause. There are quite a few occasions where I've started watching a show and stopped part way through for one reason or another. Then at a later date I come back and start from scratch to account for my memory fading, so I may have a few episodes I have indeed watched multiple times despite not re watching the show per se.

I have also sometimes re watched individual episodes, particularly with more episodic shows (like Red Dwarf, or Doctor Who)

I'm not really sure how common that edge case is or how much it's worth accounting for to be honest.

GIorfindel commented 4 weeks ago

Hi, I tried the Trakt integration and I get this error after a few shows are imported:

Traceback (most recent call last):

  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 453, in trace_task

    R = retval = fun(*args, **kwargs)

                 ^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 736, in __protected_call__

    return self.run(*args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/yamtrack/integrations/tasks.py", line 18, in import_trakt

    ) = trakt.importer(username, user)

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/yamtrack/integrations/imports/trakt.py", line 36, in importer

    shows_msg, shows_num = process_watched_shows(

                           ^^^^^^^^^^^^^^^^^^^^^^

  File "/yamtrack/integrations/imports/trakt.py", line 113, in process_watched_shows

    add_tmdb_episodes(entry, season, user)

  File "/yamtrack/integrations/imports/trakt.py", line 316, in add_tmdb_episodes

    metadata = get_metadata(

               ^^^^^^^^^^^^^

  File "/yamtrack/integrations/imports/trakt.py", line 482, in get_metadata

    return fetch_func(*args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/yamtrack/app/providers/tmdb.py", line 123, in tv_with_seasons

    response[f"season/{season_number}"],

    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^

KeyError: 'season/3'
FuzzyGrim commented 4 weeks ago

Hi, just pushed a release that should fix it.

GIorfindel commented 4 weeks ago

Hi, just pushed a release that should fix it.

Indeed, it is working now, thank you so much.

FuzzyGrim commented 3 weeks ago

@PedroBuffon @Azmarine13

Hey I have created a separate issue #233 to track the progress of the Simkl integration, the API to import from Simkl needs account authentication so it limits my testing. I would appreciate if you could test the Simkl integration using the image tag pr-245 in your docker-compose.yml:

image: ghcr.io/fuzzygrim/yamtrack:pr-245.

You will need your own API keys which will need to be set with environment variables as SIMKL_ID and SIMKL_SECRET.