OpenSubtitles Plugin for Movian 7?

montcer

Member
Since the release of the new API for OpenSubtitle, developer Superfan (as credited in "plugin.json") shared a new plugin (v2.3.5, attached here as .zip file) which shall be compatible with it and available in Movian 7 plugins database. Users are requested to introduce their OpenSubtitle's username and password in Movian settings, which I did, but it does not work for me yet.

I know it is supposed to be a beta version, which obviously may be faulty, but I couldn't find a way to contact Superfan in order to improve the plugin sharing my log as it didn't work for me.

So, if any have clues or insights on this subject, may please share it here? Maybe is there a repository somewhere? Thanks!
 

Attachments

Well, it does work after some tweaks in the "opensubtitles.js" file and the request of the API key in the OpenSubtitles.com website.

Here is what I did:
1. Registered in opensubtitles.com.
2. Requested an API key in the consumer site of said website.
3. Hardcoded the API key and user and password into the opensubtitles.js file:
Results.jpeg

4. Repacked the opensubtitles.zip with the freshly modified opensubtitles.js file and replaced it into "/dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins" folder.
5. All set! But only 5~10 subtitles per day in same IP for the free dev account, so choose wisely your movies :'(

Hope someone read this and found a best way for it to work. Cheers!
 
So, I was thinking the script should get the API key by itself, requiring from the user only to input their user and password. Does someone knows how to write JavaScript code?

I noticed in line 146 of opensubtitles.js:
Code:
login(retry);// we are using hardcode api and dont know how to get api key from url hence skipping

So I asked ChatGPT how to do that, and got:
Code:
// Get the HTML content of the website using the fetch method
fetch("https://www.opensubtitles.com/en/consumers")
  .then(response => response.text())
  .then(html => {
    // Create a new DOMParser object
    let parser = new DOMParser();
    // Parse the HTML content into a document
    let doc = parser.parseFromString(html, "text/html");
    // Get the element by using the querySelector method
    let element = doc.querySelector("#content > div > section > div > div > div > table.table.table-striped.table-bordered.no-footer > tbody > tr > td:nth-child(3)");
    // Check if the element exists and is not null
    if (element) {
      // Get the text content of the element
      let text = element.textContent;
      // Print the text to the console
      console.log(text);
    } else {
      // Handle the case when the element is not found
      console.error("Element not found");
    }
  })
  .catch(error => {
    // Handle the case when the fetch request fails
    console.error(error);
  });

However, I don't know how to properly integrate that code into JS, nor how to test it... I will try tho, just thinking it would be faster if someone more experienced do this.
 
Hmmm, this is weird, but the original plugin was able to get the API key without me hardcoding it into the .JS file. I wonder if the previous time it couldn't get it because opensubtitles website needs some time to allow apps to get the API key, or maybe it needed some kind of permission ?
 
In my case, when I choose any subtitle from opensubtitles.com plugin, the PS3 freezes and I have to restart
 

Similar threads

Back
Top