diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f68d626..a44ecb2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,15 +2,9 @@ - - - - - - - + @@ -44,7 +38,7 @@ - + @@ -55,37 +49,44 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -94,7 +95,7 @@ - + @@ -145,11 +146,11 @@ - + - - + + @@ -176,27 +177,33 @@ - - + + + + + + + + @@ -225,16 +232,17 @@ - + - - + + + @@ -251,9 +259,11 @@ - + + + @@ -312,8 +322,6 @@ @@ -437,10 +447,6 @@ @@ -992,6 +980,7 @@ + @@ -1001,7 +990,6 @@ - @@ -1024,8 +1012,6 @@ - - @@ -1049,7 +1035,9 @@ - @@ -1163,13 +1151,6 @@ - - - - - - - @@ -1315,14 +1296,6 @@ - - - - - - - - @@ -1346,82 +1319,111 @@ - + - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1445,117 +1447,128 @@ - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Anteoloader.py b/Anteoloader.py index 4c77485..39a12fa 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -17,8 +17,7 @@ along with this program. If not, see . ''' -import thread -import os + import urllib2 import hashlib import re @@ -34,7 +33,6 @@ from functions import file_encode, isSubtitle, DownloadDB, log, debug, is_writab import os import urllib -import json import sys from contextlib import contextmanager, closing, nested @@ -191,7 +189,10 @@ class AnteoLoader: return hasher.hexdigest() def magnetToTorrent(self, magnet): - self.torrentFile = magnet + from Libtorrent import Libtorrent + torrent = Libtorrent(self.storageDirectory, self.magnetLink) + torrent.magnetToTorrent(self.magnetLink) + self.torrentFile = "file:///"+torrent.torrentFile.replace('\\','//').replace('////','//') class AnteoPlayer(xbmc.Player): __plugin__ = sys.modules["__main__"].__plugin__ @@ -502,8 +503,8 @@ class AnteoPlayer(xbmc.Player): return [ self.display_name, "%.2f%% %s" % (f.progress * 100, self.localize(STATE_STRS[s.state]).decode('utf-8')), - "D:%.2f%s U:%.2f%s S:%d P:%d" % (s.download_rate * 8, self.localize('kb/s').decode('utf-8'), - s.upload_rate * 8, self.localize('kb/s').decode('utf-8'), + "D:%.2f%s U:%.2f%s S:%d P:%d" % (s.download_rate, self.localize('kb/s').decode('utf-8'), + s.upload_rate, self.localize('kb/s').decode('utf-8'), s.num_seeds, s.num_peers) ] @@ -526,8 +527,8 @@ class AnteoPlayer(xbmc.Player): status = self.engine.status() self.engine.check_torrent_error(status) log('[AnteoPlayer]: %.2f%% complete (down: %.1f kb/s up: %.1f kb/s peers: %d) %s' % \ - (status.progress * 100, status.download_rate * 8, - status.upload_rate * 8, status.num_peers, status.state_str)) + (status.progress * 100, status.download_rate, + status.upload_rate, status.num_peers, status.state_str)) def print_fulldebug(self): status = self.engine.status() diff --git a/Localization.py b/Localization.py index 2c6566d..de5c23e 100644 --- a/Localization.py +++ b/Localization.py @@ -179,7 +179,7 @@ def localize(text): 'Favourites SH': 'Избранное ИП', 'Clear %s': 'Очистить %s', 'Clear!': 'Очищено!', - 'kb/s': 'Кб/с', + 'kb/s': 'КБ/с', 'Queued': 'В очереди', 'Checking': 'Проверка', 'Downloading metadata': 'Скачивание мета-данных',