Example #1
0
    def prepare(self):
        self.info = {}
        self.html = ""
        self.link = ""  #@TODO: Move to hoster class in 0.4.10
        self.directDL = False  #@TODO: Move to hoster class in 0.4.10

        if not self.getConfig('use_premium', True):
            self.retryFree()

        if self.LOGIN_ACCOUNT and not self.account:
            self.fail(_("Required account not found"))

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)

        if self.DIRECT_LINK is None:
            self.directDL = self.__pattern != r'^unmatchable$' and re.match(
                self.__pattern, self.pyfile.url)
        else:
            self.directDL = self.DIRECT_LINK

        self.pyfile.url = replace_patterns(self.pyfile.url,
                                           self.URL_REPLACEMENTS)
Example #2
0
    def prepare(self):
        self.info = {}
        self.html = ""

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)
    def prepare(self):
        self.info = {}
        self.html = ""

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)
Example #4
0
    def login(self, user, data, req):
        set_cookies(req.cj,
                    [("uploading.com", "lang"    , "1" ),
                     ("uploading.com", "language", "1" ),
                     ("uploading.com", "setlang" , "en"),
                     ("uploading.com", "_lang"   , "en")])

        req.load("http://uploading.com/")
        req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000),
                 post={'email': user, 'password': data['password'], 'remember': "on"})
Example #5
0
    def init(self):
        if not self.HOSTER_DOMAIN:
            self.logError(_("Missing HOSTER_DOMAIN"))
            self.COOKIES = False

        else:
            if not self.HOSTER_URL:
                self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN

            if isinstance(self.COOKIES, list):
                self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english"))
                set_cookies(req.cj, self.COOKIES)
Example #6
0
    def init(self):
        if not self.HOSTER_DOMAIN:
            self.logError(_("Missing HOSTER_DOMAIN"))
            self.COOKIES = False

        else:
            if not self.HOSTER_URL:
                self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN

            if isinstance(self.COOKIES, list):
                self.COOKIES.insert((self.HOSTER_DOMAIN, "lang", "english"))
                set_cookies(req.cj, self.COOKIES)
Example #7
0
    def login(self, user, data, req):
        set_cookies(req.cj, [("uploading.com", "lang", "1"),
                             ("uploading.com", "language", "1"),
                             ("uploading.com", "setlang", "en"),
                             ("uploading.com", "_lang", "en")])

        req.load("http://uploading.com/")
        req.load(
            "http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" %
            long(time.time() * 1000),
            post={
                'email': user,
                'password': data['password'],
                'remember': "on"
            })
Example #8
0
    def login(self, user, data, req):
        set_cookies(
            req.cj,
            [
                ("uploading.com", "lang", "1"),
                ("uploading.com", "language", "1"),
                ("uploading.com", "setlang", "en"),
                ("uploading.com", "_lang", "en"),
            ],
        )

        req.load("http://uploading.com/")
        req.load(
            "http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000),
            post={"email": user, "password": data["password"], "remember": "on"},
        )
Example #9
0
    def prepare(self):
        self.pyfile.error = ""  #@TODO: Remove in 0.4.10

        self.info  = {}
        self.html  = ""
        self.links = []  #@TODO: Move to hoster class in 0.4.10

        if self.LOGIN_PREMIUM and not self.premium:
            self.fail(_("Required premium account not found"))

        if self.LOGIN_ACCOUNT and not self.account:
            self.fail(_("Required account not found"))

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)

        self.pyfile.url = replace_patterns(self.pyfile.url, self.URL_REPLACEMENTS)
    def prepare(self):
        self.pyfile.error = ""  #@TODO: Remove in 0.4.10

        self.info  = {}
        self.html  = ""
        self.links = []  #@TODO: Move to hoster class in 0.4.10

        if self.LOGIN_PREMIUM and not self.premium:
            self.fail(_("Required premium account not found"))

        if self.LOGIN_ACCOUNT and not self.account:
            self.fail(_("Required account not found"))

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)

        self.pyfile.url = replace_patterns(self.pyfile.url, self.URL_REPLACEMENTS)
Example #11
0
    def prepare(self):
        self.info     = {}
        self.html     = ""
        self.link     = ""     #@TODO: Move to hoster class in 0.4.10
        self.directDL = False  #@TODO: Move to hoster class in 0.4.10

        if not self.getConfig('use_premium', True):
            self.retryFree()

        if self.LOGIN_ACCOUNT and not self.account:
            self.fail(_("Required account not found"))

        self.req.setOption("timeout", 120)

        if isinstance(self.COOKIES, list):
            set_cookies(self.req.cj, self.COOKIES)

        if self.DIRECT_LINK is None:
            self.directDL = self.__pattern != r'^unmatchable$' and re.match(self.__pattern, self.pyfile.url)
        else:
            self.directDL = self.DIRECT_LINK

        self.pyfile.url = replace_patterns(self.pyfile.url, self.URL_REPLACEMENTS)