<commit_before># -*- coding: utf-8 -*-
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
import re


class RyushareCom(XFileSharingPro):
    __name__ = "RyushareCom"
    __type__ = "hoster"
    __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}"
    __version__ = "0.09"
    __description__ = """ryushare.com hoster plugin"""
    __author_name__ = ("zoidberg", "stickell")
    __author_mail__ = ("<EMAIL>", "<EMAIL>")

    HOSTER_NAME = "ryushare.com"

    WAIT_PATTERN = r'(?:You have to|Please) wait (?:(?P<min>\d+) minutes, )?(?:<span id="[^"]+">)?(?P<sec>\d+)(?:</span>)? seconds'
    DIRECT_LINK_PATTERN = r'<a href="([^"]+)">Click here to download</a>'

    def setup(self):
        self.resumeDownload = self.multiDL = self.premium
        # Up to 3 chunks allowed in free downloads. Unknown for premium
        self.chunkLimit = 3

    def getDownloadLink(self):
        self.html = self.load(self.pyfile.url)
        action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
        if inputs.has_key('method_premium'):
            del inputs['method_premium']

        self.html = self.load(self.pyfile.url, post = inputs)
        action, inputs = self.parseHtmlForm('F1')

        for i in xrange(10):
            self.logInfo('Attempt to detect direct link #%d' % i)

            # Wait
            if 'You have reached the download-limit!!!' in self.html:
                self.setWait(3600, True)
            else:
                m = re.search(self.WAIT_PATTERN, self.html).groupdict('0')
                waittime = int(m['m']) * 60 + int(m['s'])
                self.setWait(waittime)
            self.wait()

            self.html = self.load(self.pyfile.url, post = inputs)
            if 'Click here to download' in self.html:
                m = re.search(self.DIRECT_LINK_PATTERN, self.html)
                return m.group(1)

        self.parseError('No direct link within 10 retries')

getInfo = create_getInfo(RyushareCom)
<commit_msg>RyushareCom: fixed wrong keys name<commit_after># -*- coding: utf-8 -*-
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
import re


class RyushareCom(XFileSharingPro):
    __name__ = "RyushareCom"
    __type__ = "hoster"
    __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}"
    __version__ = "0.10"
    __description__ = """ryushare.com hoster plugin"""
    __author_name__ = ("zoidberg", "stickell")
    __author_mail__ = ("<EMAIL>", "<EMAIL>")

    HOSTER_NAME = "ryushare.com"

    WAIT_PATTERN = r'(?:You have to|Please) wait (?:(?P<min>\d+) minutes, )?(?:<span id="[^"]+">)?(?P<sec>\d+)(?:</span>)? seconds'
    DIRECT_LINK_PATTERN = r'<a href="([^"]+)">Click here to download</a>'

    def setup(self):
        self.resumeDownload = self.multiDL = self.premium
        # Up to 3 chunks allowed in free downloads. Unknown for premium
        self.chunkLimit = 3

    def getDownloadLink(self):
        self.html = self.load(self.pyfile.url)
        action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
        if inputs.has_key('method_premium'):
            del inputs['method_premium']

        self.html = self.load(self.pyfile.url, post = inputs)
        action, inputs = self.parseHtmlForm('F1')

        for i in xrange(10):
            self.logInfo('Attempt to detect direct link #%d' % i)

            # Wait
            if 'You have reached the download-limit!!!' in self.html:
                self.setWait(3600, True)
            else:
                m = re.search(self.WAIT_PATTERN, self.html).groupdict('0')
                waittime = int(m['min']) * 60 + int(m['sec'])
                self.setWait(waittime)
            self.wait()

            self.html = self.load(self.pyfile.url, post = inputs)
            if 'Click here to download' in self.html:
                m = re.search(self.DIRECT_LINK_PATTERN, self.html)
                return m.group(1)

        self.parseError('No direct link within 10 retries')

getInfo = create_getInfo(RyushareCom)

{'fraction_non_alphanumeric': 0.15102241931510224, 'fraction_numerical': 0.010347376201034738, 'mean_word_length': 2.5834068843777582, 'pattern_counts': {'":': 2, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '653989', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1317, 'n_words': 286}