From d4862c12ee5583a70c4b842281c65ce72c36dff5 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Tue, 5 Jan 2016 19:27:10 +0300 Subject: [PATCH] resume_file --- .idea/workspace.xml | 807 +++++++++++++++++++++++--------------------- Anteoloader.py | 3 +- SearcherABC.py | 14 +- 3 files changed, 424 insertions(+), 400 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 86fe8c7..5c72fd0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,11 +1,10 @@ - + - - - + + @@ -183,7 +182,7 @@ - + @@ -191,11 +190,11 @@ - + - - + + @@ -208,26 +207,25 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -236,17 +234,17 @@ - + - + - + @@ -334,10 +332,10 @@ - + - + @@ -374,31 +372,21 @@ - - + + - + - - + + - - - - - - - - - - - - + + @@ -426,38 +414,8 @@ @@ -511,8 +499,8 @@ - + @@ -545,6 +533,24 @@ + + + + + + + + + + + + + + + + + + + + @@ -790,12 +814,6 @@ - + - + - + @@ -1125,7 +1149,6 @@ - @@ -1150,7 +1173,8 @@ - @@ -1159,238 +1183,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1429,31 +1221,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1489,7 +1256,6 @@ - @@ -1625,14 +1391,6 @@ - - - - - - - - @@ -1663,17 +1421,90 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1709,18 +1540,211 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1733,34 +1757,33 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - + + diff --git a/Anteoloader.py b/Anteoloader.py index 08d8d93..e501229 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -363,12 +363,13 @@ class AnteoPlayer(xbmc.Player): dht_routers = ["router.bittorrent.com:6881","router.utorrent.com:6881"] user_agent = 'uTorrent/2200(24683)' self.pre_buffer_bytes = int(self.__settings__.getSetting("pre_buffer_bytes"))*1024*1024 + resume_file=os.path.join(self.userStorageDirectory, 'torrents', os.path.basename(self.torrentUrl)+'.resume_data') self.engine = Engine(uri=file_url(self.torrentUrl), download_path=self.userStorageDirectory, connections_limit=connections_limit, download_kbps=download_limit, upload_kbps=upload_limit, encryption=encryption, keep_complete=keep_complete, keep_incomplete=keep_incomplete, dht_routers=dht_routers, use_random_port=use_random_port, listen_port=listen_port, - keep_files=keep_files, user_agent=user_agent) + keep_files=keep_files, user_agent=user_agent, resume_file=resume_file) def buffer(self): self.pre_buffer_bytes = 30*1024*1024 #30 MB diff --git a/SearcherABC.py b/SearcherABC.py index 4c7f3cb..1ce9e33 100644 --- a/SearcherABC.py +++ b/SearcherABC.py @@ -97,7 +97,7 @@ class SearcherABC: try: if os.path.exists(cookie): self.cookieJar.load(ignore_discard=True) except: - self.log(self.__plugin__+' [load_cookie]: os.remove(cookie)') + self.log('[load_cookie]: os.remove(cookie)') os.remove(cookie) self.cookieJar = cookielib.MozillaCookieJar(cookie) @@ -106,7 +106,7 @@ class SearcherABC: self.cookieJar = cookielib.MozillaCookieJar(cookie) if os.path.exists(cookie): os.remove(cookie) - self.log(self.__plugin__+' [clear_cookie]: cookie cleared') + self.log('[clear_cookie]: cookie cleared') def makeRequest(self, url, data={}, headers={}): self.load_cookie() @@ -133,13 +133,13 @@ class SearcherABC: response = opener.open(url, encodedData) except urllib2.HTTPError as e: if e.code == 404: - self.log(self.__plugin__+' [makeRequest]: Not Found! HTTP Error, e.code=' + str(e.code)) + self.log('[makeRequest]: Not Found! HTTP Error, e.code=' + str(e.code)) return elif e.code in [503]: - self.log(self.__plugin__+' [makeRequest]: Denied, HTTP Error, e.code=' + str(e.code)) + self.log('[makeRequest]: Denied, HTTP Error, e.code=' + str(e.code)) return else: - self.log(self.__plugin__+' [makeRequest]: HTTP Error, e.code=' + str(e.code)) + self.log('[makeRequest]: HTTP Error, e.code=' + str(e.code)) return #self.cookieJar.extract_cookies(response, urllib2) if response.info().get('Content-Encoding') == 'gzip': @@ -242,10 +242,10 @@ class SearcherABC: pass def log(self, msg): - log(msg) + log('[%s] ' % self.__plugin__ +msg) def debug(self, msg): - debug(msg) + debug('[%s] ' % self.__plugin__ +msg) def open2(self, url=''): import httplib