diff options
author | mkaay <mkaay@mkaay.de> | 2011-06-10 13:09:33 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2011-06-10 13:09:33 +0200 |
commit | a40cf88920e94490d5c851fb273b8d2f48aef6fb (patch) | |
tree | 8de448bbf50535901a35a26c2a145403ed166107 /module/plugins/hoster/BitshareCom.py | |
parent | ernieb's rapidshare patch (diff) | |
download | pyload-a40cf88920e94490d5c851fb273b8d2f48aef6fb.tar.xz |
ernieb's hoster patches
Diffstat (limited to 'module/plugins/hoster/BitshareCom.py')
-rw-r--r-- | module/plugins/hoster/BitshareCom.py | 14 |
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 |