summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/BitshareCom.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2011-06-10 13:09:33 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2011-06-10 13:09:33 +0200
commita40cf88920e94490d5c851fb273b8d2f48aef6fb (patch)
tree8de448bbf50535901a35a26c2a145403ed166107 /module/plugins/hoster/BitshareCom.py
parenternieb's rapidshare patch (diff)
downloadpyload-a40cf88920e94490d5c851fb273b8d2f48aef6fb.tar.xz
ernieb's hoster patches
Diffstat (limited to 'module/plugins/hoster/BitshareCom.py')
-rw-r--r--module/plugins/hoster/BitshareCom.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index dc9cc455c..ca651c3c7 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -52,7 +52,7 @@ class BitshareCom(Hoster):
HOSTER_DOMAIN = "bitshare.com"
FILE_OFFLINE_PATTERN = r'''(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)'''
- FILE_INFO_PATTERN = r'<h1>Downloading\s(?P<name>.+?)\s-\s(?P<size>\d+)\s(?P<units>..)yte</h1>'
+ FILE_INFO_PATTERN = r'<h1>Downloading\s(?P<name>.+?)\s-\s(?P<size>[\d.]+)\s(?P<units>..)yte</h1>'
FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";'
CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) "
@@ -78,8 +78,16 @@ class BitshareCom(Hoster):
self.offline()
# File name
- name1 = re.search(BitshareCom.__pattern__, self.pyfile.url).group('name')
- name2 = re.search(BitshareCom.FILE_INFO_PATTERN, self.html).group('name')
+ name1 = re.search(BitshareCom.__pattern__, self.pyfile.url)
+ if name1:
+ name1 = name1.group('name')
+ else:
+ name1 = ""
+ name2 = re.search(BitshareCom.FILE_INFO_PATTERN, self.html)
+ if name2:
+ name2 = name2.group('name')
+ else:
+ name2 = ""
self.pyfile.name = max(name1, name2)
# Ajax file id