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

Download from Open Subtitles using their REST API #3920

Closed
low-batt opened this issue Aug 20, 2022 · 8 comments · Fixed by #4678
Closed

Download from Open Subtitles using their REST API #3920

low-batt opened this issue Aug 20, 2022 · 8 comments · Fixed by #4678

Comments

@low-batt
Copy link
Contributor

What you want IINA to do:
Download from Open Subtitles using their new REST API.

What IINA does currently:
Downloads from Open Subtitles using their original XMLRPC API.

Why you think this should be added:
Because of this post by Open Subtitles: OpenSubtitles.org API deprecation and end of life which says:

After 16 years of service, the time has come to turn off our original API service, to focus our time and energy on the new REST API.

And:

2023-12-31 end of life, API endpoint will be turned off

IINA has no choice but to switch to the new REST API before that deadlline.

Examples of other projects that have something similar:
N/A

@low-batt
Copy link
Contributor Author

low-batt commented Oct 22, 2023

USERS MUST MIGRATE ACCOUNTS

Open Subtitles opensubtitles.org is being rebuilt as opensubtitles.com. From the opensubtitles.com FAQ question What is this site ? is it related to opensubtitles.org ?:

Yes it definitely is ! opensubtitles.com is the rebuild of opensubtitles.org for the years to come.

Responsive design to fit all screens, UTF-8 conversion and full parsing of all subtitles, AI translations, dynamic framerate, delay or format conversion, and a lot of new features to come.

Thus the mandatory conversion from the Open Subtitles XMLRPC API to the REST API is not merely a "behind the scenes" technology change. This is a part of the migration from opensubtitles.org (XMLRPC) to opensubtitles.com (REST API). Open Subtitles is unable to automatically migrate user accounts from to the new opensubtitles.com site.

Users must manually migrate their Open Subtitles account.

From the opensubtitles.com FAQ question How do I import my previous opensubtitles.org account ?:

Go to the user import page and fill in the email registered on opensubtitles.org

You will receive an email inviting you set yourself a new password. Your previous uploads will be referenced, user right such as VIP will be imported

Process is not completely failproof, some cases need to be handled manually. We will be glat to help if you drop us a note.

As a part of this process Open Subtitles will require the account password to be changed. Once finished importing your account you will evenutally need to configure IINA with your new password. At the moment you only need to do that if you update your account on opensubtitles.org with the new password you configured for the account on opensubtitles.com.

Foillow these instructions to update IINA:

  • Start IINA
  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Subtitle tab
  • On the right side of the panel scroll down to the Online Subtitles section
  • Click on the Logout button
  • Log back in specifying your new password

low-batt added a commit that referenced this issue Nov 5, 2023
This commit will:
- Add a new OpenSubClient class
- Change the OpenSub class to use the new client
- Change the OpenSub default language from eng to en
- Change name of provider from opensubtitles.org to opensubtitles.com
- Add a new loggedIn property to OnlineSubtitle
- Add a new logout method to OnlineSubtitle
- Add a new iinaLogoutCompleted notification to AppData
- Change AppDelegate to log out of the online subtitle provider during
  termination

This is a temporary stopgap solution that updates the builtin legacy
code in order to meet the end of 2023 deadline imposed by Open Subtitles
for switching to the new REST API. The plan is still to replace all
built-in code for downloading from online subtitle providers with
plug-in implementations.
@low-batt low-batt linked a pull request Nov 5, 2023 that will close this issue
2 tasks
low-batt added a commit that referenced this issue Dec 4, 2023
This commit will:
- Add a new OpenSubClient class
- Change the OpenSub class to use the new client
- Change the OpenSub default language from eng to en
- Change name of provider from opensubtitles.org to opensubtitles.com
- Add a new loggedIn property to OnlineSubtitle
- Add a new logout method to OnlineSubtitle
- Add a new iinaLogoutCompleted notification to AppData
- Change AppDelegate to log out of the online subtitle provider during
  termination

This is a temporary stopgap solution that updates the builtin legacy
code in order to meet the end of 2023 deadline imposed by Open Subtitles
for switching to the new REST API. The plan is still to replace all
built-in code for downloading from online subtitle providers with
plug-in implementations.
lhc70000 added a commit that referenced this issue Dec 16, 2023
* Close download from Open Subtitles using REST API, #3920

This commit will:
- Add a new OpenSubClient class
- Change the OpenSub class to use the new client
- Change the OpenSub default language from eng to en
- Change name of provider from opensubtitles.org to opensubtitles.com
- Add a new loggedIn property to OnlineSubtitle
- Add a new logout method to OnlineSubtitle
- Add a new iinaLogoutCompleted notification to AppData
- Change AppDelegate to log out of the online subtitle provider during
  termination

This is a temporary stopgap solution that updates the builtin legacy
code in order to meet the end of 2023 deadline imposed by Open Subtitles
for switching to the new REST API. The plan is still to replace all
built-in code for downloading from online subtitle providers with
plug-in implementations.

* Close download from Open Subtitles using REST API, #3920

This commit will:
- Add a new OpenSubClient class
- Change the OpenSub class to use the new client
- Change the OpenSub default language from eng to en
- Change name of provider from opensubtitles.org to opensubtitles.com
- Add a new loggedIn property to OnlineSubtitle
- Add a new logout method to OnlineSubtitle
- Add a new iinaLogoutCompleted notification to AppData
- Change AppDelegate to log out of the online subtitle provider during
  termination

This is a temporary stopgap solution that updates the builtin legacy
code in order to meet the end of 2023 deadline imposed by Open Subtitles
for switching to the new REST API. The plan is still to replace all
built-in code for downloading from online subtitle providers with
plug-in implementations.

* Use "en" by default if all preferred languages are not supported by OpenSubtitle

---------

Co-authored-by: Hechen Li <lhc199652@gmail.com>
@low-batt
Copy link
Contributor Author

The changes have been merged into the IINA develop branch. GitHub automatically closed the linked issue in reaction to the merge. I am reopening this issue until this change is available in an official release of IINA.

@low-batt low-batt reopened this Dec 16, 2023
@low-batt
Copy link
Contributor Author

low-batt commented Jan 1, 2024

IINA 1.3.4 uses opensubtitles.com instead of opensubtitles.org.

@low-batt low-batt closed this as completed Jan 1, 2024
@tsegreto
Copy link

tsegreto commented Jan 3, 2024

When I use the new API though IINA the results it returns are pretty far off from what I was getting with the old API. For example The.Sopranos.S06E14.Stage.5.720p.WEB-DL.h.264.DD5.1-NTb.mkv will return Sopranos 1x01.

@opensubtitles
Copy link

I checked that Sopranos, seems good to me:

            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "The Sopranos - S06E14 - Stage 5"
            "file_name": "The.Sopranos.S06E14.1080p.Bluray.10Bit.x265.AAC.51-HazMatt"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "the.sopranos.s06e14.hr.hdtv.xvid-sitv"
            "file_name": "The Sopranos - S06E14"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE.English"
            "file_name": "The.Sopranos.S06E14.720p.HDDVD.nHD.x264-NhaNc3-eng"
            "file_name": "The.Sopranos.S06E14.1080p.5.1Ch.BluRay.ReEnc-DeeJayAhmed"
            "file_name": "The.Sopranos.S06E14.Stage.5.1080p.HMAX.WEB-DL.DD.5.1.H.264-SLiGNOME"
            "file_name": "The.Sopranos.S06E14.Stage.5.1080p.WEB-DL.h.264.DD5.1-NTb-eng"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-TOPAZ"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "The.Sopranos.S06E14.720p.HDDVD.x264-BLiND-dut"
            "file_name": "the.sopranos.s06e14.hdtv.xvid-notv"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "halcyon-sopranos.s06e14.720p-x264"
            "file_name": "The.Sopranos.S06E14.1080p.5.1Ch.BluRay.ReEnc-DeeJayAhmed-ara"
            "file_name": "The Sopranos - 14 - Stage 5"
            "file_name": "The.Sopranos.S06E14.Stage.5.720p.HDDVD.x264-DiGG"
            "file_name": "[720pMkv.Com]_The.Sopranos.S06E14.Members.Only.480p.BluRay.x264-GAnGSteR-spa"
            "file_name": "The Sopranos - 6x14 - Stage 5"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "The.Sopranos.S06E14"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14"
            "file_name": "The.Sopranos.S06E14.Stage.5.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14.720p.hddvd.x264.chs"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "the.sopranos.s06e14.hdtv.xvid-notv.heb"
            "file_name": "the.sopranos.s06e14.it.subsfactory"
            "file_name": "the.sopranos.s06e14.hdtv.xvid-notv"
            "file_name": "The.Sopranos.S06E14.iNTERNAL.BDRip.x264-ARCHiViST"
            "file_name": "The Sopranos S6 E14 - Stage 5"
            "file_name": "The.Sopranos.S06E14.720p.BluRay.DD5.1.x264-ITSat"
            "file_name": "The.Sopranos.S06E14"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14.BluRay.Subs.German"
            "file_name": "The.Sopranos.S06E14.720p.HDDVD.nHD.x264-NhaNc3"
            "file_name": "The.Sopranos.S06E14.Stage.5.1080p.HMAX.WEB-DL.DD.5.1.H.264-SLiGNOME-NHI"
            "file_name": "The Sopranos s06e14 SWESUB DVDRip XviD - Virus"
            "file_name": "The_Sopranos_6x14"
            "file_name": "The.Sopranos.S06E14.Stage.5.720p.HDDVD.x264-BLiND"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14.HDTV.XviD-NoTV"
            "file_name": "Sopranos S06E14 - Stage 5"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"
            "file_name": "The.Sopranos.S06E14.DVDRip.XviD-WiDE"

anyway, I checked also IINA - would be great to have option for manual string search for movies/tv series

really like REST implementation, devs, contact us, so we can feature article on blog.opensubtitles.com

@low-batt
Copy link
Contributor Author

low-batt commented Jan 6, 2024

@opensubtitles Thanks for commenting!

I believe the issue is with the IINA client. I had not noticed the Guessit API under utilities. Is the intent that the client use this API to extract information such as the season number and episode number to then pass that information as query parameters in the Search for subtitles
API?

I am currently testing changes do that. For the case at hand that correctly narrows the search results to subtitles for the specific episode. This is being discussed in the new open issue #4749.

IINA 1.3.4 was rushed out to meet the deadline. We are currently working on the fixes that were planed for 1.3.4 and didn't get done in time. The plan is to finish those and make another release soon. This problem will be addressed in that release.

I'm a junior IINA developer. I will let the senior developers know you would like them to contact you.

On the lack of the ability to manually specify a search string, that is only one of several enhancements that should be made to this IINA feature. The plan was to replace the current code with a plugin using IINA's new plugin feature. But the timing did not work out. The plugin system is close to being released, but was not ready in time for this release. So the new code that uses the REST API is a temporary stopgap to meet the deadline. For that reason I did not add any enhancements to the IINA user interface.

@opensubtitlesdev
Copy link

there was a temporary bug on our guessit system, it didn't detect the season & episodes properly for a few weeks.

it's all fixed now, you can send your queries like "the sopranos s02e04" it'll be exactly the same as passing the season and episoode numbers separately

@low-batt
Copy link
Contributor Author

@opensubtitles I confirmed searching for subtitles when playing "The.Sopranos.S06E14.Stage.5.720p.WEB-DL.h.264.DD5.1-NTb.mkv" using IINA 1.3.4 now returns results specific to that episode. I will backout my fix that was going into the next release that calls Guessit.

I was wondering how this issue got past me as I was sure I had tested searching for a TV episode and confirmed it was working. I must have done that before the regression on the server occurred.

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.

4 participants