bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _get_users(self, filename): f = open(filename) for line in f: user = line.split(':', 1)[0] if user: yield user.decode('utf-8') | def _get_users(self, filename): f = open(filename, 'Ur') for line in f: user = line.split(':', 1)[0] if user: yield user.decode('utf-8') | 450,100 |
def _get_users(self, filename): f = open(filename) for line in f: user = line.split(':', 1)[0] if user: yield user.decode('utf-8') | def_get_users(self,filename):f=open(filename)forlineinf:user=line.split(':',1)[0]ifuser:yielduser.decode('utf-8') | 450,101 |
def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | 450,102 |
def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | 450,103 |
def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | def _do_config(self, req): stores = StoreOrder(stores=self.account_manager.stores, list=self.account_manager.password_store) if req.method == 'POST': _setorder(req, stores) self.config.set('account-manager', 'password_store', ','.join(stores.get_enabled_store_names())) for store in stores.get_all_stores(): for attr, op... | 450,104 |
def process_request(self, req): if req.path_info.startswith('/login') and req.authname == 'anonymous': referrer = self._referer(req) or req.abs_href() data = { 'referer': referrer, 'reset_password_enabled': AccountModule(self.env).reset_password_enabled, 'persistent_sessions': AccountManager(self.env).persistent_sessio... | def process_request(self, req): if req.path_info.startswith('/login') and req.authname == 'anonymous': referrer = self._referer(req) if referrer is None or \ referrer.startswith(str(req.abs_href()) + '/login'): referrer = req.abs_href() data = { 'referer': referrer, 'reset_password_enabled': AccountModule(self.env).re... | 450,105 |
def salt(): s = '' v = long(hexlify(urandom(4)), 16) itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' for i in range(8): s += itoa64[v & 0x3f]; v >>= 6 return s | def salt(): s = '' v = long(hexlify(urandom(6)), 16) itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' for i in range(8): s += itoa64[v & 0x3f]; v >>= 6 return s | 450,106 |
def _do_login(self, req): if not req.remote_user: req.redirect(self.env.abs_href()) res = auth.LoginModule._do_login(self, req) if req.args.get('rememberme', '0') == '1': # Set the session to expire in 30 days (and not when to browser is # closed - what is the default). req.outcookie['trac_auth']['expires'] = 86400 * 3... | def _do_login(self, req): if not req.remote_user: self._redirect_back(req) res = auth.LoginModule._do_login(self, req) if req.args.get('rememberme', '0') == '1': # Set the session to expire in 30 days (and not when to browser is # closed - what is the default). req.outcookie['trac_auth']['expires'] = 86400 * 30 # This... | 450,107 |
def _remote_user(self, req): user = req.args.get('user') password = req.args.get('password') if not user or not password: return None if AccountManager(self.env).check_password(user, password): return user return None | def _remote_user(self, req): user = req.args.get('user') password = req.args.get('password') if not user or not password: return None if AccountManager(self.env).check_password(user, password): return user return None | 450,108 |
def user_email_verification_requested(self, user, token): """User verification requested """ | def user_email_verification_requested(self, user, token): """User verification requested """ | 450,109 |
def download_html(self): for i in range(5): self.html[0] = self.load(self.pyfile.url) try: url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) except: continue | def download_html(self): for i in range(5): self.html[0] = self.load(self.pyfile.url) try: url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) except: continue | 450,110 |
def white(string): return "\033[1;37m" + string + "\033[0m" | def white(string): return "\033[1;37m" + string + "\033[0m" | 450,111 |
def white(string): return "\033[1;37m" + string + "\033[0m" | def white(string): return "\033[1;37m" + string + "\033[0m" | 450,112 |
def white(string): return "\033[1;37m" + string + "\033[0m" | def white(string): return "\033[1;37m" + string + "\033[0m" | 450,113 |
def white(string): return "\033[1;37m" + string + "\033[0m" | def white(string): return "\033[1;37m" + string + "\033[0m" | 450,114 |
def download_html(self): self.log.debug("Netload: Entering download_html") page = self.load(self.url) t = time() + 30 | def download_html(self): self.log.debug("Netload: Entering download_html") page = self.load(self.url) t = time() + 30 | 450,115 |
def getInfo(urls): ids = "" names = "" p = re.compile(RapidshareCom.__pattern__) for url in urls: r = p.search(url) if r.group("name"): ids+= ","+r.group("id") names+= ","+r.group("name") elif r.group("name_new"): ids+= ","+r.group("id_new") names+= ","+r.group("name_new") url = "http://api.rapidshare.com/cgi-bin/... | def getInfo(urls): ids = "" names = "" p = re.compile(RapidshareCom.__pattern__) for url in urls: r = p.search(url) if r.group("name"): ids+= ","+r.group("id") names+= ","+r.group("name") elif r.group("name_new"): ids+= ","+r.group("id_new") names+= ","+r.group("name_new") url = "http://api.rapidshare.com/cgi-bin/... | 450,116 |
def getInfo(urls): api_url_base = "http://api.hotfile.com/" for chunk in chunks(urls, 90): api_param_file = {"action":"checklinks","links": ",".join(chunk),"fields":"id,status,name,size"} #api only supports old style links src = getURL(api_url_base, post=api_param_file) result = [] for i, res in enumerate(src.split("\... | def getInfo(urls): api_url_base = "http://api.hotfile.com/" for chunk in chunks(urls, 90): api_param_file = {"action":"checklinks","links": ",".join(chunk),"fields":"id,status,name,size"} #api only supports old style links src = getURL(api_url_base, post=api_param_file) result = [] for i, res in enumerate(src.split("\... | 450,117 |
def freeDownload(self): form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) self.html[1] = self.load(self.pyfile.url, post=form_posts, cookies=True) re_captcha = ReCaptcha(self) challenge = re.s... | def freeDownload(self): form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) self.html[1] = self.load(self.pyfile.url, post=form_posts, cookies=True) re_captcha = ReCaptcha(self) challenge = re.s... | 450,118 |
def selectAccount(self): """ returns an valid account name and data""" usable = [] for user,data in self.accounts.iteritems(): if not data["valid"]: continue | def selectAccount(self): """ returns an valid account name and data""" usable = [] for user,data in self.accounts.iteritems(): if not data["valid"]: continue | 450,119 |
def white(string): return "\033[1;37m" + string + "\033[0m" | def white(string): return "\033[1;37m" + string + "\033[0m" | 450,120 |
def __init__(self, parent): Hoster.__init__(self, parent) self.parent = parent self.html = [None, None, None] self.want_reconnect = False self.multi_dl = False self.api_data = None self.init_ocr() self.read_config() if self.config['premium']: self.multi_dl = True else: self.multi_dl = False | def setup(self): self.multiDL = False def process(self, pyfile): self.html = [None, None, None] self.want_reconnect = False self.multi_dl = False self.api_data = None self.init_ocr() self.read_config() if self.config['premium']: self.multi_dl = True else: self.multi_dl = False | 450,121 |
def __init__(self, parent): Hoster.__init__(self, parent) self.parent = parent self.html = [None, None, None] self.want_reconnect = False self.multi_dl = False self.api_data = None self.init_ocr() self.read_config() if self.config['premium']: self.multi_dl = True else: self.multi_dl = False | def __init__(self, parent): Hoster.__init__(self, parent) self.parent = parent self.html = [None, None, None] self.want_reconnect = False self.multi_dl = False self.api_data = None self.init_ocr() self.read_config() if self.config['premium']: self.multi_dl = True else: self.multi_dl = False | 450,122 |
def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | 450,123 |
def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | 450,124 |
def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.want_reconnect = False | 450,125 |
def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.ap... | def download_api_data(self): url = self.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data ... | 450,126 |
def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.ap... | def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_da... | 450,127 |
def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.ap... | def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.ap... | 450,128 |
def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | def download_html(self): self.html[0] = self.load(self.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url = "http://n... | 450,129 |
def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | 450,130 |
def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | 450,131 |
def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | 450,132 |
def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | def download_html(self): self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): self.html[1] = self.req.load(url_captcha_html, cookies=True) try: captcha_url ... | 450,133 |
def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\... | def get_wait_time(self): if re.search(r"We had a request with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\... | 450,134 |
def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\... | def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.wantReconnect = True return wait_minutes * 60 wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1))... | 450,135 |
def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\... | def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\... | 450,136 |
def get_file_name(self): if self.api_data and self.api_data["filename"]: return self.api_data["filename"] elif self.html[0]: file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">' file_name_search = re.search(file_name_pattern, self.html[0]) if file_name_search: return file_name_search.group(1) return self.pare... | def get_file_name(self): if self.api_data and self.api_data["filename"]: return self.api_data["filename"] elif self.html[0]: file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">' file_name_search = re.search(file_name_pattern, self.html[0]) if file_name_search: return file_name_search.group(1) return self.pare... | 450,137 |
def proceed(self, url, location): if self.config['premium']: self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.req.download(url, location, cookies=True) | def proceed(self, url, location): if self.config['premium']: self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.req.download(url, location, cookies=True) | 450,138 |
def handleFree(self): | def handleFree(self): | 450,139 |
def postCheck(self, dl): | def postCheck(self, dl): | 450,140 |
def postCheck(self, dl): | def postCheck(self, dl): | 450,141 |
def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url,ref=False) print self.html[1] sleep(1) self.no_download = True | 450,142 |
def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | 450,143 |
def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | def freeWait(self): """downloads html with the important informations """ self.html[1] = self.load(self.pyfile.url) self.no_download = True | 450,144 |
def coreReady(self): self.port = int(self.core.config['webinterface']['port']) if self.core.config['webinterface']['activated']: try: | def coreReady(self): self.port = int(self.core.config['webinterface']['port']) if self.core.config['webinterface']['activated']: try: | 450,145 |
def proxy(*settings): thread.start_new_thread(server, settings) lock = thread.allocate_lock() lock.acquire() lock.acquire() | def proxy(self, *settings): thread.start_new_thread(server, (self,)+settings) lock = thread.allocate_lock() lock.acquire() lock.acquire() | 450,146 |
def server(*settings): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dock_socket.bind((settings[0], settings[2])) dock_socket.listen(5) while True: client_socket = dock_socket.accept()[0] server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.connect(("127.0.0.1", setting... | def server(self, *settings): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dock_socket.bind((settings[0], settings[2])) dock_socket.listen(5) while True: client_socket = dock_socket.accept()[0] server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.connect(("127.0.0.1", s... | 450,147 |
def server(*settings): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dock_socket.bind((settings[0], settings[2])) dock_socket.listen(5) while True: client_socket = dock_socket.accept()[0] server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.connect(("127.0.0.1", setting... | def server(*settings): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dock_socket.bind((settings[0], settings[2])) dock_socket.listen(5) while True: client_socket = dock_socket.accept()[0] server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.connect(("127.0.0.1", setting... | 450,148 |
def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs from random import randint jid = randint(0,1000) print "Get file for downloading, id:", jid if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jo... | def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jobCache[occ].append("empty") else: pyfile = self.getFile(id) else: jobs = self.db.getJob(occ)... | 450,149 |
def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs from random import randint jid = randint(0,1000) print "Get file for downloading, id:", jid if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jo... | def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs from random import randint jid = randint(0,1000) print "Get file for downloading, id:", jid if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jo... | 450,150 |
def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs from random import randint jid = randint(0,1000) print "Get file for downloading, id:", jid if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jo... | def getJob(self, occ): """get suitable job""" #@TODO clean mess #@TODO improve selection of valid jobs from random import randint jid = randint(0,1000) print "Get file for downloading, id:", jid if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None self.jo... | 450,151 |
def save(self): self.lock.acquire() pdata = { "version": LIST_VERSION, "queue": [], "packages": [], "collector": [] } | def save(self): self.lock.acquire() pdata = { "version": LIST_VERSION, "queue": [], "packages": [], "collector": [] } | 450,152 |
def set(self, pypack): self.data = pypack.data self.files = map(PyLoadFileData().set, pypack.files) return self | def set(self, pypack): self.data = pypack.data self.files = [PyLoadFileData().set(x) for x in pypack.files] return self | 450,153 |
def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False): """ returns the content loaded """ if self.pyfile.abort: raise Abort return self.req.load(url, get, post, ref, cookies, just_header) | def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False): """ returns the content loaded """ if self.pyfile.abort: raise Abort return self.req.load(url, get, post, ref, cookies, just_header) | 450,154 |
def handleFree(self): if r'<div id="captchaArea" style="display:none;">' in self.html or \ r'/showCaptcha\(\);' in self.html: # we got a captcha id = re.search(r"var reCAPTCHA_publickey='(.*?)';", self.html).group(1) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) shortencode = re.search(r'name=... | def handleFree(self): if r'<div id="captchaArea" style="display:none;">' in self.html or \ r'/showCaptcha\(\);' in self.html: # we got a captcha id = re.search(r"var reCAPTCHA_publickey='(.*?)';", self.html).group(1) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) shortencode = re.search(r'name=... | 450,155 |
def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | 450,156 |
def get_file_name(self): if self.html == None: self.download_html() | def get_file_name(self): if self.html == None: self.download_html() | 450,157 |
def ask(self, qst, default, answers=[], bool=False, password=False): """produce one line to asking for input""" if answers: info = "(" | def ask(self, qst, default, answers=[], bool=False, password=False): """produce one line to asking for input""" if answers: info = "(" | 450,158 |
def ask(self, qst, default, answers=[], bool=False, password=False): """produce one line to asking for input""" if answers: info = "(" | def ask(self, qst, default, answers=[], bool=False, password=False): """produce one line to asking for input""" if answers: info = "(" | 450,159 |
def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue size = re.search(r"<span><strong>(.*?) MB</strong>", html).group(1) size = int(float(size)*1024*1024) name = re.search('<h1>(.*?)<br/></h1>', html).group(1) ... | def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue size = re.search(r'<span style="float: left;"><strong>(.*?) MB</strong>', html).group(1) size = int(float(size)*1024*1024) name = re.search('<h1>(.*?)<br/></... | 450,160 |
def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue size = re.search(r"<span><strong>(.*?) MB</strong>", html).group(1) size = int(float(size)*1024*1024) name = re.search('<h1>(.*?)<br/></h1>', html).group(1) ... | def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue size = re.search(r"<span><strong>(.*?) MB</strong>", html).group(1) size = int(float(size)*1024*1024) name = re.search('<h1>(.*?)<br/></h1>', html).group(1) ... | 450,161 |
def get_file_url(self): """ returns the absolute downloadable filepath """ file_url_pattern = r"var \w* = '(http%.*?)';" file_url_search = re.search(file_url_pattern, self.html).group(1) file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) return file_url... | def get_file_url(self): """ returns the absolute downloadable filepath """ file_url_pattern = r"var \w* = '(http%.*?)';" file_url_search = re.search(file_url_pattern, self.html).group(1) file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("cxc", "www").replace("unlg", "v").replace("konaworld", "zipp... | 450,162 |
def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, no_post_encode=False, raw_cookies={}): """ returns the content loaded """ if self.pyfile.abort: raise Abort | def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, no_post_encode=False, raw_cookies={}): """ returns the content loaded """ if self.pyfile.abort: raise Abort | 450,163 |
def print_dep(self, name, value): """Print Status of dependency""" if value: print _("%s: OK" % name) else: print _("%s: missing" % name) | def print_dep(self, name, value): """Print Status of dependency""" if value: print _("%s: OK") % name else: print _("%s: missing" % name) | 450,164 |
def print_dep(self, name, value): """Print Status of dependency""" if value: print _("%s: OK" % name) else: print _("%s: missing" % name) | def print_dep(self, name, value): """Print Status of dependency""" if value: print _("%s: OK" % name) else: print _("%s: missing" % name) | 450,165 |
def assignJob(self): """assing a job to a thread if possible""" if self.pause or not self.core.server_methods.is_time_download(): return free = [x for x in self.threads if not x.active] | def assignJob(self): """assing a job to a thread if possible""" if self.pause or not self.core.server_methods.is_time_download(): return free = [x for x in self.threads if not x.active] | 450,166 |
def tryReconnect(self): """checks if reconnect needed""" | def tryReconnect(self): """checks if reconnect needed""" | 450,167 |
def conf_basic(self): print "" print _("## Basic Setup ##") | def conf_basic(self): print "" print _("## Basic Setup ##") | 450,168 |
def set_user(self): | def set_user(self): | 450,169 |
def getPackageData(self, id): """returns dict with package information""" pack = self.getPackage(id) if not pack: return None pack = pack.toDict()[id] data = self.db.getPackageData(id) tmplist = [] for x in self.cache.itervalues(): if int(x.toDbDict()[x.id]["package"]) == int(id): tmplist.append((str(x.id), x.toDbD... | def getPackageData(self, id): """returns dict with package information""" pack = self.getPackage(id) if not pack: return None pack = pack.toDict()[id] data = self.db.getPackageData(id) tmplist = [] cache = self.cache.values() for x in cache: if int(x.toDbDict()[x.id]["package"]) == int(id): tmplist.append((str(x.i... | 450,170 |
def getJob(self, occ): """return pyfile instance, which is suitable for download and dont use a occupied plugin""" cmd = "(" i = 0 for item in occ: if i != 0: cmd += ", " cmd += "'%s'" % item cmd += ")" cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN ... | def getJob(self, occ): """return pyfile instance, which is suitable for download and dont use a occupied plugin""" cmd = "(" for i, item in enumerate(occ): if i != 0: cmd += ", " cmd += "'%s'" % item cmd += ")" cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin... | 450,171 |
def abortDownload(self): """abort pyfile if possible""" while self.id in self.m.core.threadManager.processingIds(): self.abort = True if self.plugin and self.plugin.req: self.plugin.req.abort = True sleep(0.1) abort = False if self.plugin and self.plugin.req: self.plugin.req.abort = False | def abortDownload(self): """abort pyfile if possible""" while self.id in self.m.core.threadManager.processingIds(): self.abort = True if self.plugin and self.plugin.req: self.plugin.req.abort = True sleep(0.1) self.abort = False if self.plugin and self.plugin.req: self.plugin.req.self.abort = False | 450,172 |
def handleSeason(self, url): src = self.getSJSrc(url) soup = BeautifulSoup(src) post = soup.find("div", attrs={"class": "post-content"}) ps = post.findAll("p") hosterPattern = re.compile("^http://download\.serienjunkies\.org/f-.*?/([rcfultns]{2})_.*?\.html$") preferredHoster = self.getConfig("preferredHoster").split(",... | def handleSeason(self, url): src = self.getSJSrc(url) soup = BeautifulSoup(src) post = soup.find("div", attrs={"class": "post-content"}) ps = post.findAll("p") hosterPattern = re.compile("^http://download\.serienjunkies\.org/f-.*?/([rcfultns]{2})_.*?\.html$") preferredHoster = self.getConfig("preferredHoster").split(",... | 450,173 |
def proceed(self, linkList, location): txt = open(linkList, 'r') links = txt.readlines() packages = {"Parsed links":[],} curPack = "Parsed links" for link in links: if link != "\n": link = link.strip() if link.startswith(";"): continue if link.startswith("[") and link.endswith("]\n"): # new package curPack = link[1:-2]... | def proceed(self, linkList, location): txt = open(linkList, 'r') links = txt.readlines() packages = {"Parsed links":[],} curPack = "Parsed links" for link in links: if link != "\n": link = link.strip() if link.startswith(";"): continue if link.startswith("[") and link.endswith("]"): # new package curPack = link[1:-2] p... | 450,174 |
def prepare(self): self.download_api_data() if self.file_exists(): self.pyfile.name = self.get_file_name() | def prepare(self): self.download_api_data() if self.file_exists(): self.pyfile.name = self.get_file_name() | 450,175 |
def get_wait_time(self): if re.search(r"We had a request with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.wantReconnect = True return wait_minutes * 60 wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1))... | def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.wantReconnect = True return wait_minutes * 60 wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1))... | 450,176 |
def __init__(self, core): """Constructor""" self.core = core | def __init__(self, core): """Constructor""" self.core = core | 450,177 |
def new(*args): args[0].lock.acquire() res = func(*args) args[0].lock.release() return res | def new(*args): args[0].lock.acquire() res = func(*args) args[0].lock.release() return res | 450,178 |
def getCompleteData(self, queue=1): """gets a complete data representation""" | def getCompleteData(self, queue=1): """gets a complete data representation""" | 450,179 |
def addPackage(self, name, folder, queue=0): """adds a package, default to link collector""" lastID = self.db.addPackage(name, folder, queue) p = self.db.getPackage(lastID) e = InsertEvent("pack", lastID, p.order, "collector" if not queue else "queue") self.core.pullManager.addEvent(e) return lastID | def addPackage(self, name, folder, queue=0): """adds a package, default to link collector""" lastID = self.db.addPackage(name, folder, queue) p = self.db.getPackage(lastID) e = InsertEvent("pack", lastID, p.order, "collector" if not queue else "queue") self.core.pullManager.addEvent(e) return lastID | 450,180 |
def deletePackage(self, id): """delete package and all contained links""" p = self.getPackage(id) e = RemoveEvent("pack", id, "collector" if not p.queue else "queue") pyfiles = self.cache.values() for pyfile in pyfiles: if pyfile.packageid == id: pyfile.abortDownload() pyfile.release() | def deletePackage(self, id): """delete package and all contained links""" p = self.getPackage(id) e = RemoveEvent("pack", id, "collector" if not p.queue else "queue") pyfiles = self.cache.values() for pyfile in pyfiles: if pyfile.packageid == id: pyfile.abortDownload() pyfile.release() | 450,181 |
def getJob(self, occ): """get suitable job""" #@TODO clean mess if self.jobCache.has_key(occ): if self.jobCache[occ]: id = self.jobCache[occ].pop() if id == "empty": pyfile = None else: pyfile = self.getFile(id) else: jobs = self.db.getJob(occ) jobs.reverse() if not jobs: self.jobCache[occ].append("empty") pyfile = N... | defgetJob(self,occ):"""getsuitablejob"""#@TODOcleanmessifself.jobCache.has_key(occ):ifself.jobCache[occ]:id=self.jobCache[occ].pop()ifid=="empty":pyfile=Noneelse:pyfile=self.getFile(id)else:jobs=self.db.getJob(occ)jobs.reverse()ifnotjobs:self.jobCache[occ].append("empty")pyfile=Noneelse:self.jobCache[occ].extend(jobs)p... | 450,182 |
def getQueueCount(self): """number of files that have to be processed""" pass | def getQueueCount(self): """number of files that have to be processed""" pass | 450,183 |
def restartPackage(self, id): """restart package""" for pyfile in self.cache.itervalues(): if pyfile.packageid == id: self.restartFile(pyfile.id) self.db.restartPackage(id) e = UpdateEvent("pack", id, "collector" if not self.getPackage(id).queue else "queue") self.core.pullManager.addEvent(e) | def restartPackage(self, id): """restart package""" pyfiles = self.cache.values() for pyfile in pyfiles: if pyfile.packageid == id: self.restartFile(pyfile.id) self.db.restartPackage(id) e = UpdateEvent("pack", id, "collector" if not self.getPackage(id).queue else "queue") self.core.pullManager.addEvent(e) | 450,184 |
def restartPackage(self, id): """restart package""" for pyfile in self.cache.itervalues(): if pyfile.packageid == id: self.restartFile(pyfile.id) self.db.restartPackage(id) e = UpdateEvent("pack", id, "collector" if not self.getPackage(id).queue else "queue") self.core.pullManager.addEvent(e) | def restartPackage(self, id): """restart package""" for pyfile in self.cache.itervalues(): if pyfile.packageid == id: self.restartFile(pyfile.id) self.db.restartPackage(id) e = UpdateEvent("pack", id, "collector" if not self.getPackage(id).queue else "queue") self.core.pullManager.addEvent(e) | 450,185 |
def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].abortDownload() self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].sync() else: self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).packa... | def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].sync() else: self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).package().queue else "queue") self.c... | 450,186 |
def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].abortDownload() self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].sync() else: self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).packa... | def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].abortDownload() self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].abortDownload() self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).... | 450,187 |
def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].abortDownload() self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].sync() else: self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).packa... | def restartFile(self, id): """ restart file""" if self.cache.has_key(id): self.cache[id].abortDownload() self.cache[id].status = 3 self.cache[id].name = self.cache[id].url self.cache[id].error = "" self.cache[id].sync() else: self.db.restartFile(id) e = UpdateEvent("file", id, "collector" if not self.getFile(id).packa... | 450,188 |
def setPackageLocation(self, id, queue): """push package to queue""" pack = self.db.getPackage(id) e = RemoveEvent("pack", id, "collector" if not pack.queue else "queue") self.core.pullManager.addEvent(e) self.db.clearPackageOrder(pack) pack = self.db.getPackage(id) pack.queue = queue self.db.updatePackage(pack) ... | def setPackageLocation(self, id, queue): """push package to queue""" pack = self.db.getPackage(id) e = RemoveEvent("pack", id, "collector" if not pack.queue else "queue") self.core.pullManager.addEvent(e) self.db.clearPackageOrder(pack) pack = self.db.getPackage(id) pack.queue = queue self.db.updatePackage(pack) ... | 450,189 |
def reorderPackage(self, id, position): p = self.db.getPackage(id) e = RemoveEvent("pack", id, "collector" if not p.queue else "queue") self.core.pullManager.addEvent(e) self.db.reorderPackage(p, position) self.db.commit() e = ReloadAllEvent("collector" if not p.queue else "queue") self.core.pullManager.addEvent(e)... | def reorderPackage(self, id, position): p = self.db.getPackage(id) e = RemoveEvent("pack", id, "collector" if not p.queue else "queue") self.core.pullManager.addEvent(e) self.db.reorderPackage(p, position) self.db.commit() e = ReloadAllEvent("collector" if not p.queue else "queue") self.core.pullManager.addEvent(e)... | 450,190 |
def __init__(self, manager, id, url, name, size, status, error, pluginname, package, order): self.m = manager self.m.cache[int(id)] = self self.id = int(id) self.url = url self.name = name self.size = size self.status = status self.pluginname = pluginname self.packageid = package #should not be used, use package() ins... | def __init__(self, manager, id, url, name, size, status, error, pluginname, package, order): self.m = manager self.id = int(id) self.url = url self.name = name self.size = size self.status = status self.pluginname = pluginname self.packageid = package #should not be used, use package() instead self.error = error self.... | 450,191 |
def get_file_name(self): if self.html == None: self.download_html() if not self.want_reconnect: file_name = re.search("<strong>Name: </strong>(.*)</font><br />", self.html).group(1) return file_name else: return self.parent.url | def get_file_name(self): if self.html == None: self.download_html() if not self.want_reconnect: file_name = re.search("<strong>Name: </strong>(.+?)</font>", self.html).group(1) return file_name else: return self.parent.url | 450,192 |
def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | 450,193 |
def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | 450,194 |
def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readline(1) version = content.split(":")[1].strip() if content else "" | 450,195 |
def get_file_name(self): if self.html == None: self.download_html() | def get_file_name(self): if self.html == None: self.download_html() | 450,196 |
def prepare(self, thread): self.want_reconnect = False tries = 0 | def prepare(self, thread): self.want_reconnect = False tries = 0 | 450,197 |
def download_api_data(self): url = self.parent.url match = re.compile(self.__pattern__).search(url) if match: src = self.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) if not src.find("404 Not Found"): return self.api_data = {} lines = src.splitlines() self.api_data["filena... | def download_api_data(self): url = self.parent.url match = re.compile(self.__pattern__).search(url) if match: src = self.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) if not src.find("404 Not Found"): return self.api_data = {} lines = src.splitlines() self.api_data["filena... | 450,198 |
def download_api_data(self, n=0): url = self.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}).strip() if no... | def download_api_data(self, n=0): url = self.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}).strip() if no... | 450,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.