|
|
@ -1,23 +1,24 @@ |
|
|
|
from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList |
|
|
|
from couchpotato.core.helpers.encoding import isInt, ss, sp |
|
|
|
from couchpotato.core.helpers.variable import tryInt, tryFloat, cleanHost |
|
|
|
from couchpotato.core.logger import CPLog |
|
|
|
|
|
|
|
from base64 import b16encode, b32decode, b64encode |
|
|
|
from bencode import bencode as benc, bdecode |
|
|
|
from distutils.version import LooseVersion |
|
|
|
from hashlib import sha1 |
|
|
|
import httplib |
|
|
|
import json |
|
|
|
import os |
|
|
|
import re |
|
|
|
import urllib |
|
|
|
import urllib2 |
|
|
|
|
|
|
|
from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList |
|
|
|
from couchpotato.core.helpers.encoding import isInt, sp |
|
|
|
from couchpotato.core.helpers.variable import cleanHost |
|
|
|
from couchpotato.core.logger import CPLog |
|
|
|
from bencode import bencode as benc, bdecode |
|
|
|
|
|
|
|
|
|
|
|
log = CPLog(__name__) |
|
|
|
|
|
|
|
autoload = 'Hadouken' |
|
|
|
|
|
|
|
|
|
|
|
class Hadouken(DownloaderBase): |
|
|
|
protocol = ['torrent', 'torrent_magnet'] |
|
|
|
hadouken_api = None |
|
|
@ -211,13 +212,15 @@ class Hadouken(DownloaderBase): |
|
|
|
delete_files: Boolean indicating whether to remove the associated data. |
|
|
|
""" |
|
|
|
|
|
|
|
log.debug('Requesting Hadouken to remove the torrent %s%s.', (release_download['name'], ' and cleanup the downloaded files' if delete_files else '')) |
|
|
|
log.debug('Requesting Hadouken to remove the torrent %s%s.', |
|
|
|
(release_download['name'], ' and cleanup the downloaded files' if delete_files else '')) |
|
|
|
|
|
|
|
if not self.connect(): |
|
|
|
return False |
|
|
|
|
|
|
|
return self.hadouken_api.remove(release_download['id'], remove_data = delete_files) |
|
|
|
|
|
|
|
|
|
|
|
class HadoukenAPI(object): |
|
|
|
def __init__(self, host = 'localhost', port = 7890, api_key = None): |
|
|
|
self.url = 'http://' + str(host) + ':' + str(port) |
|
|
|