tomasklaen / uosc

Feature-rich minimalist proximity-based UI for MPV player.
GNU Lesser General Public License v2.1
1.68k stars 66 forks source link

Troblue searching for Brazilian Portuguese subtitles #898

Closed Blasg2 closed 1 week ago

Blasg2 commented 4 months ago

The subtitles exist on opensubtitles, and i tried adding some variations on uosc languages config but i'm probably writing something wrong. I tried with "pt-br" just "br". How would the full line of the code be?

ps: i still want to keep searching in en, but also for brazilian portuguese. ps2: idk if this is possible but it would be cool to implement a search on mpv and right click to go to the opensubtitles link for it, so the 5 subs per day limit is a little easier to deal with.

tomasklaen commented 4 months ago

We just use opensubtitles' v1/subtitles API endpoint with query, hash, and languages parameters.

There isn't an easy way for you to get the file hash, but you can try query + languages search yourself here: https://opensubtitles.stoplight.io/docs/opensubtitles-api/a172317bd5ccc-search-for-subtitles

And according to their language code docs, I think the code for portuguese should be pt-pt, or pt-br.

If you give me some example queries that have subtitles on opensubtitles, but uosc is not returning anything, I'd look into it. It is possible I messed up setting language parameters in our requests.

Opening opensubtitles page should be doable, once we have menu item buttons. Dunno when I'll get to it :(

tomasklaen commented 1 week ago

Commit above adds the aforementioned "Open in browser" button.

Due to no reply and none else complaining, I'll close this for now. If someone provides an API query to opensubtitles that returns results but uosc returns nothing so I can look into it, I'll reopen.