Giter VIP home page Giter VIP logo

kickasstorrentsapi's Introduction

KAT

An unofficial Python API for KickAssTorrents

Installation

pip install kat

Or: (https://pypi.python.org/pypi/kat/0.1.9) Download and un-pack.

python setup.py install

Usage

Perform searches using kat.popular(), kat.search() and kat.recent() Results returned are iterable and can be accessed individually to see individual torrent information.

import kat

# Get home page results. ------------------------------------------------

home = kat.popular()

# See information about first result 
print home[0].title # Some torrent title

# Or print out details of every torrent returned

for torrent in home:
  torrent.print_details()

# By default kat.popular returns 70 results, 10 for each category.
# We can refine our results by using categories.

home_games = kat.popular(category=kat.Categories.GAMES)

# We can see how many results we got
print len(home) # 70
print len(home_games) # 10


# ----------------------------------------------------------------------


# Perform a search -----------------------------------------------------

s = kat.search("the walking dead")

# Searches can be categorized and also sorted.
s = kat.search("the walking dead", category=kat.Categories.TV, 
                sort=kat.Sorting.SEED, order=kat.Sorting.Order.DESC)

# They can also span multiple pages
multi = kat.search("the walking dead", pages=3)
# And we can keep track of the current page
print multi.current_page # 3

# We can go to a particular page
multi.page(7)

# And to the next page
multi.next_page()


#-----------------------------------------------------------------------

# Get recently added torrents ------------------------------------------

r = kat.recent()

# Recent results can be categorized and sorted like normal searches
# and can also contain multiple pages.

# Change base url
kat.set_base_url("http://kickmirror.com")

Sorting and Categories

Sort Options

  • Sorting.SIZE
  • Sorting.AGE
  • Sorting.FILES
  • Sorging.SEED
  • Sorting.LEECH
  • Sorting.Order.ASC
  • Sorting.Order.DESC

Category Options

  • Categories.ALL
  • Categories.MOVIES
  • Categories.TV
  • Categories.ANIME
  • Categories.MUSIC
  • Categories.BOOKS
  • Categories.APPS
  • Categories.GAMES
  • Categories.XXX

Torrent Information Available

  • title
  • category
  • size
  • seeders
  • leechers
  • magnet
  • download
  • files
  • age
  • page
  • print_details()

TODO

  • Implement sorting for kat.popular()
  • Trying to get a page after the end of the results returns the first page, I want to make it return nothing.
  • Create a filter class to group sort & search options.
  • Add support for searching mirror sites e.g kickmirror.com

kickasstorrentsapi's People

Contributors

stephen-mclean avatar eligundry avatar

Watchers

James Cloos avatar João Francisco Almeida avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.