Skip to content

codenirvana/kTorrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ On 20 July 2016, KAT domain was seized by the United States government and is offline.

kTorrent

version version supported Build Status

A Python module to fetch and parse data from Kickass Torrents.

Install

Using pip

$ pip install ktorrent

Build from source

$ git clone https://github.com/codenirvana/kTorrent.git
$ cd kTorrent
$ python setup.py install

Usage

Search

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)
Function Parameters
  • 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

Valid Parameters Values
  • 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

Top

import ktorrent

# Top books
top_books = ktorrent.top(category='books')

# Top movies
top_movies = ktorrent.top(category='movies', page=2)
Function Parameters
  • category = 'torrent category'
  • page = 'page number' [int]

Required: category

Valid Parameters Values
  • Categories available

    movies, tv, anime, music, books, applications, games, other, xxx

Output

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

Licence

Open sourced under MIT License