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)
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 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"})
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)
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" })
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"}, )
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.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)