mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-05 07:02:31 -06:00
- Fixed unicode in mininova and btjunkie search engines
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#VERSION: 1.11
|
||||
#VERSION: 1.2
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -26,7 +26,9 @@
|
||||
|
||||
def prettyPrinter(dictionnary):
|
||||
dictionnary['size'] = anySizeToBytes(dictionnary['size'])
|
||||
print "%(link)s|%(name)s|%(size)s|%(seeds)s|%(leech)s|%(engine_url)s" % dictionnary
|
||||
if isinstance(dictionnary['name'], unicode):
|
||||
dictionnary['name'] = dictionnary['name'].encode('utf-8')
|
||||
print dictionnary['link'],'|',dictionnary['name'],'|',dictionnary['size'],'|',dictionnary['seeds'],'|',dictionnary['leech'],'|',dictionnary['engine_url']
|
||||
|
||||
def anySizeToBytes(size_string):
|
||||
"""
|
||||
@@ -42,7 +44,7 @@ def anySizeToBytes(size_string):
|
||||
size = size[:-len(unit)]
|
||||
except:
|
||||
return -1
|
||||
if len(size) == 0:
|
||||
if len(size) == 0:
|
||||
return -1
|
||||
size = float(size)
|
||||
short_unit = unit.upper()[0]
|
||||
|
||||
Reference in New Issue
Block a user