diff options
| author | 2013-03-16 19:01:01 +0100 | |
|---|---|---|
| committer | 2013-03-16 19:01:01 +0100 | |
| commit | 629d5a0262cd9ca7ca3ac3926c37ed332a652b31 (patch) | |
| tree | 2d5dce59539065c6af12eb7516840fab4fc70c74 /module/plugins/hoster/RyushareCom.py | |
| parent | RyushareCom: Improved regex (diff) | |
| download | pyload-629d5a0262cd9ca7ca3ac3926c37ed332a652b31.tar.xz | |
RyushareCom: Updated to support wait time with minutes
Diffstat (limited to 'module/plugins/hoster/RyushareCom.py')
| -rw-r--r-- | module/plugins/hoster/RyushareCom.py | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 3cfeb12d4..54abd9103 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -2,17 +2,24 @@  from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo  import re +def to_seconds(m): +    minutes = int(m['min']) if m['min'] else 0 +    seconds = int(m['sec']) if m['sec'] else 0 +    return minutes * 60 + seconds +  class RyushareCom(XFileSharingPro):      __name__ = "RyushareCom"      __type__ = "hoster"      __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}" -    __version__ = "0.05" +    __version__ = "0.06"      __description__ = """ryushare.com hoster plugin""" -    __author_name__ = ("zoidberg") -    __author_mail__ = ("zoidberg@mujmail.cz") +    __author_name__ = ("zoidberg", "stickell") +    __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")      HOSTER_NAME = "ryushare.com" +    WAIT_PATTERN = r'(?:You have to|Please) wait (?:(?P<min>\d+) minutes, )?(?:<span id="[^"]+">)?(?P<sec>\d+)(?:</span>)? seconds' +      def setup(self):          self.resumeDownload = self.multiDL = self.premium          self.chunkLimit = 3 @@ -30,8 +37,8 @@ class RyushareCom(XFileSharingPro):              self.logInfo('Attempt to detect direct link #%d' % i)              # wait 60 seconds -            seconds = re.search(r'(?:You have to|Please) wait (?:<span id="[^"]+">)?(?P<sec>\d+)(?:</span>)? seconds', self.html).group('sec') -            self.setWait(seconds) +            m = re.search(self.WAIT_PATTERN, self.html) +            self.setWait(to_seconds(m.groupdict()))              self.wait()              self.html = self.load(self.pyfile.url, post = inputs) | 
