Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find subtitles in some languages (French, Spanish, German, Russian, Romanian) as their language tag (mpv.conf, slang=) crash/disable uosc #792

Closed
cipricus opened this issue Nov 12, 2023 · 6 comments

Comments

@cipricus
Copy link

cipricus commented Nov 12, 2023

I have updated the title of the issue to reflect the conclusions I have arrived at after more testing. See them here.


As per this comment, and uosc settings download-subtitles:

We fetch results for languages defined in uosc*'s languages option, which defaults to your mpv slang configuration.

relating to slang mpv.conf setting.

Editing ~/.config/mpv/mpv.conf, I have added slang=ron,fra,it to get subtitles in Romanian, French and Italian. But only Italian subs are found (beside English). I have tested with a Chaplin movie where SMPlayer and VLC also list French and Romanian subs.

I have also used rou, ron and rum for Romanian, and fre for French, with the same result.

Oddly, some formats crash or disable uosc completely, like ro and fr, but others, which mean nothing, used just to test the matter, have no bad effect (like slang=roux,frex,itx, xxx). I read at https://mpv.io/manual/stable/ that for slang are to be used IETF language tags. Equivalent ISO 639-1 two-letter and ISO 639-2 three-letter codes are treated the same. The IETF tag for French is fr! slang=fr disables uosc! the same with ro for Romanian!

Maybe I'm not putting the correct formats for French and Romanian. Am I?

Another odd thing: I had to remove other subtitle scripts (namely, autosubsync) in order to have the slang option active at all (before that, not even Italian was found, just English).

The only other formats that I was able to confirm to be correct and working were Hungarian (hu) and Bulgarian (bg).

By the way: is there an all setting so that all available subs are listed?

How could I get access to French and Romanian subtitles?

@cipricus cipricus changed the title Setting more languages for subtitle download crashes uosc Some language 'slang' settings in mpv.conf crash uosc Nov 12, 2023
@cipricus cipricus changed the title Some language 'slang' settings in mpv.conf crash uosc Problems with 'slang' option in mpv.conf for other subtitle languages beside English Nov 12, 2023
@tomasklaen
Copy link
Owner

Can't replicate. It'd be useful to provide crash logs. They should be visible in console, which by default is bound to ` key.

And I don't think all is supported, as why would anyone want to see results from all languages 99% of which they don't speak, but you can dig yourself: https://opensubtitles.stoplight.io/docs/opensubtitles-api/a172317bd5ccc-search-for-subtitles

@cipricus
Copy link
Author

cipricus commented Nov 13, 2023

crash logs

Running with --slang=fr (which disabled uosc) I see is this:

image

All lines above [cplayer] seem to be related to the errors involved, because they are absent when running without --slang=fr (and without the line slang=fr in mpv.conf).

Can't replicate

  • You mean that something like mpv --slang=fr --player-operation-mode=pseudo-gui SOME_MOVIE still shows uosc? (In my case it reverts to default pseudo-gui - in case osc isn't hidden by mpv.conf)!
  • Do you somehow do find Romanian and French subtitles? With what setting exactly?

why would anyone want to see results from all

That's because

  • that option is available in other well-known players (VLC, SMPlayer, MPC-HC) and may prove useful: for example, I don't normally want Spanish subs, but in case a Japanese movie has no other subs, I can try Spanish etc.
  • I was looking to an alternative to a specific setting per language (e.g. Romanian and French, as said above), which doesn't work for some cases I need. I am a native Romanian and for movies in the languages I can read (English, French and Italian) I want subtitles in the same language. For movies in other languages I want subtitles in Romanian (if possible; otherwise, in French or English). (But I don't think all is an option, given that mpv docs says that slang, like alang "Specify a priority list of audio languages to use", while all wouldn't set any priority I guess. )

@cipricus
Copy link
Author

cipricus commented Nov 13, 2023

Update:

  • beside hu Hungarian and it Italian, also el Greek, he Hebrew, tr Turkish, ar Arabic work and find subs!
  • beside Romanian ro and French fr, also es Spanish, de German, ru Russian also disable uosc.
  • spa and sp, deu and ger, ara (Arabic), gre,ell (Greek), heb (Hebrew), pt,por, pb (Portuguese), rus Russian, tur Turkish don't affect uosc, but no subs are found with these (for a movie that does have the subs in these languages, which are found by SMPlayer and VLC).
  • the result is the same when using the tags in mpv.conf (slang=) or as an option like mpv --slang fr,it
  • I have seen the same problems with the previous version of uosc (5.0).
  • My main system is Kubuntu 23.10, but I have tested and confirmed (with uosc 5.1) the same problems in Neon Unstable and Kubuntu 22.04.

As far as I can see:

  • only 2-letter language codes work with uosc+slang mpv option (tested it,hu, el, bg,tr,ar) - that is IETF language tags.
  • the letter tags/codes that disable the uosc interface (tested ro, fr,es,de,ru) are precisely the ones that should be working: they are all 2-letter tags (I haven't found a 3-letter tag that disabled uosc or that worked) and they are all in the IETF tags list, while a meaningless 2-letter tag (xx) doesn't affect uosc! - Therefore, there is no subtitle support for these languages, as there is no 2-letter alternative tag to be used.

@cipricus cipricus changed the title Problems with 'slang' option in mpv.conf for other subtitle languages beside English Cannot find subtitles in French, Romanian and other languages Nov 13, 2023
@cipricus cipricus changed the title Cannot find subtitles in French, Romanian and other languages Cannot find subtitles in some languages as their language tag (mpv.conf, slang=) crash/disable uosc (French, Spanish, German, Russian, Romanian) Nov 13, 2023
@cipricus cipricus changed the title Cannot find subtitles in some languages as their language tag (mpv.conf, slang=) crash/disable uosc (French, Spanish, German, Russian, Romanian) Cannot find subtitles in some languages (French, Spanish, German, Russian, Romanian) as their language tag (mpv.conf, slang=) crash/disable uosc Nov 13, 2023
@christoph-heinrich
Copy link
Contributor

christoph-heinrich commented Nov 13, 2023

I can reproduce that crash when I compile mpv with the lua interpreter instead of luajit.

The problem is that #list behaves differently in lua and luajit, I'll make a PR for that.

@cipricus
Copy link
Author

cipricus commented Nov 13, 2023

In uosc/lib/intl.lua:37 you'll find '*all', would you mind replacing that with 'a' and see what happens?

After that it becomes still more odd.

  • There is no improvement if I use slang=fr,ro,it (no uosc).
  • If I remove the slang line completely, oddly, the subtitle downloader sees, beside English, other languages, namely in one case Hungarian and Bulgarian, no idea why just these, given that Arabic, Turkish, Greek, for example, could have also been there, based on the 'ok' list mentioned in previous comment and on what SMPlayer shows.
  • If, I on the other hand use slang=ar,tr,el, in order to add the 3 absent languages, only English and these are seen (not Bulgarian and Hungarian anymore: but these can be seen by adding their tags to the slang line).

@cipricus
Copy link
Author

cipricus commented Nov 13, 2023

Now, after making the changes to sdt.lua like you said in your pull request here and changing uosc/lib/intl.lua:37 back to '*all', my problem is fixed!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants