On 20 July 2016, KAT domain was seized by the United States government and is offline.
A Python module to fetch and parse data from Kickass Torrents.
$ pip install ktorrent
$ git clone https://github.com/codenirvana/kTorrent.git
$ cd kTorrent
$ python setup.py install
import ktorrent
# Basic Search
search = ktorrent.search(search='Linux')
# Complex Search
search = ktorrent.search(search='Linux Shell script', strict=1, category='books', field='age', sorder='desc', page=2)
- search = 'search query'
- strict = 'search strictness' [int]
- safe = 'family safety filter' [int]
- verified = 'only verified torrents' [int]
- subtract = 'Subtract specified word(s)'
- user = 'Uploads by certain user'
- category = 'torrent category'
- field = 'select field to sort results'
- sorder = 'sorting order'
- page = 'page number' [int]
Required: search
-
Search Result Ordering
category field sorder all size asc movies files desc tv age anime seed music leech books applications games other xxx -
Search Filters
value strict safe verified -1 | fuzzy | - | - 0 | normal | - | - 1 | strict | yes | yes
-
subtract : Space separated, ... subtract='book reference'...
-
user : Single user/uploader name
import ktorrent
# Top books
top_books = ktorrent.top(category='books')
# Top movies
top_movies = ktorrent.top(category='movies', page=2)
- category = 'torrent category'
- page = 'page number' [int]
Required: category
-
Categories available
movies, tv, anime, music, books, applications, games, other, xxx
JSON formatted search results, structure:
{
"status" : 200,
"meta":{
"pageCurrent" : 1,
"pageResult" : 25,
"pageTotal" : 10
},
"torrent":[
{
"age" : "",
"category" : "",
"files" : "",
"leech" : "",
"link" : "",
"magnet" : "",
"name" : "",
"seed" : "",
"size" : "",
"verified" : "",
"web" : ""
}
]
}
status | Description |
---|---|
200 | SUCCESS |
400 | BAD REQUEST invalid function parameters |
404 | NOT FOUND |
408 | TIME OUT server error |
Open sourced under MIT License