Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
y4a1
Posts: 2
Joined: Sat Apr 15, 2023 9:46 am

Getting random subtitles

Sat Apr 15, 2023 10:06 am

Hi,

using the new API (opensubtitles.com) I've searched for a subtitle:

Code: Select all

GET /api/v1/subtitles?moviehash=33f47a2a8defb13a [ { "id": "398431", "type": "subtitle", "attributes": { "subtitle_id": "398431", "language": "en", "download_count": 248381, "new_download_count": 34, "hearing_impaired": true, "hd": false, "fps": 25.0, "votes": 4, "ratings": 9.0, "from_trusted": false, "foreign_parts_only": false, "upload_date": "2005-03-01T00:00:00Z", "ai_translated": false, "machine_translated": false, "release": "Johnny.English.DVDRip.XviD-DMT", "comments": "from Johnny.English.DVDRip.XviD-DMT checked for the usual rip-errors :) if you like the sub please V0te :D", "legacy_subtitle_id": 4450864, "uploader": { "uploader_id": 18589, "name": "K0bo (a)", "rank": "Silver Member" }, "feature_details": { "feature_id": 516561, "feature_type": "Movie", "year": 2003, "title": "Johnny English", "movie_name": "2003 - Johnny English", "imdb_id": 274166, "tmdb_id": 9486 }, "url": "https://www.opensubtitles.com/en/subtitles/legacy/4450864", "related_links": [ { "label": "All subtitles for Johnny English", "url": "https://www.opensubtitles.com/en/movies/2003-johnny-english", "img_url": "https://s9.opensubtitles.com/features/1/6/5/516561.jpg" } ], "files": [ { "file_id": 436692, "cd_number": 1, "file_name": "dmt-je_hearing_impaired" } ], "moviehash_match": true } }, { "id": "736339", "type": "subtitle", "attributes": { "subtitle_id": "736339", "language": "en", "download_count": 96058, "new_download_count": 363, "hearing_impaired": false, "hd": true, "fps": 24.0, "votes": 2, "ratings": 5.5, "from_trusted": true, "foreign_parts_only": false, "upload_date": "2012-12-09T16:08:04Z", "ai_translated": false, "machine_translated": false, "release": "Three.Steps.Above.Heaven.2010.720p.BluRay.x264.DTS-HDChina", "comments": "Fixed Some Errors.", "legacy_subtitle_id": 4737285, "uploader": { "uploader_id": 41719, "name": "vtn1354", "rank": "Trusted member" }, "feature_details": { "feature_id": 566390, "feature_type": "Movie", "year": 2010, "title": "Three Steps Above Heaven", "movie_name": "2010 - Three Steps Above Heaven", "imdb_id": 1648216, "tmdb_id": 61979 }, "url": "https://www.opensubtitles.com/en/subtitles/legacy/4737285", "related_links": [ { "label": "All subtitles for Three Steps Above Heaven", "url": "https://www.opensubtitles.com/en/movies/2010-three-steps-above-heaven", "img_url": "https://s9.opensubtitles.com/features/0/9/3/566390.jpg" } ], "files": [ { "file_id": 809775, "cd_number": 1, "file_name": "Three.Steps.Above.Heaven.2010.720p.BluRay.x264.DTS-HDChina" } ], "moviehash_match": true } }, ... ]
Note that both matches have "moviehash_match": true, but are clearly for different files.

In addition, calling download on the first match (398431):

Code: Select all

POST /api/v1/download {"file_id": "398431", "sub_format": "webvtt"} I get: { "link": "https://www.opensubtitles.com/download/65...4/subfile/Rocky%20IV.DVDRip.CULTXviD.part1.br.webvtt", "file_name": "Rocky IV.DVDRip.CULTXviD.part1.br.webvtt", ... }
which is again seems unrelated to either. What's going on?

y4a1
Posts: 2
Joined: Sat Apr 15, 2023 9:46 am

Re: Getting random subtitles

Sat Apr 15, 2023 1:42 pm

Fuller output with curl:

Code: Select all

> curl --request GET --url 'https://api.opensubtitles.com/api/v1/subtitles?moviehash=33f47a2a8defb13a' \ --header 'Api-Key: XXXXXXXXXXXXX' \ --header 'Authorization: Bearer XXXXXXXXXXXXXXXX' {"total_pages":1,"total_count":20,"per_page":60,"page":1,"data":[{"id":"398431","type":"subtitle","attributes":{"subtitle_id":"398431","language":"en","download_count":248381,"new_download_count":34,"hearing_impaired":true,"hd":false,"fps":25.0,"votes":4,"ratings":9.0,"from_trusted":false,"foreign_parts_only":false,"upload_date":"2005-03-01T00:00:00Z","ai_translated":false,"machine_translated":false,"release":"Johnny.English.DVDRip.XviD-DMT","comments":"from Johnny.English.DVDRip.XviD-DMT checked for the usual rip-errors :) if you like the sub please V0te :D","legacy_subtitle_id":4450864,"uploader":{"uploader_id":18589,"name":"K0bo (a)","rank":"Silver Member"},"feature_details":{"feature_id":516561,"feature_type":"Movie","year":2003,"title":"Johnny English","movie_name":"2003 - Johnny English","imdb_id":274166,"tmdb_id":9486},"url":"https://www.opensubtitles.com/en/subtitles/legacy/4450864","related_links":[{"label":"All subtitles for Johnny English","url":"https://www.opensubtitles.com/en/movies/2003-johnny-english","img_url":"https://s9.opensubtitles.com/features/1/6/5/516561.jpg"}],"files":[{"file_id":436692,"cd_number":1,"file_name":"dmt-je_hearing_impaired"}],"moviehash_match":true}},{"id":"736339","type":"subtitle","attributes":{"subtitle_id":"736339","language":"en","download_count":96058,"new_download_count":363,"hearing_impaired":false,"hd":true,"fps":24.0,"votes":2,"ratings":5.5,"from_trusted":true,"foreign_parts_only":false,"upload_date":"2012-12-09T16:08:04Z","ai_translated":false,"machine_translated":false,"release":"Three.Steps.Above.Heaven.2010.720p.BluRay.x264.DTS-HDChina","comments":"Fixed Some Errors.","legacy_subtitle_id":4737285,"uploader":{"uploader_id":41719,"name":"vtn1354","rank":"Trusted member"},"feature_details":{"feature_id":566390,"feature_type":"Movie","year":2010,"title":"Three Steps Above Heaven","movie_name":"2010 - Three Steps Above Heaven","imdb_id":1648216,"tmdb_id":61979},"url":"https://www.opensubtitles.com/en/subtitles/legacy/4737285","related_links":[{"label":"All subtitles for Three Steps Above Heaven","url":"https://www.opensubtitles.com/en/movies/2010-three-steps-above-heaven","img_url":"https://s9.opensubtitles.com/features/0/9/3/566390.jpg"}],"files":[{"file_id":809775,"cd_number":1,"file_name":"Three.Steps.Above.Heaven.2010.720p.BluRay.x264.DTS-HDChina"}],"moviehash_match":true}}, ... {"id":"1060770","type":"subtitle","attributes":{"subtitle_id":"1060770","language":"tr","download_count":365,"new_download_count":8,"hearing_impaired":false,"hd":true,"fps":23.976,"votes":0,"ratings":0.0,"from_trusted":false,"foreign_parts_only":false,"upload_date":"2017-06-23T19:01:33Z","ai_translated":false,"machine_translated":false,"release":"Bikini.Model.Academy.2015.720p.BluRay.x264.YIFY","comments":"","legacy_subtitle_id":7020502,"uploader":{"uploader_id":3282,"name":"os-auto","rank":"Application Developers"},"feature_details":{"feature_id":602016,"feature_type":"Movie","year":2015,"title":"Bikini Model Academy","movie_name":"2015 - Bikini Model Academy","imdb_id":3208802,"tmdb_id":363805},"url":"https://www.opensubtitles.com/tr/subtitles/legacy/7020502","related_links":[{"label":"All subtitles for Bikini Model Academy","url":"https://www.opensubtitles.com/tr/movies/2015-bikini-model-academy","img_url":"https://s9.opensubtitles.com/features/6/1/0/602016.jpg"}],"files":[{"file_id":1149218,"cd_number":1,"file_name":"Bikini.Model.Academy.2015.720p.BluRay.x264.YIFY"}],"moviehash_match":true}},{"id":"1060690","type":"subtitle","attributes":{"subtitle_id":"1060690","language":"ro","download_count":302,"new_download_count":0,"hearing_impaired":false,"hd":false,"fps":23.976,"votes":0,"ratings":0.0,"from_trusted":false,"foreign_parts_only":false,"upload_date":"2016-01-02T12:56:57Z","ai_translated":false,"machine_translated":false,"release":"Bikini Model Academy (2015) DVDRip by www.RadioFLy.ws","comments":"","legacy_subtitle_id":6445738,"uploader":{"uploader_id":3282,"name":"os-auto","rank":"Application Developers"},"feature_details":{"feature_id":602016,"feature_type":"Movie","year":2015,"title":"Bikini Model Academy","movie_name":"2015 - Bikini Model Academy","imdb_id":3208802,"tmdb_id":363805},"url":"https://www.opensubtitles.com/ro/subtitles/legacy/6445738","related_links":[{"label":"All subtitles for Bikini Model Academy","url":"https://www.opensubtitles.com/ro/movies/2015-bikini-model-academy","img_url":"https://s9.opensubtitles.com/features/6/1/0/602016.jpg"}],"files":[{"file_id":1149139,"cd_number":1,"file_name":"Bikini Model Academy (2015) DVDRip by www.RadioFLy.ws"}],"moviehash_match":true}} ]}
Seems rather unlikely that Three.Steps.Above.Heaven.2010.720p.BluRay.x264.DTS-HDChina and "Bikini Model Academy (2015) DVDRip by www.RadioFLy.ws" refer to the same movie

RazerBlader
Posts: 3
Joined: Sun Apr 16, 2023 5:42 am

Re: Getting random subtitles

Mon Apr 17, 2023 11:05 am

I had the same problem and realised the issue was that I was using the subtitle ID and not the file ID.

What you need to use is the file ID in attributes, files, in this case: files": [ { "file_id": 809775 , not the subtitle ID.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 25 guests