kodi7rd / kodi7rd.github.io

GNU General Public License v3.0
5 stars 1 forks source link

Advanced Search Checkbox 'WithSubsOnly' Not Returning Correct Results on Ktuvit #2

Closed Nitzantomer1998 closed 3 weeks ago

Nitzantomer1998 commented 5 months ago

Hi,

I'm currently developing an addon for Stremio that utilizes Ktuvit and wanted to share some insights based on my experience with your project which been a guideline to mine.

Firstly, thank you for your work on the Ktuvit API. As you likely know, Ktuvit's architecture and structure are quite problematic, requiring scanning over an HTML page, not utilizing imdbID and such.

I've discovered an issue with the advanced search function. If you check the "WithSubsOnly" checkbox, it unfortunately doesn't filter good enough, it may block you result that tag as no subtitles when they actually has due to poor design.

For example, try searching for the TV series "The Gentlemen" (tt13210838) in the advanced search. If you check the "WithSubsOnly" checkbox, it won't show up. However, if you leave the checkbox unchecked, the series will appear and you will find subtitles available within the results.

https://github.com/kodi7rd/kodi7rd.github.io/blob/de902b5362d370a58d6fdce404270a831269164b/builds/build21_kodirdil/build21_kodirdil/addons/service.subtitles.All_Subs/resources/sources/ktuvit.py#L178

Note: I saw you set it to True only if its a movie, i didn't encounter yet a case of movie that act like it but its most likely from the same reasons will be the same.

TwilightMercy commented 5 months ago

This is indeed poor Ktuvit design.

In advanced search, WithSubsOnly=True will never work for TV Shows, any TV Show: image

Therefore it has to always be False for TV Shows.

For Movies: WithSubOnly=True does work properly and filter out movies with 0 subtitles uploaded.

When you search for a movie in advanced search - Ktuvit always limits the results to 20 in the results page. (It has button to load more results, but I couldn’t make it work with Page=2 param in request)

If you’ll search for the movie “Barbie” (2024) with WithSubsOnly=False, You’ll get 20 results of old Barbie movies, and 2024 movie won’t be there.

But with WithSubsOnly=True - it filters out movies with no subtitles, and Barbie 2024 appears in the results.

image

TwilightMercy commented 5 months ago

Now, In your code you provide to search:

https://github.com/Nitzantomer1998/StremioHebSubs/blob/d6b52d099afdbd1054d2e65a712660fe6aa8a7ea/src/helpers/ktuvitHelper.js#L92

And then take the first result’s ID: https://github.com/Nitzantomer1998/StremioHebSubs/blob/d6b52d099afdbd1054d2e65a712660fe6aa8a7ea/src/helpers/ktuvitHelper.js#L100

The reason I search without any year parameter at all, is to avoid IMDb/TMDb year mismatch which will bring 0 results to search.

Example: IMDb - Talk To Me (2022) https://m.imdb.com/title/tt10638522/

TMDb - Talk To Me (2023) https://www.themoviedb.org/movie/1008042-talk-to-me

If the metadata that Kodi/Stremio gets from the addon (try TMDb catalogs addon) - It will provide year=2023 and will bring 0 results. (in Ktuvit the year is 2022 from IMDb)

image

Now for “Talk To Me” exmaple - you get 2 results from search and auto choosing the first result is incorrect: image

That’s the reason I don’t provide year to search, and filter the correct result from Ktuvit using:

TwilightMercy commented 5 months ago

Looping through Ktuvit results, and looking for IMDb match between ktuvit result and metadata from Kodi/Stremio:

https://github.com/kodi7rd/kodi7rd.github.io/blob/master/builds/build21_kodirdil/build21_kodirdil/addons/service.subtitles.All_Subs/resources/sources/ktuvit.py#L210

The function extract_imdb_id_from_result: https://github.com/kodi7rd/kodi7rd.github.io/blob/master/builds/build21_kodirdil/build21_kodirdil/addons/service.subtitles.All_Subs/resources/sources/ktuvit.py#L190

First extracts from Ktuvit’s JSON result the IMDb ID from IMDB_Link which is always the correct IMDb id!

And as fallback, uses the standalone ImdbID parameter which is inconsistent and have typos in alot of movies/tv shows in Ktuvit.

This method has overtime proved itself to be accurate and consistent.

Nitzantomer1998 commented 5 months ago

Oh man, I swear I hate it when things don't work as they should. The mismatch between IMDb and TMDb is a significant flaw.

The functionality of the Ktuvit website is seriously lacking. I wish there was a way to contact the developer and suggest collaborating to rebuild the website from scratch.

Just to note, I'm fetching data about a Movie/TV Series using IMDb, so it matches Ktuvit. Therefore, I don't have that problem.

Example: IMDb - Talk To Me (2022) https://m.imdb.com/title/tt10638522/

TMDb - Talk To Me (2023) https://www.themoviedb.org/movie/1008042-talk-to-me

Note: using the library name-to-imdb is sadly not stable and doesnt always work, looked for using TMDb but after knowing this issue i will search for only IMDb.