diff options
-rw-r--r-- | module/plugins/hoster/BitshareCom.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/UploadStationCom.py | 12 |
2 files changed, 5 insertions, 11 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index f339f6662..c552cdd9d 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -13,7 +13,7 @@ def getInfo(urls): for url in urls: # Get file info html - # TODO: Force responses in english language + # @TODO: Force responses in english language so current patterns will be right html = getURL(url) if re.search(BitshareCom.FILE_OFFLINE_PATTERN, html): result.append((url, 0, 1, url)) @@ -73,7 +73,7 @@ class BitshareCom(Hoster): # File name name1 = re.search(BitshareCom.__pattern__, self.pyfile.url).group('name') name2 = re.search(BitshareCom.FILE_INFO_PATTERN, self.html).group('name') - self.pyfile.name = max(name1, name2) # Unicode BUG workaround + self.pyfile.name = max(name1, name2) # Ajax file id self.ajaxid = re.search(BitshareCom.FILE_AJAXID_PATTERN, self.html).group(1) diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index 4701bee26..8a97a864a 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -6,11 +6,7 @@ from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha
import re
-import unicodedata
-def unicode2str(unitext):
- return unicodedata.normalize('NFKD', unitext).encode('ascii', 'ignore')
-
def getInfo(urls):
result = []
@@ -24,7 +20,6 @@ def getInfo(urls): # Name
name = re.search(UploadStationCom.FILE_TITLE_PATTERN, html).group(1)
- name = unicode2str(name) # Unicode BUG workaround
# Size
m = re.search(UploadStationCom.FILE_SIZE_PATTERN, html)
@@ -76,8 +71,7 @@ class UploadStationCom(Hoster): # Id & Title
self.fileId = re.search(self.__pattern__, self.pyfile.url).group('id')
- title = re.search(UploadStationCom.FILE_TITLE_PATTERN, self.html).group(1)
- self.pyfile.name = unicode2str(title) # Unicode BUG workaround
+ self.pyfile.name = re.search(UploadStationCom.FILE_TITLE_PATTERN, self.html).group(1)
# Free account
self.handleFree()
@@ -91,7 +85,7 @@ class UploadStationCom(Hoster): # Check download
response = self.load(self.pyfile.url, post={"checkDownload" : "check"})
- self.log.debug("%s: Checking download, response [%s]" % (self.__name__, unicode2str(response)))
+ self.log.debug("%s: Checking download, response [%s]" % (self.__name__, response))
self.handleErrors(response)
# We got a captcha?
@@ -104,7 +98,7 @@ class UploadStationCom(Hoster): post={'recaptcha_challenge_field' : challenge,
'recaptcha_response_field' : code,
'recaptcha_shortencode_field' : self.fileId})
- self.log.debug("%s: Result of captcha resolving [%s]" % (self.__name__, unicode2str(response)))
+ self.log.debug("%s: Result of captcha resolving [%s]" % (self.__name__, response))
self.handleCaptchaErrors(response)
# Process waiting
|