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.
Posts: 2
Joined: Fri Mar 26, 2021 1:24 am

Old and New Api - Python

Fri Mar 26, 2021 1:36 am

I used old API with Python
My code:

Code: Select all

from xmlrpc.client import ServerProxy
from pprint import pprint
import json

#'tt1723811'-->Shame 2011

server = ServerProxy("")
token = server.LogIn('username', 'password', 'eng', 'xname ')['token']
response = server.SearchSubtitles(token, [{'sublanguageid': 'eng', 'query':imbd }])

When I try some movie id such as imbd='tt0499549'>Avatar
respond = {'data': [], 'seconds': 0.004, 'status': '200 OK'}
When I try
imbd=tt1723811'>Shame 2011
All good but I see a lot of file information I don't need. I need just one English subtitle file. I want to create a learning application. But still ok for me like that.
One guy response to me in 'StackOverflow. He said me to use the new app. I tried today ... titles-api

Code: Select all

headers = {
        'Api-Key': api_key,
    params = (
        ('imdb_id', movie_id),
    response = requests.get('', headers=headers, params=params)
headers = {
    'Api-Key': api_key,
    'Authorization': auth,
    'Content-Type': 'application/json',
data = '{"file_id":5274788}'
response ='', headers=headers, data=data)

<Response [200]>
<Response [503]>

I have an API key, API name. I don't know what I'm gonna write for Authorization. I tried all combinations.

How I can reach the subtitle information?

Posts: 2
Joined: Fri Mar 26, 2021 1:24 am

Re: Old and New Api - Python

Sat Mar 27, 2021 2:54 am

I found the solition

Code: Select all

import requests
import json
from pprint import pprint

url = ""
headers = {'api-key':'YOUR API KEY', 'content-type': 'application/json'}
user = {'username': 'YOUR USERNAME', 'password': "YOUR USER PASSWORD"}

    login_response =, data=json.dumps(user), headers=headers)
    login_json_response = login_response.json()
    login_token = login_json_response['token']
    print("Something wrong check again...")


headers = {
        'Api-Key': 'YOUR API KEY',
params = (
        ('imdb_id', imdb_id),
query_response = requests.get('', params=params, headers=headers)
query_json_response = query_response.json()
#pprint(query_json_response)# All data here...

query_file_name = query_json_response['data'][0]['attributes']['files'][0]['file_name']
query_file_no = query_json_response['data'][0]['attributes']['files'][0]['file_id']
movie_img = query_json_response['data'][0]['attributes']['related_links']['img_url']
print ("Movie Image url:",movie_img)
print("File Number:",query_file_no)
print("Subtile File Name:",query_file_name)

download_url = ""
download_headers = {'api-key': 'YOUR API KEY',
                    'content-type': 'application/json'}
download_file_id = {'file_id': query_file_no}
download_response =, data=json.dumps(download_file_id), headers=download_headers)
download_json_response = download_response.json()

saved_file_name = ""
r = requests.get(link)
with open(saved_file_name, 'wb') as f:

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 1 guest