From 48d77de8759e609f7707a81798f6027f1c0797f5 Mon Sep 17 00:00:00 2001 From: inpos Date: Sat, 5 Mar 2016 00:05:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B8=D0=BD=D0=B4=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=83=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pyrrent2http/engine.py | 4 ---- lib/pyrrent2http/pyrrent2http.py | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pyrrent2http/engine.py b/lib/pyrrent2http/engine.py index b469260..925d340 100644 --- a/lib/pyrrent2http/engine.py +++ b/lib/pyrrent2http/engine.py @@ -8,11 +8,7 @@ import time import urllib2 import httplib from os.path import dirname -#from download import LibraryManager - import pyrrent2http - -#import logpipe import mimetypes import xbmc from error import Error diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index 921375f..eb4e9a1 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -662,7 +662,12 @@ class Pyrrent2http(object): if uriPath != '' and sys.platform.startswith('win') and (os.path.sep == uriPath[0] or uriPath[0] == '/'): uriPath = uriPath[1:] try: - absPath = os.path.abspath(urllib.unquote(uriPath)) + if sys.platform.startswith('win'): + driveLetter = uriPath[:2] + wpath = uriPath[2:].replace('\\', '/') + absPath = driveLetter + os.path.abspath(urllib.unquote(wpath)).replace('/', '\\') + else: + absPath = os.path.abspath(urllib.unquote(uriPath)) logging.info('Opening local file: %s' % (absPath,)) with open(absPath, 'rb') as f: torrent_info = lt.torrent_info(lt.bdecode(f.read()))