Created
February 28, 2015 01:41
-
-
Save ihercowitz/279ae33851283cf2d374 to your computer and use it in GitHub Desktop.
A simple script to batch download series from KickassTorrents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
from lxml.html import fromstring | |
import os | |
kickass = "https://kickass.to/usearch/{0}/" | |
magnet=lambda link, local: os.system('aria2c --conf-path=$HOME/.aria2c.torrent --max-download-limit=1100K --max-upload-limit=15K --listen-port=63654 "' + link + '" -d '+ local +' --seed-time=1') | |
localFolder="~/Vídeos/Seriados/Gotham" | |
def getpage(tvshow): | |
url = kickass.format(tvshow.replace(" ", "%20")) | |
print url | |
r = requests.get(url, verify=False) | |
return r | |
def download(tvshow, start, end): | |
for x in range (start, end+1): | |
show = "%se%s" %(tvshow, ("0"+str(x) if x < 10 else str(x))) | |
url = getpage(show) | |
link = fromstring(url.text).cssselect('a.imagnet')[0].get('href') | |
magnet(link, localFolder) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment