8000 IINA incorrectly reports "No subtitles found" using Open Subtitles · Issue #3907 · iina/iina · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

IINA incorrectly reports "No subtitles found" using Open Subtitles #3907

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

Closed
1 task done
low-batt opened this issue Aug 12, 2022 · 3 comments · Fixed by #3968
Closed
1 task done

IINA incorrectly reports "No subtitles found" using Open Subtitles #3907

low-batt opened this issue Aug 12, 2022 · 3 comments · Fixed by #3968

Comments

@low-batt
Copy link
Contributor

System and IINA version:

  • macOS 12.4
  • IINA 1.3.0

Expected behavior:
If subtitles can be found by hand using Open Subtitle's web site then IINA will be able to find the subtitles.

Actual behavior:
For a video file named Better.Call.Saul.S04E03.1080p.BluRay.x265-RARBG.mp4 using Open Subtitles IINA reports No subtitles found. Searching Open Subtitles by hand using the text Better.Call.Saul.S04E03.1080p.BluRay.x265-RARBG, Open Subtitles adjusts the search string to be better call saul s04e03 and finds the correct subtitle file.


Steps to reproduce:

  • Make a copy of any video long enough to have subtitles
  • Rename the copy to be Better.Call.Saul.S04E03.1080p.BluRay.x265-RARBG.mp4
  • Open the video file in IINA
  • Click on Find Online Subtitles... under the Subtitles menu
  • The OSD message No subtitles found is displayed
  • MPV does not have this problem.

This is an IINA issue.

How often does this happen?
Everytime.

@low-batt low-batt self-assigned this Aug 12, 2022
@low-batt
Copy link
Contributor Author

Analysis

The problematic code is the following line from OpenSubSubtitle.requestIMDB:

let IMDB = (bestGuess?["IDMovieIMDB"] as? String) ?? ""

That line is expecting Open Subtitles to return a result of this form:

<name>BestGuess</name>
<value>
  <struct>
    <member>
      <name>IDMovieIMDB</name>
      <value>
        <string>0080339</string>
      </value>
    </member>

In the case at hand Open Subtitles is returning this:

<name>BestGuess</name>
<value>
  <struct>
    <member>
      <name>IDMovieIMDB</name>
      <value>
        <int>3032476</int>
      </value>
    </member>

So the cast to String in the code shown above quietly fails and the rest of the code assumes Open Subtitles did not find any subtitles.

Fixing

There are issues with merge conflicts in this area with the plugin system, so I will be holding off creating a pull request until the plugin system has been merged.

The fix not hard. Maybe something like:

guard let bestGuess = try self.findPath(["data", filename, "BestGuess"], in: response) as? [String: Any], let imdbEntry = bestGuess["IDMovieIMDB"] else {
  resolver.fulfill("")
  return
}
if let IMDB = imdbEntry as? Int {
  resolver.fulfill(String(IMDB))
  return
}
let IMDB = imdbEntry as? String ?? ""
resolver.fulfill(IMDB)

ark-1 added a commit to ark-1/iina that referenced this issue Oct 6, 2022
Support both Int and String IDMovieIMDB (fixes iina#3907)
IMDBEpisode when available (fixes iina#3908)

Solution is based on the code by low-batt.
ark-1 added a commit to ark-1/iina that referenced this issue Oct 11, 2022
Support both Int and String IDMovieIMDB (fixes iina#3907)
IMDBEpisode when available (fixes iina#3908)

Solution is based on the code by low-batt.
@low-batt
Copy link
Contributor Author

Added label to indicate fix has been merged into develop. Re-opening since this is still a problem in IINA 1.3.0, the latest release. This way any users planning on reporting this problem will hopefully find this open issue and not enter a duplicate.

@low-batt low-batt reopened this Oct 13, 2022
@low-batt low-batt linked a pull request Oct 18, 2022 that will close this issue
2 tasks
@low-batt low-batt removed their assignment Oct 18, 2022
@low-batt
Copy link
Contributor Author
low-batt commented Nov 7, 2022

Fixed in IINA 1.3.1.

@low-batt low-batt closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0