self.drun = True try: try: self.c.perform () if self.completed_cb != None: self.completed_cb (self) except: pass finally: self.c.close () f.close () def download_progress (self, dt, dd, ut, ud): if self.resume: dd += self.resume if self.progress_cb: self.progress_cb (dt, dd, ut, ud) if not self.drun: return 1 def close (self): self.drun = False self.join () self.c.close () from downman.downloaders.hosters import factory factory.add_hoster (Rapidshare, RAPIDSHARE_MATCH)
class MUDecryptor (GenericHost): status = 'Unchecked' def __init__ (self, url, downman): self.url = url self.name = url self.total = 0 self.folderid = re.search ('\?f=([A-Za-z0-9]+)', self.url).group (1) def start_get_info (self): self.tfile = TempFile ('http://megaupload.com/xml/folderfiles.php?folderid=%s' % (self.folderid)) self.tfile.completed_cb = self.handle_tfile_done self.tfile.start () def handle_tfile_done (self, tfile): rows = re.findall ('<ROW .*?</ROW>', tfile.contents) if len (rows) != 0: self.links = [] for row in rows: self.links.append (re.search ('url="([^"]*)"', row).group (1)) self.set_state (STATE_INFO_COMPLETED) from downman.downloaders.hosters import factory factory.add_hoster (MUDownload, MUDOWNLOAD_MATCH) factory.add_hoster (MUDecryptor, MUDECRYPTOR_MATCH)