Import optimize
This commit is contained in:
1 parent
79688c412a
commit
1d73fd9d7e
1 file changed
+11
-8
@@ -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 base64 import b16encode, b32decode, b64encode
|
||||||
from bencode import bencode as benc, bdecode
|
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
import httplib
|
import httplib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import urllib
|
|
||||||
import urllib2
|
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__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
autoload = 'Hadouken'
|
autoload = 'Hadouken'
|
||||||
|
|
||||||
|
|
||||||
class Hadouken(DownloaderBase):
|
class Hadouken(DownloaderBase):
|
||||||
protocol = ['torrent', 'torrent_magnet']
|
protocol = ['torrent', 'torrent_magnet']
|
||||||
hadouken_api = None
|
hadouken_api = None
|
||||||
@@ -211,13 +212,15 @@ class Hadouken(DownloaderBase):
|
|||||||
delete_files: Boolean indicating whether to remove the associated data.
|
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():
|
if not self.connect():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return self.hadouken_api.remove(release_download['id'], remove_data = delete_files)
|
return self.hadouken_api.remove(release_download['id'], remove_data = delete_files)
|
||||||
|
|
||||||
|
|
||||||
class HadoukenAPI(object):
|
class HadoukenAPI(object):
|
||||||
def __init__(self, host = 'localhost', port = 7890, api_key = None):
|
def __init__(self, host = 'localhost', port = 7890, api_key = None):
|
||||||
self.url = 'http://' + str(host) + ':' + str(port)
|
self.url = 'http://' + str(host) + ':' + str(port)
|
||||||
|
|||||||
Reference in new issue
Block a user