打开字幕的 REST API POST /api/v1/download



我在这里阅读了Opensubtitle的新API的文档,并在试图到达下载端点时收到500错误。我已经成功地与其他端点,包括/api/v1/login和/api/v1/字幕。

这是JSON格式的数据,我试图请求

{'id': '5164746',
'type': 'subtitle',
'attributes': {'subtitle_id': '5164746',
'language': 'en',
'download_count': 9608,
'new_download_count': 46,
'hearing_impaired': False,
'hd': True,
'format': None,
'fps': 23.976,
'votes': 0,
'points': 0,
'ratings': 0.0,
'from_trusted': False,
'foreign_parts_only': False,
'auto_translation': False,
'ai_translated': False,
'machine_translated': None,
'upload_date': '2020-02-09T13:59:42Z',
'release': '2160p.4K.BluRay.x265.10bit.AAC5.1-[YTS.MX]',
'comments': "Slightly resynced the 1080p.WEBRip.x264-[YTS.LT] version by explosiveskull to this 4K release. HI removed. I didn't do 4K sync for Infinity War, as they're already on site here:rnHi: https://www.opensubtitles.org/en/subtitles/7436082/avengers-infinity-war-enrnNo HI: https://www.opensubtitles.org/en/subtitles/7436058/avengers-infinity-war-en",
'legacy_subtitle_id': 8092829,
'uploader': {'uploader_id': 66694,
'name': 'pooond',
'rank': 'bronze member'},
'feature_details': {'feature_id': 626618,
'feature_type': 'Movie',
'year': 2019,
'title': 'Avengers: Endgame',
'movie_name': '2019 - Avengers: Endgame',
'imdb_id': 4154796,
'tmdb_id': 299534},
'url': 'https://www.opensubtitles.com/en/subtitles/legacy/8092829',
'related_links': {'label': 'All subtitles for Avengers: Endgame',
'url': 'https://www.opensubtitles.com/en/movies/2019-untitled-avengers-movie',
'img_url': 'https://s9.osdb.link/features/8/1/6/626618.jpg'},
'files': [{'file_id': 5274788,
'cd_number': 1,
'file_name': 'Avengers.Endgame.2019.2160p.4K.BluRay.x265.10bit.AAC5.1-[YTS.MX].srt'}]}}

这是我发送的请求:

headers = {
'Api-Key': api_one,
'Authorization': auth,
'Content-Type': 'application/json',
}
data = '{"file_id":5274788,"sub_format":"srt","file_name":"Avengers.Endgame.2019.2160p.4K.BluRay.x265.10bit.AAC5.1-[YTS.MX]","strip_html":true,"cleanup_links":true,"remove_adds":true,"in_fps":0,"out_fps":0,"timeshift":0}'

response = requests.post('https://www.opensubtitles.com/api/v1/download', headers=headers, data=data)

有没有其他人成功地使用了这个API的下载端点?

看起来上面的一些参数有错误。这里是文档的链接。更新post请求的data参数,只包含file_id。

data = '{"file_id":5274788}'
response = requests.post('https://www.opensubtitles.com/api/v1/download', headers=headers, data=data)

最新更新