Ejemplo n.º 1
0
    __name__    = "MyfastfileCom"
    __type__    = "hoster"
    __version__ = "0.09"

    __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
    __config__  = [("use_premium", "bool", "Use premium account if available", True)]

    __description__ = """Myfastfile.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("stickell", "*****@*****.**")]


    def setup(self):
        self.chunkLimit = -1


    def handlePremium(self, pyfile):
        self.html = self.load('http://myfastfile.com/api.php',
                         get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'],
                              'link': pyfile.url})
        self.logDebug("JSON data: " + self.html)

        self.html = json_loads(self.html)
        if self.html['status'] != 'ok':
            self.fail(_("Unable to unrestrict link"))

        self.link = self.html['link']


getInfo = create_getInfo(MyfastfileCom)
Ejemplo n.º 2
0
                                get={'username': user,
                                     'password': info['login']['password'],
                                     'action'  : "downloadInformation",
                                     'id'      : link_status['id']})
                self.log_debug("JSON data hdd query: %s" % res)
                download_status = json_loads(res)['download']

                if download_status['status'] == "100":
                    link_status['generated'] = download_status['rpnet_link']
                    self.log_debug("Successfully downloaded to rpnet HDD: %s" % link_status['generated'])
                    break
                else:
                    self.log_debug("At %s%% for the file download" % download_status['status'])

                self.wait(30)
                my_try += 1

            if my_try > max_tries:  #: We went over the limit!
                self.fail(_("Waited for about 15 minutes for download to finish but failed"))

        if 'generated' in link_status:
            self.link = link_status['generated']
            return
        elif 'error' in link_status:
            self.fail(link_status['error'])
        else:
            self.fail(_("Something went wrong, not supposed to enter here"))


getInfo = create_getInfo(RPNetBiz)
Ejemplo n.º 3
0
    __license__     = "GPLv3"
    __authors__     = [("Andy Voigt", "*****@*****.**")]


    def setup(self):
        self.chunk_limit = 16


    def handle_premium(self, pyfile):
        password = self.get_password()

        data = json.loads(self.load("http://www.alldebrid.com/service.php",
                                     get={'link': pyfile.url, 'json': "true", 'pw': password}))

        self.log_debug("Json data", data)

        if data['error']:
            if data['error'] == "This link isn't available on the hoster website.":
                self.offline()
            else:
                self.log_warning(data['error'])
                self.temp_offline()
        else:
            if pyfile.name and not pyfile.name.endswith('.tmp'):
                pyfile.name = data['filename']
            pyfile.size = parse_size(data['filesize'])
            self.link = data['link']


getInfo = create_getInfo(AlldebridCom)
Ejemplo n.º 4
0
            self.load("https://real-debrid.com/ajax/unrestrict.php",
                      get={
                          'lang': "en",
                          'link': pyfile.url,
                          'password': self.getPassword(),
                          'time': int(time.time() * 1000)
                      }))

        self.logDebug("Returned Data: %s" % data)

        if data['error'] != 0:
            if data['message'] == "Your file is unavailable on the hoster.":
                self.offline()
            else:
                self.logWarning(data['message'])
                self.tempOffline()
        else:
            if pyfile.name and pyfile.name.endswith(
                    '.tmp') and data['file_name']:
                pyfile.name = data['file_name']
            pyfile.size = parseFileSize(data['file_size'])
            self.link = data['generated_links'][0][-1]

        if self.getConfig('ssl'):
            self.link = self.link.replace("http://", "https://")
        else:
            self.link = self.link.replace("https://", "http://")


getInfo = create_getInfo(RealdebridCom)
Ejemplo n.º 5
0
                                 })
        res = json_loads(jsonResponse)

        if res['response_code'] == "ok":
            self.token = res['token']
            return True
        else:
            return False

    def handlePremium(self, pyfile):
        """
        Debrid a link
        Return The debrided link if succeed or original link if fail
        """
        if not self.api_load():
            self.error("Unable to connect to remote API")

        jsonResponse = self.load(self.API_URL,
                                 get={
                                     'action': 'getLink',
                                     'token': self.token
                                 },
                                 post={'link': pyfile.url})

        res = json_loads(jsonResponse)
        if res['response_code'] == "ok":
            self.link = res['debridLink'][1:-1]


getInfo = create_getInfo(MegaDebridEu)
Ejemplo n.º 6
0
    def handle_premium(self, pyfile):
        for _i in xrange(5):
            self.html = self.load("https://high-way.me/load.php",
                                  get={'link': self.pyfile.url})

            if self.html:
                self.log_debug("JSON data: " + self.html)
                break
        else:
            self.log_info(_("Unable to get API data, waiting 1 minute and retry"))
            self.retry(5, 60, _("Unable to get API data"))

        self.check_errors()

        try:
            self.pyfile.name = re.search(r'<name>([^<]+)</name>', self.html).group(1)

        except AttributeError:
            self.pyfile.name = ""

        try:
            self.pyfile.size = re.search(r'<size>(\d+)</size>', self.html).group(1)

        except AttributeError:
            self.pyfile.size = 0

        self.link = re.search(r'<download>([^<]+)</download>', self.html).group(1)


getInfo = create_getInfo(HighWayMe)
Ejemplo n.º 7
0
    __config__  = [("use_premium" , "bool", "Use premium account if available"    , True),
                   ("revertfailed", "bool", "Revert to standard download if fails", True)]

    __description__ = """Fastix multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("Massimo Rosamilia", "*****@*****.**")]


    def setup(self):
        self.chunk_limit = 3


    def handle_premium(self, pyfile):
        api_key = self.account.get_data(self.user)
        api_key = api_key['api']

        self.html = self.load("http://fastix.ru/api_v2/",
                         get={'apikey': api_key, 'sub': "getdirectlink", 'link': pyfile.url})

        data = json_loads(self.html)

        self.log_debug("Json data", data)

        if "error\":true" in self.html:
            self.offline()
        else:
            self.link = data['downloadlink']


getInfo = create_getInfo(FastixRu)
Ejemplo n.º 8
0

class ZeveraCom(MultiHoster):
    __name__    = "ZeveraCom"
    __type__    = "hoster"
    __version__ = "0.35"
    __status__  = "testing"

    __pattern__ = r'https?://(?:www\.)zevera\.com/(getFiles\.ashx|Members/download\.ashx)\?.*ourl=.+'
    __config__  = [("activated"   , "bool", "Activated"                                        , True ),
                   ("use_premium" , "bool", "Use premium account if available"                 , True ),
                   ("fallback"    , "bool", "Fallback to free download if premium fails"       , False),
                   ("chk_filesize", "bool", "Check file size"                                  , True ),
                   ("max_wait"    , "int" , "Reconnect if waiting time is greater than minutes", 10   ),
                   ("revertfailed", "bool", "Revert to standard download if fails"             , True )]

    __description__ = """Zevera.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("zoidberg", "*****@*****.**"),
                       ("Walter Purcaro", "*****@*****.**")]


    FILE_ERRORS = [("Error", r'action="ErrorDownload.aspx')]


    def handle_premium(self, pyfile):
        self.link = "https://%s/getFiles.ashx?ourl=%s" % (self.account.PLUGIN_DOMAIN, pyfile.url)


getInfo = create_getInfo(ZeveraCom)
    __authors__     = [("Devirex Hazzard", "*****@*****.**")]


    def setup(self):
        self.chunk_limit = 3


    def handle_premium(self, pyfile):
        data = json.loads(self.load("https://real-debrid.com/ajax/unrestrict.php",
                                    get={'lang'    : "en",
                                         'link'    : pyfile.url,
                                         'password': self.get_password(),
                                         'time'    : int(time.time() * 1000)}))

        self.log_debug("Returned Data: %s" % data)

        if data['error'] != 0:
            if data['message'] == "Your file is unavailable on the hoster.":
                self.offline()
            else:
                self.log_warning(data['message'])
                self.temp_offline()
        else:
            if pyfile.name and pyfile.name.endswith('.tmp') and data['file_name']:
                pyfile.name = data['file_name']
            pyfile.size = parse_size(data['file_size'])
            self.link = data['generated_links'][0][-1]


getInfo = create_getInfo(RealdebridCom)
Ejemplo n.º 10
0
        self.link = replace_patterns(
            pyfile.url, [("clz.to", "cloudzer.net/file")(
                "http://share-online", "http://www.share-online")(
                    "ul.to", "uploaded.net/file")(
                        "uploaded.com", "uploaded.net")(
                            "filerio.com", "filerio.in")("lumfile.com",
                                                         "lumfile.se")])

        if 'fileparadox' in self.link:
            self.link = self.link.replace("http://", "https://")

        self.html = self.load("http://simply-debrid.com/api.php",
                              get={'dl': self.link})
        if 'tiger Link' in self.html or 'Invalid Link' in self.html or (
                'API' in self.html and 'ERROR' in self.html):
            self.error(_("Unable to unrestrict link"))

        self.link = self.html

        self.wait(5)

    def checkFile(self):
        if self.checkDownload({"error":
                               "No address associated with hostname"}):
            self.retry(24, 3 * 60, _("Bad file downloaded"))

        return super(SimplydebridCom, self).checkFile()


getInfo = create_getInfo(SimplydebridCom)
Ejemplo n.º 11
0
            if self.html:
                self.logDebug("JSON data: " + self.html)
                break
        else:
            self.logInfo(
                _("Unable to get API data, waiting 1 minute and retry"))
            self.retry(5, 60, _("Unable to get API data"))

        self.checkErrors()

        try:
            self.pyfile.name = re.search(r'<name>([^<]+)</name>',
                                         self.html).group(1)

        except AttributeError:
            self.pyfile.name = ""

        try:
            self.pyfile.size = re.search(r'<size>(\d+)</size>',
                                         self.html).group(1)

        except AttributeError:
            self.pyfile.size = 0

        self.link = re.search(r'<download>([^<]+)</download>',
                              self.html).group(1)


getInfo = create_getInfo(HighWayMe)
Ejemplo n.º 12
0
            self.user,
            'password':
            self.account.getAccountData(self.user)['password']
        })

        r = self.load("http://gen.linksnappy.com/genAPI.php",
                      post={'genLinks': json_params})

        self.logDebug("JSON data: " + r)

        j = json_loads(r)['links'][0]

        if j['error']:
            self.error(_("Error converting the link"))

        pyfile.name = j['filename']
        self.link = j['generated']

        if host in self.SINGLE_CHUNK_HOSTERS:
            self.chunkLimit = 1
        else:
            self.setup()

    @staticmethod
    def _get_host(url):
        host = urlparse.urlsplit(url).netloc
        return re.search(r'[\w-]+\.\w+$', host).group(0)


getInfo = create_getInfo(LinksnappyCom)
Ejemplo n.º 13
0
    def handlePremium(self, pyfile):
        #raise timeout to 2min
        self.download("http://premium.to/api/getfile.php",
                      get={
                          'username': self.account.username,
                          'password': self.account.password,
                          'link': pyfile.url
                      },
                      disposition=True)

    def checkFile(self):
        if self.checkDownload({'nopremium': "No premium account available"}):
            self.retry(60, 5 * 60, "No premium account available")

        err = ''
        if self.req.http.code == '420':
            # Custom error code send - fail
            file = fs_encode(self.lastDownload)
            with open(file, "rb") as f:
                err = f.read(256).strip()
            os.remove(file)

        if err:
            self.fail(err)

        return super(PremiumTo, self).checkFile()


getInfo = create_getInfo(PremiumTo)
Ejemplo n.º 14
0
import urllib

from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo


class RehostTo(MultiHoster):
    __name__    = "RehostTo"
    __type__    = "hoster"
    __version__ = "0.23"
    __status__  = "testing"

    __pattern__ = r'https?://.*rehost\.to\..+'
    __config__  = [("use_premium" , "bool", "Use premium account if available"    , True),
                   ("revertfailed", "bool", "Revert to standard download if fails", True)]

    __description__ = """Rehost.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("RaNaN", "*****@*****.**")]


    def handle_premium(self, pyfile):
        self.download("http://rehost.to/process_download.php",
                      get={'user': "******",
                           'pass': self.account.get_data(self.user)['session'],
                           'dl'  : pyfile.url},
                      disposition=True)


getInfo = create_getInfo(RehostTo)
Ejemplo n.º 15
0

    def setup(self):
        self.chunkLimit = 5


    def handlePremium(self, pyfile):
        https = "https" if self.getConfig('ssl') else "http"
        data  = self.account.getAccountData(self.user)
        page  = self.load(https + "://api.over-load.me/getdownload.php",
                          get={'auth': data['password'],
                               'link': pyfile.url})

        data = json_loads(page)

        self.logDebug(data)

        if data['error'] == 1:
            self.logWarning(data['msg'])
            self.tempOffline()
        else:
            if pyfile.name and pyfile.name.endswith('.tmp') and data['filename']:
                pyfile.name = data['filename']
                pyfile.size = parseFileSize(data['filesize'])

            http_repl = ["http://", "https://"]
            self.link = data['downloadlink'].replace(*http_repl if self.getConfig('ssl') else *http_repl[::-1])


getInfo = create_getInfo(OverLoadMe)
Ejemplo n.º 16
0
        user, info = self.account.select()
        jsonResponse = self.load(self.API_URL,
                                 get={'action': 'connectUser', 'login': user, 'password': info['login']['password']})
        res = json.loads(jsonResponse)

        if res['response_code'] == "ok":
            self.token = res['token']
            return True
        else:
            return False


    def handle_premium(self, pyfile):
        """
        Debrid a link
        Return The debrided link if succeed or original link if fail
        """
        if not self.api_load():
            self.error(_("Unable to connect to remote API"))

        jsonResponse = self.load(self.API_URL,
                                 get={'action': 'getLink', 'token': self.token},
                                 post={'link': pyfile.url})

        res = json.loads(jsonResponse)
        if res['response_code'] == "ok":
            self.link = res['debridLink'][1:-1]


getInfo = create_getInfo(MegaDebridEu)
Ejemplo n.º 17
0
    __description__ = """Debriditalia.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("stickell", "*****@*****.**"),
                       ("Walter Purcaro", "*****@*****.**")]


    URL_REPLACEMENTS = [("https://", "http://")]


    def handle_premium(self, pyfile):
        self.html = self.load("http://www.debriditalia.com/api.php",
                              get={'generate': "on", 'link': pyfile.url, 'p': self.get_password()})

        if "ERROR:" not in self.html:
            self.link = self.html.strip()
        else:
            self.info['error'] = re.search(r'ERROR:(.*)', self.html).group(1).strip()

            self.html = self.load("http://debriditalia.com/linkgen2.php",
                                  post={'xjxfun'   : "convertiLink",
                                        'xjxargs[]': "S<![CDATA[%s]]>" % pyfile.url,
                                        'xjxargs[]': "S%s" % self.get_password()})
            try:
                self.link = re.search(r'<a href="(.+?)"', self.html).group(1)
            except AttributeError:
                pass


getInfo = create_getInfo(DebridItaliaCom)
Ejemplo n.º 18
0
        else:
            self.logInfo(
                _("Unable to get API data, waiting 1 minute and retry"))
            self.retry(5, 60, _("Unable to get API data"))

        self.checkErrors()

        try:
            self.pyfile.name = re.search(r'<name>([^<]+)</name>',
                                         self.html).group(1)

        except AttributeError:
            self.pyfile.name = ""

        try:
            self.pyfile.size = re.search(r'<size>(\d+)</size>',
                                         self.html).group(1)

        except AttributeError:
            self.pyfile.size = 0

        try:
            self.link = re.search(r'<download>([^<]+)</download>',
                                  self.html).group(1)

        except AttributeError:
            self.link = 'http://www.simply-premium.com/premium.php?link=' + self.pyfile.url


getInfo = create_getInfo(SimplyPremiumCom)
Ejemplo n.º 19
0
            pyfile.name = ".".join(temp)

        #: Check the link
        get_data = {'session_key': self.account.get_data('session'),
                    'url'        : pyfile.url}

        data = json.loads(self.load("http://www2.smoozed.com/api/check", get=get_data))

        if data['state'] != "ok":
            self.fail(data['message'])

        if data['data'].get("state", "ok") != "ok":
            if data['data'] == "Offline":
                self.offline()
            else:
                self.fail(data['data']['message'])

        pyfile.name = data['data']['name']
        pyfile.size = int(data['data']['size'])

        #: Start the download
        header = self.load("http://www2.smoozed.com/api/download", get=get_data, just_header=True)

        if not "location" in header:
            self.fail(_("Unable to initialize download"))
        else:
            self.link = header.get('location')[-1] if isinstance(header.get('location'), list) else header.get('location')


getInfo = create_getInfo(SmoozedCom)
Ejemplo n.º 20
0
                                  'type'    : host,
                                  'username': self.user,
                                  'password': self.account.getAccountData(self.user)['password']})

        r = self.load("http://gen.linksnappy.com/genAPI.php",
                      post={'genLinks': json_params})

        self.logDebug("JSON data: " + r)

        j = json_loads(r)['links'][0]

        if j['error']:
            self.error(_("Error converting the link"))

        pyfile.name = j['filename']
        self.link   = j['generated']

        if host in self.SINGLE_CHUNK_HOSTERS:
            self.chunkLimit = 1
        else:
            self.setup()


    @staticmethod
    def _get_host(url):
        host = urlsplit(url).netloc
        return re.search(r'[\w-]+\.\w+$', host).group(0)


getInfo = create_getInfo(LinksnappyCom)
Ejemplo n.º 21
0
        self.chunkLimit = 16


    def handlePremium(self, pyfile):
        password = self.getPassword()

        data = json_loads(self.load("http://www.alldebrid.com/service.php",
                                     get={'link': pyfile.url, 'json': "true", 'pw': password}))

        self.logDebug("Json data", data)

        if data['error']:
            if data['error'] == "This link isn't available on the hoster website.":
                self.offline()
            else:
                self.logWarning(data['error'])
                self.tempOffline()
        else:
            if pyfile.name and not pyfile.name.endswith('.tmp'):
                pyfile.name = data['filename']
            pyfile.size = parseFileSize(data['filesize'])
            self.link = data['link']

        if self.getConfig('ssl'):
            self.link = self.link.replace("http://", "https://")
        else:
            self.link = self.link.replace("https://", "http://")


getInfo = create_getInfo(AlldebridCom)
Ejemplo n.º 22
0
    __description__ = """Fastix multi-hoster plugin"""
    __license__ = "GPLv3"
    __authors__ = [("Massimo Rosamilia", "*****@*****.**")]

    def setup(self):
        self.chunkLimit = 3

    def handlePremium(self, pyfile):
        api_key = self.account.getAccountData(self.user)
        api_key = api_key['api']

        self.html = self.load("http://fastix.ru/api_v2/",
                              get={
                                  'apikey': api_key,
                                  'sub': "getdirectlink",
                                  'link': pyfile.url
                              })

        data = json_loads(self.html)

        self.logDebug("Json data", data)

        if "error\":true" in self.html:
            self.offline()
        else:
            self.link = data['downloadlink']


getInfo = create_getInfo(FastixRu)
Ejemplo n.º 23
0
                download_status = json_loads(res)['download']

                if download_status['status'] == '100':
                    link_status['generated'] = download_status['rpnet_link']
                    self.logDebug("Successfully downloaded to rpnet HDD: %s" %
                                  link_status['generated'])
                    break
                else:
                    self.logDebug("At %s%% for the file download" %
                                  download_status['status'])

                self.setWait(30)
                self.wait()
                my_try += 1

            if my_try > max_tries:  # We went over the limit!
                self.fail(
                    _("Waited for about 15 minutes for download to finish but failed"
                      ))

        if 'generated' in link_status:
            self.link = link_status['generated']
            return
        elif 'error' in link_status:
            self.fail(link_status['error'])
        else:
            self.fail(_("Something went wrong, not supposed to enter here"))


getInfo = create_getInfo(RPNetBiz)
Ejemplo n.º 24
0
    __description__ = """Over-Load.me multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("marley", "*****@*****.**")]


    def setup(self):
        self.chunk_limit = 5


    def handle_premium(self, pyfile):
        data  = self.account.get_data(self.user)
        page  = self.load("https://api.over-load.me/getdownload.php",
                          get={'auth': data['password'],
                               'link': pyfile.url})

        data = json_loads(page)

        self.log_debug(data)

        if data['error'] == 1:
            self.log_warning(data['msg'])
            self.temp_offline()
        else:
            self.link = data['downloadlink']
            if pyfile.name and pyfile.name.endswith('.tmp') and data['filename']:
                pyfile.name = data['filename']
                pyfile.size = parse_size(data['filesize'])


getInfo = create_getInfo(OverLoadMe)
Ejemplo n.º 25
0
    def handle_premium(self, pyfile):
        user, data = self.account.select()

        for _i in xrange(5):
            #: Try it five times
            header = self.load("http://www.free-way.bz/load.php",  #@TODO: Revert to `https` in 0.4.10
                               get={'multiget': 7,
                                    'url'     : pyfile.url,
                                    'user'    : user,
                                    'pw'      : self.account.get_info(self.user)['login']['password'],
                                    'json'    : ""},
                               just_header=True)

            if 'location' in header:
                headers = self.load(header['location'], just_header=True)
                if headers['code'] == 500:
                    #: Error on 2nd stage
                    self.log_error(_("Error [stage2]"))
                else:
                    #: Seems to work..
                    self.download(header['location'])
                    break
            else:
                #: Error page first stage
                self.log_error(_("Error [stage1]"))

            #@TODO: handle errors


getInfo = create_getInfo(FreeWayMe)
Ejemplo n.º 26
0
            self.retry(5, 60, "Reached maximum connctions")

        elif "trafficlimit" in page:
            self.logWarning(_("Reached daily limit for this host"))
            self.retry(wait_time=secondsToMidnight(gmt=2), reason="Daily limit for this host reached")

        elif "hostererror" in page:
            self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry"))
            self.retry(5, 60, "Hoster is temporarily unavailable")

        try:
            self.pyfile.name = re.search(r'<name>([^<]+)</name>', page).group(1)
        except AttributeError:
            self.pyfile.name = ""

        try:
            self.pyfile.size = re.search(r'<size>(\d+)</size>', page).group(1)
        except AttributeError:
            self.pyfile.size = 0

        try:
            self.link = re.search(r'<download>([^<]+)</download>', page).group(1)
        except AttributeError:
            self.link = 'http://www.simply-premium.com/premium.php?link=' + self.pyfile.url

        if self.link != self.pyfile.url:
            self.logDebug("New URL: " + self.link)


getInfo = create_getInfo(SimplyPremiumCom)
Ejemplo n.º 27
0
                   ("revertfailed", "bool", "Revert to standard download if fails"             , True )]

    __description__ = """MegaRapido.net multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("Kagenoshin", "*****@*****.**")]


    LINK_PREMIUM_PATTERN = r'<\s*?a[^>]*?title\s*?=\s*?["\'].*?download["\'][^>]*?href=["\']([^"\']+)'

    ERROR_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']?alert-message error.*?>([^<]*)'


    def handle_premium(self, pyfile):
        self.data = self.load("http://megarapido.net/gerar.php",
                              post={'rand'     :random_with_N_digits(16),
                                    'urllist'  : pyfile.url,
                                    'links'    : pyfile.url,
                                    'exibir'   : "normal",
                                    'usar'     : "premium",
                                    'user'     : self.account.get_data('sid'),
                                    'autoreset': ""})

        if "desloga e loga novamente para gerar seus links" in self.data.lower():
            self.error(_("You have logged in at another place"))

        return super(MegaRapidoNet, self).handle_premium(pyfile)


getInfo = create_getInfo(MegaRapidoNet)

Ejemplo n.º 28
0

    def handlePremium(self, pyfile):
        #raise timeout to 2min
        self.download("http://premium.to/api/getfile.php",
                      get={'username': self.account.username,
                           'password': self.account.password,
                           'link'    : pyfile.url},
                      disposition=True)


    def checkFile(self, rules={}):
        if self.checkDownload({'nopremium': "No premium account available"}):
            self.retry(60, 5 * 60, "No premium account available")

        err = ''
        if self.req.http.code == '420':
            # Custom error code send - fail
            file = fs_encode(self.lastDownload)
            with open(file, "rb") as f:
                err = f.read(256).strip()
            remove(file)

        if err:
            self.fail(err)

        return super(PremiumTo, self).checkFile(rules)


getInfo = create_getInfo(PremiumTo)
    def handle_premium(self, pyfile):
        #: Fix the links for simply-debrid.com!
        self.link = replace_patterns(pyfile.url, [("clz.to", "cloudzer.net/file")
                                                  ("http://share-online", "http://www.share-online")
                                                  ("ul.to", "uploaded.net/file")
                                                  ("uploaded.com", "uploaded.net")
                                                  ("filerio.com", "filerio.in")
                                                  ("lumfile.com", "lumfile.se")])

        if 'fileparadox' in self.link:
            self.link = self.link.replace("http://", "https://")

        self.data = self.load("http://simply-debrid.com/api.php", get={'dl': self.link})
        if 'tiger Link' in self.data or 'Invalid Link' in self.data or ('API' in self.data and 'ERROR' in self.data):
            self.error(_("Unable to unrestrict link"))

        self.link = self.data

        self.wait(5)


    def check_download(self):
        if self.check_file({'error': "No address associated with hostname"}):
            self.retry(24, 3 * 60, _("Bad file downloaded"))

        return super(SimplydebridCom, self).check_download()


getInfo = create_getInfo(SimplydebridCom)
Ejemplo n.º 30
0
            self.temp_offline("Data not found")

        self.log_debug(parsed)

        if "errno" in parsed.keys():
            if parsed['errno'] in self.ERROR_CODES:
                #: Error code in known
                self.fail(self.ERROR_CODES[parsed['errno']])
            else:
                #: Error code isn't yet added to plugin
                self.fail(parsed['errstring'] or
                          _("Unknown error (code: %s)") % parsed['errno'])

        if "sdownload" in parsed:
            if parsed['sdownload'] == "1":
                self.fail(
                    _("Download from %s is possible only using NoPremium.pl website \
                    directly") % parsed['hosting'])

        pyfile.name = parsed['filename']
        pyfile.size = parsed['filesize']

        try:
            self.link = self.run_file_query(pyfile.url, 'filedownload')

        except Exception:
            self.temp_offline("Query error #2")


getInfo = create_getInfo(NoPremiumPl)
Ejemplo n.º 31
0
    URL_REPLACEMENTS = [("https://", "http://")]

    def handlePremium(self, pyfile):
        self.html = self.load("http://www.debriditalia.com/api.php",
                              get={
                                  'generate': "on",
                                  'link': pyfile.url,
                                  'p': self.getPassword()
                              })

        if "ERROR:" not in self.html:
            self.link = self.html.strip()
        else:
            self.info['error'] = re.search(r'ERROR:(.*)',
                                           self.html).group(1).strip()

            self.html = self.load("http://debriditalia.com/linkgen2.php",
                                  post={
                                      'xjxfun': "convertiLink",
                                      'xjxargs[]':
                                      "S<![CDATA[%s]]>" % pyfile.url,
                                      'xjxargs[]': "S%s" % self.getPassword()
                                  })
            try:
                self.link = re.search(r'<a href="(.+?)"', self.html).group(1)
            except AttributeError:
                pass


getInfo = create_getInfo(DebridItaliaCom)
Ejemplo n.º 32
0
    __version__ = "0.08"

    __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'

    __description__ = """Myfastfile.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("stickell", "*****@*****.**")]


    def setup(self):
        self.chunkLimit = -1


    def handlePremium(self, pyfile):
        self.logDebug("Original URL: %s" % pyfile.url)

        page = self.load('http://myfastfile.com/api.php',
                         get={'user': self.user, 'pass': self.account.getAccountData(self.user)['password'],
                              'link': pyfile.url})
        self.logDebug("JSON data: " + page)
        page = json_loads(page)
        if page['status'] != 'ok':
            self.fail(_("Unable to unrestrict link"))
        self.link = page['link']

        if self.link != pyfile.url:
            self.logDebug("Unrestricted URL: " + self.link)


getInfo = create_getInfo(MyfastfileCom)
Ejemplo n.º 33
0
        for _i in xrange(5):
            # try it five times
            header = self.load(
                "http://www.free-way.bz/load.php",  #@TODO: Revert to `https` in 0.4.10
                get={
                    'multiget': 7,
                    'url': pyfile.url,
                    'user': user,
                    'pw': self.account.getAccountData(user)['password'],
                    'json': ""
                },
                just_header=True)

            if 'location' in header:
                headers = self.load(header['location'], just_header=True)
                if headers['code'] == 500:
                    # error on 2nd stage
                    self.logError(_("Error [stage2]"))
                else:
                    # seems to work..
                    self.download(header['location'])
                    break
            else:
                # error page first stage
                self.logError(_("Error [stage1]"))

            #@TODO: handle errors


getInfo = create_getInfo(FreeWayMe)
Ejemplo n.º 34
0
        user, data = self.account.selectAccount()

        # Get rewritten link using the premiumize.me api v1 (see https://secure.premiumize.me/?show=api)
        data = json_loads(self.load("https://api.premiumize.me/pm-api/v1.php",
                                    get={'method'       : "directdownloadlink",
                                         'params[login]': user,
                                         'params[pass]' : data['password'],
                                         'params[link]' : pyfile.url}))

        # Check status and decide what to do
        status = data['status']

        if status == 200:
            self.link = data['result']['location']
            return

        elif status == 400:
            self.fail(_("Invalid link"))

        elif status == 404:
            self.offline()

        elif status >= 500:
            self.tempOffline()

        else:
            self.fail(data['statusmessage'])


getInfo = create_getInfo(PremiumizeMe)
Ejemplo n.º 35
0
# -*- coding: utf-8 -*-

import urllib

from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo


class RehostTo(MultiHoster):
    __name__    = "RehostTo"
    __type__    = "hoster"
    __version__ = "0.22"

    __pattern__ = r'https?://.*rehost\.to\..+'
    __config__  = [("use_premium", "bool", "Use premium account if available", True)]

    __description__ = """Rehost.com multi-hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("RaNaN", "*****@*****.**")]


    def handlePremium(self, pyfile):
        self.download("http://rehost.to/process_download.php",
                      get={'user': "******",
                           'pass': self.account.getAccountInfo(self.user)['session'],
                           'dl'  : pyfile.url},
                      disposition=True)


getInfo = create_getInfo(RehostTo)
Ejemplo n.º 36
0
            self.load(
                "http://api.premiumize.me/pm-api/v1.php",  #@TODO: Revert to `https` in 0.4.10
                get={
                    'method': "directdownloadlink",
                    'params[login]': user,
                    'params[pass]': data['password'],
                    'params[link]': pyfile.url
                }))

        # Check status and decide what to do
        status = data['status']

        if status == 200:
            self.link = data['result']['location']
            return

        elif status == 400:
            self.fail(_("Invalid link"))

        elif status == 404:
            self.offline()

        elif status >= 500:
            self.tempOffline()

        else:
            self.fail(data['statusmessage'])


getInfo = create_getInfo(PremiumizeMe)
Ejemplo n.º 37
0
            self.temp_offline("Data not found")

        self.log_debug(parsed)

        if "errno" in parsed.keys():
            if parsed['errno'] in self.ERROR_CODES:
                #: Error code in known
                self.fail(self.ERROR_CODES[parsed['errno']])
            else:
                #: Error code isn't yet added to plugin
                self.fail(parsed['errstring'] or
                          _("Unknown error (code: %s)") % parsed['errno'])

        if "sdownload" in parsed:
            if parsed['sdownload'] == "1":
                self.fail(
                    _("Download from %s is possible only using Rapideo.pl website \
                    directly") % parsed['hosting'])

        pyfile.name = parsed['filename']
        pyfile.size = parsed['filesize']

        try:
            self.link = self.run_file_query(pyfile.url, 'filedownload')

        except Exception:
            self.temp_offline("Query error #2")


getInfo = create_getInfo(RapideoPl)