win
parent
48d77de875
commit
565fab4a83
|
@ -653,6 +653,8 @@ class Pyrrent2http(object):
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
def buildTorrentParams(self, uri):
|
def buildTorrentParams(self, uri):
|
||||||
|
if uri[1] == ':' and sys.platform.startswith('win'):
|
||||||
|
uri = 'file:///' + uri
|
||||||
fileUri = urlparse.urlparse(uri)
|
fileUri = urlparse.urlparse(uri)
|
||||||
torrentParams = {}
|
torrentParams = {}
|
||||||
if self.magnet:
|
if self.magnet:
|
||||||
|
@ -662,12 +664,7 @@ class Pyrrent2http(object):
|
||||||
if uriPath != '' and sys.platform.startswith('win') and (os.path.sep == uriPath[0] or uriPath[0] == '/'):
|
if uriPath != '' and sys.platform.startswith('win') and (os.path.sep == uriPath[0] or uriPath[0] == '/'):
|
||||||
uriPath = uriPath[1:]
|
uriPath = uriPath[1:]
|
||||||
try:
|
try:
|
||||||
if sys.platform.startswith('win'):
|
absPath = os.path.abspath(urllib.unquote(uriPath))
|
||||||
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,))
|
logging.info('Opening local file: %s' % (absPath,))
|
||||||
with open(absPath, 'rb') as f:
|
with open(absPath, 'rb') as f:
|
||||||
torrent_info = lt.torrent_info(lt.bdecode(f.read()))
|
torrent_info = lt.torrent_info(lt.bdecode(f.read()))
|
||||||
|
|
Loading…
Reference in New Issue