aymene69 / stremio-jackett

Elevate your Stremio experience with seamless access to Jackett torrent links, effortlessly fetching torrents for your selected movies within the Stremio interface.
193 stars 34 forks source link

Fixed: torrent hashes, hard filtering on series, magnet links, announ… #129

Closed itsvncl closed 6 months ago

itsvncl commented 6 months ago

Hey there!

I found a few major issues durring the magnet link creation. I also tried to add some fallback to hard filters, to save same poorly names torrents.

aymene69 commented 6 months ago

Hi! Thanks for your contribution!

It seems to work fine on movies as far as I tested

The problem is with series. I searched for Simpson S10E02 and it gave me S30 results instead.

itsvncl commented 6 months ago

Hi! Thanks for your contribution!

It seems to work fine on movies as far as I tested

The problem is with series. I searched for Simpson S10E02 and it gave me S30 results instead.

That is 100% correct and a huge oversight from my side. I'm reverting the changes I made to searching.

What I was trying to achieve is to let torrents that are named like: "Simpsons S01-S06" appear for a search for lets say S03, since it really is in the S01-S06 time frame. And an even more extreme situation where the torrent name is something like: "Simpsons - COMPLETE", or maybe even just "Simpsons".

What should be done is to do the filtering at torrent level (if there is a torrent file of course). I mean something like this:

response = requests.get(torrentLink)
torrent = bencode.bdecode(response.content)
filtered_files = series_file_filter(torrent['info']['files'], season, episode)
video_file = max(filtered_files, key=lambda x: x['length'])
episodeFileIdx = video_file['index']

Where the series_file_filter is like the one I did in filter_results.py If the chosen Season and Episode is in someway inside of the torent's files, then it should be shown.

Also in this case it might be a good idea to only show the filename inside of the torrent and it's size to the end user and not the entire torrent.

On foreign trackers (in my case Hungarian) this occurance of bundled series are super common. One example is if I search for "Prison Break" on iTorrent, the only result is "Prison.Break.The.Complete.Series".