itsToggle / plex_debrid

Plex torrent streaming through Debrid Services
1.51k stars 130 forks source link

downloading of wrong shows with similar name #147

Closed itsToggle closed 2 years ago

ghost commented 2 years ago

I was about to raise this issue as I added 'See' apple Tv original and the script downloaded SeeDadRun TV series with all of it's three seasons without downloading the actually requested 'See' series. You can try from your end as well. Also I am facing one issue with deletion. So the behavior of deleting content should be supplemented with removal of the content from the watchlist. I believe this is more of an issue from Plex end which we can not resolve but as suggested earlier, if we are creating automatic watched content deletion then if the entire series is marked for deletion then our script should automatically remove the content from the watchlist too. I will create a separate issue for this one though mentioning all details.

itsToggle commented 2 years ago

Hey, as stated in the readmes' "limitations" section, this issue has been known for quite a bit but I think I thought of some stuff now to address it :)

plex_debrid accepts releases whos title deviates a bit from the original search-query. This allows plex_debrid to download a release named "some.show.2018.season.1.S01", when the original search query was "some.show.S01". This usually works fine, but it does lead to problems when downloading shows which have similar titles like "NCIS" and "NCIS: Los Angeles".

ghost commented 2 years ago

Hey yes I am ware of this issue but my real concern is not this but if the script somehow detects that the user just deleted an entire unwatched series then to prevent downloading the similarly named show by removing the series from the watchlist is the ideal situation here. Because in my case the 'See' series never got downloaded but I got more than 400 entires for 'SeeDadRun' series created as I thought my internet connection was behaving funnily and hence that unwatched 'SeeDadRun' was not getting deleted. In fact, it was getting deleted from one end by Plex but then our script was detecting new unwatched episodes and was downloading it again!🤣

itsToggle commented 2 years ago

Oh shit! Yeah I hadn't thought of that, of course. You can choose to automatically remove shows from your watchlist after they have been downloaded by going to /Settings/Content Services/Plex/Plex Auto remove/ - that might be the easiest way, at least until I fix this :)

There is sadly no easy way to connect the deletion of media through Plex to a removal from the watchlist.

ghost commented 2 years ago

No I would leave the settings as is (i.e. deleting only movies from the watchlist) because there are several shows me and my family watching and their new episodes are currently being released on a weekly basis. I am manually deselecting the shows which are having conflicts. Yes and I totally understand that there is no connection between Plex and our script but thought that we could have more advantage if we are using your rclone fork? I mean can we see the last timestamp of deleted file or something like that? Or perhaps that rclone fork triggering our script to delete the media from our watchlist?

itsToggle commented 2 years ago

Yeah that would be the only solution I can think of aswell, I'll think about it!

joshali1990 commented 2 years ago

I wonder if you could use https://thexem.info/ for series like sonarr does for mapping? That way you can map between tvdb id and the correct search terms from the scene.

itsToggle commented 2 years ago

alright so I think Ive fixed it. Im now only allowing specific title deviations to be acceptable. The acceptable deviations include the word "season" and the release year, with one character inbetween. The show "See" has downloaded without getting any wrong releases, so I hope this fixes these issues.

itsToggle commented 2 years ago

mapping, aswell as a search by imdb ID could of course work aswell, but both would be slower and less compatible.

joshali1990 commented 2 years ago

It works for items in the Plex watchlist, but not trakt:

File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self.run() File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self.run() File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, self._kwargs) self._target(*self._args, *self._kwargs) File "/Volumes/external/plex_rd.py", line 3049, in download File "/Volumes/external/plex_rd.py", line 3049, in download self._target(self._args, self._kwargs) File "/Volumes/external/plex_rd.py", line 3049, in download result[index] = cls.download(library=library,parentReleases=parentReleases) File "/Volumes/external/plex_rd.py", line 550, in download result[index] = cls.download(library=library,parentReleases=parentReleases) result[index] = cls.download(library=library,parentReleases=parentReleases) File "/Volumes/external/plex_rd.py", line 550, in download File "/Volumes/external/plex_rd.py", line 550, in download altquery = self.deviation() File "/Volumes/external/plex_rd.py", line 173, in deviation altquery = self.deviation() File "/Volumes/external/plex_rd.py", line 173, in deviation return '(' + title + '.)(' + str(self.year) + '.)?(season.[0-9]+.)?' + '(S' + str("{:02d}".format(self.index)) + '.)' altquery = self.deviation() File "/Volumes/external/plex_rd.py", line 173, in deviation AttributeError: 'season' object has no attribute 'year' return '(' + title + '.)(' + str(self.year) + '.)?(season.[0-9]+.)?' + '(S' + str("{:02d}".format(self.index)) + '.)' AttributeError: 'season' object has no attribute 'year' return '(' + title + '.)(' + str(self.year) + '.)?(season.[0-9]+.)?' + '(S' + str("{:02d}".format(self.index)) + '.)' AttributeError: 'season' object has no attribute 'year' [2022-09-27 15:39:28.326379] took 36.64s [2022-09-27 15:40:19.998434] [plex] item: "See" found in joshali1990s watchlist [2022-09-27 15:40:20.436168] [plex] getting entire plex library ... done [2022-09-27 15:40:21.457730] checking new content ... done [2022-09-27 15:40:22.292931] scraping sources for query "see" ... done - found 778 releases [2022-09-27 15:40:59.172430] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:40:59.199544] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:40:59.201177] scraping sources for query "see.S01." ... done [2022-09-27 15:40:59.376678] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:40:59.379561] scraping sources for query "see.S03." ... done [2022-09-27 15:41:01.993250] [realdebrid] adding cached release: See.S02.SweSub-EngSub.1080p.x264-Justiso [2022-09-27 15:41:11.584911] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:41:11.585464] scraping sources for query "see.S03" ... done [2022-09-27 15:41:11.729858] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:41:18.488570] [realdebrid] adding cached release: See.S01.1080p.WEBRip.x265-RARBG [2022-09-27 15:41:55.114950] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:41:56.870309] [realdebrid] adding cached release: See.S03E01.1080p.HEVC.x265-MeGusta [2022-09-27 15:41:57.058229] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:41:58.826452] [realdebrid] adding cached release: See.S03E02.1080p.HEVC.x265-MeGusta [2022-09-27 15:41:59.023915] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:42:01.011804] [realdebrid] adding cached release: See.S03E03.1080p.HEVC.x265-MeGusta [2022-09-27 15:42:01.253898] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:42:02.978876] [realdebrid] adding cached release: See.S03E04.1080p.HEVC.x265-MeGusta [2022-09-27 15:42:03.366458] attempting to download version 1/1: "(1080p)" ... done [2022-09-27 15:42:04.966856] [realdebrid] adding cached release: See.S03E05.The.House.of.Enlightenment.1080p.ATVP.WEBMux.HEVC.ITA.ENG.DDP5.1.Atmos.x265-BlackBit.mkv [2022-09-27 15:42:04.968242] [plex] item: "See" removed from joshali1990s watchlist [2022-09-27 15:42:05.308715] took 103.02s [2022-09-27 15:42:05.308808] refreshing library section 1

itsToggle commented 2 years ago

fuck me I always forget about trakt. give me a sec.

itsToggle commented 2 years ago

yeah should be fixed now