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.
redguardtoo
Posts: 6
Joined: Thu Oct 28, 2021 3:06 am

restful api does not work any more

Sat Aug 06, 2022 2:09 pm

Hi,
My open source project https://github.com/redguardtoo/shenshou started using new restful api.

It worked at the beginning, but after a few day the api did not work.

Here is the debug log,

Code: Select all

Fetching subtitles of 1 video(s) ... shenshou-download-subtitle-internal called => The Mary Tyler Moore Show S01E01 Love is All Around.mkv shenshou-login-now called. shenshou-restful-call called => post-data={"username": "redguardtoo", "password": "mypassword"} cmd=curl --request POST --silent --insecure --url "https://api.opensubtitles.com/api/v1/login" -H "Api-Key: 9PEmFOnb2IzOHAbpbwRWcll01IsIjfFz" -H "Content-Type: application/json" --data '{"username": "redguardtoo", "password": "mypassword"}' cmd-output={"user":{"allowed_translations":1,"allowed_downloads":20,"level":"Sub leecher","user_id":335072,"ext_installed":false,"vip":false},"token":"{edited-oken}","status":200} user=((allowed_translations . 1) (allowed_downloads . 20) (level . Sub leecher) (user_id . 335072) (ext_installed . :json-false) (vip . :json-false)) token={edited-token} status=200 User redguardtoo logged into ’https://opensubtitles.com’: user_id=335072 allowed_downloads(daily)=20 level=Sub leecher shenshou-params-from-videos => rlt=languages=en&query=The%20Mary%20Tyler%20Moore%20Show&episode_number=01&season_number=01 shenshou-restful-call called => post-data=nil cmd=curl --request GET --silent --insecure --url "https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=The%20Mary%20Tyler%20Moore%20Show&episode_number=01&season_number=01" -H "Api-Key: {edited-api-key"" -H "Authorization: Bearer {edited-token}" -H "Content-Type: application/json" cmd-output= setq: End of file while parsing JSON user-error: Previous command was not an evil-paste: winum-select-window-2 M-[ 1 1 1 is undefined ; 9 is undefined command-execute: Buffer is read-only: #<buffer *Messages*>
As you can see the login succeeded and I got the token,

But the GET api call returned nothing. Here is the full curl cli

Code: Select all

curl --request GET --silent --insecure --url "https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=The%20Mary%20Tyler%20Moore%20Show&episode_number=01&season_number=01" -H "Api-Key: {edited-api-key}" -H "Authorization: Bearer {edited-token}" -H "Content-Type: application/json"
Edited tokens and api keys by OSS

User avatar
oss
Site Admin
Posts: 5879
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: restful api does not work any more

Mon Aug 08, 2022 9:02 am

I am not sure how I can mark it better, but well, I will try.

You forget -L (or --location) (to follow redirects) parameter.

Please read this: https://opensubtitles.stoplight.io/docs ... -practices

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 24 guests