vankasteelj / opensubtitles-api

nodejs opensubtitles.org api wrapper for downloading and uploading subtitles in multiple langs
110 stars 33 forks source link

Issue: vtt subtitle download not working #55

Closed Azmodeos closed 4 years ago

Azmodeos commented 4 years ago

Download link for vtt doesn't work, i have extensions: ['srt', 'vtt'] passed on and as a result i get url, utf8 & vtt.

Both download links for url and utf8 work and download srt files but vtt doesn't work, am i doing something wrong or?

darklight147 commented 4 years ago

Nice

vankasteelj commented 4 years ago

It's working fine here:

OpenSubtitles.search({
    sublanguageid: 'eng', // Can be an array.join, 'all', or be omitted.
    extensions: ['srt', 'vtt'], // Accepted extensions, defaults to 'srt'.
    imdbid: "tt0322259", // 'tt528809' is fine too.
    limit: 3
  }).then(console.log)

Gives me this link: https://dl.opensubtitles.org/en/download/subformat-vtt/src-api/vrf-19dd0c5f/sid-TgyrJaNV-Yrf4G2hpp9yhEgCfxc/filead/1952859375

Which is a link to a .vtt file, I can download it. So I don't see where your problem is? What's a non-working url you get from the API?

Azmodeos commented 4 years ago

i did this

OpenSubtitles.search({ sublanguageid: 'eng', extensions: ['srt', 'vtt'], imdbid: "tt4566758", limit: 3 }).then(console.log)

and i got this vtt link https://dl.opensubtitles.org/en/download/subformat-vtt/src-api/vrf-19d20c58/sid-plujGJoHyMFfZxVehOrceOq-Ova/filead/1956905363

it's not working but yours for some reason is working. Tried again with your imdbid that you tested and it worked so does it matter on the movie perhaps? like does it not work for all movies

vankasteelj commented 4 years ago

You should ask that question to opensubtitles, the link is sent by their servers. As far as opensubtitle-api, a wrapper to help discuss with opensubtitles directly, it seems to give you a correct url (the fact that this url isn't working isnt the wrappers fault), hence I'm closing this.