Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.35 KB

README.md

File metadata and controls

66 lines (45 loc) · 1.35 KB

ABOUT

This is an unofficial API for KickassTorrents.

Installation

pip install -r requirements.txt

Usage

Search for torrents using the API

from KickAssAPI import KickAssAPI

api = KickAssAPI()
results = api.search("Attack on Titan")

for key in results:
    print(results[key]['title'])
    print(results[key]['page_url'])

Get the magent link of a selected torrent from search results

from KickAssAPI import KickAssAPI

api = KickAssAPI()
results = api.search("Attack on Titan")

magnet_link  = api.magnet(results[index]['page_url'])
print(magnet_link)

API

Using the API deployed on Heroku

Searching for torrents using the API

import requests, json

API_SEARCH = "https://kickass-api-unofficial.herokuapp.com/search?torrent="

resp = requests.get(API_SEARCH + "Attack on titan")
results = json.loads(resp.text)

for key in results:
    print(results[key]['title'])
    print(results[key]['page_url'])

Getting magnet links using the API

import requests, json

API_MAGNET = "https://kickass-api-unofficial.herokuapp.com/magnet?page_url="

page_url = results[index]['page_url']
resp = requests.get(API_MAGNET+page_url)

magnet = json.loads(resp.text)

magnet_link = magnet['magnet']