morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.87k stars 223 forks source link

does not find some things on Subdivx #2378

Closed rmichelena closed 9 months ago

rmichelena commented 9 months ago

Bazarr 1.4.1

I have configured many providers, among them OS (.com) and Subdivx

manual search for Inspector Montalbano S09E03 only returns results from OS

Screenshot 2024-02-06 at 14 27 12

however checking out Subdivx, there are Spanish subs there too (and are better!)

Screenshot 2024-02-06 at 14 29 13

things to think about:

so could it be that on Subdivx it's only searching the main (English) title, and not the alternate ones? (among which is the original title too!)

morpheus65535 commented 9 months ago

I can confirm that subdivx provider isn't using alternative_titles at all while searching, only the main title.

This would be a nice improvement but requires to rework the search logic. I'm open to PR if you're willing to give it a try. I don't have time for this right now.

rmichelena commented 9 months ago

is this only on Subdivx, or are many providers searching only by main title? main title (e.g. English if your Sonarr is configured so) is so often not the original one, which is the one most likely to get results...

morpheus65535 commented 9 months ago

is this only on Subdivx, or are many providers searching only by main title? main title (e.g. English if your Sonarr is configured so) is so often not the original one, which is the one most likely to get results...

Short answer: it's up to each provider to decide.

Long answer: The way subliminal (on top of which Bazarr is built) let each provider implement requests to websites. This is done using the "query" method that may use video.title alone or video.alternative_titles if required. Many providers search using both but some don't.

rmichelena commented 9 months ago

Ok I've made some progress... I've been able to modify the Subdivx provider to use also the alternative titles... but it seems I've broken the logic that discards the non-matching season-episode combinations... so, some more work to do :)

rmichelena commented 9 months ago

DAMN IT!! just when I had nailed it, Subdivx totally revamped their site. Now nothing works, not my version nor the previous one. I don't think I'll be able to fix it, one thing is to have good logic and some python, another is to do webscraping scripts.

morpheus65535 commented 9 months ago

It changed that much?

rmichelena commented 9 months ago

Totally... but now it should be simpler: the existing script was using GET with a query-constructed URL, and receiving HTML and parsing/scraping from it, and handling multiple pages. Now it's a POST request with query payload, and receives a response in JSON with all subtitles at once. So it should be much easier, but it's some work. I'm on it. ChatGPT is the one that's been helping me from the start, but lately it's become kinda reluctant to just write the complete code, nowadays it goes more like "here's an example" or "here's the concept".

morpheus65535 commented 9 months ago

Keep up the good work! Thanks!

rmichelena commented 9 months ago

Ok !! code could be improved, but seems to work fine - finds and downloads. I have no idea how to post it to the repository, so I've just attached it here. subdivx_v5.py.zip

rmichelena commented 9 months ago

subdivx_v6.py.zip

they made a change again, subtle, but here taken into account

morpheus65535 commented 9 months ago

Should be good in upcoming beta. Thanks!