def torrent_fetch(args): input_title = args.search page_limit = args.limit if args.thepiratebay or args.kickasstorrent: if not check_config.file_exists(): print( "\nConfig file not configured. Configure to continue. Read docs for more info.\n" ) sys.exit(2) else: if args.thepiratebay: import torrench.modules.thepiratebay as tpb tpb.main(input_title, page_limit) elif args.kickasstorrent: import torrench.modules.kickasstorrent as kat kat.main(input_title, page_limit) elif args.distrowatch: import torrench.modules.distrowatch as distrowatch distrowatch.main(input_title) elif args.all_magnets: magnets = [] from torrench.modules import thepiratebay, kickasstorrent for tracker in [kickasstorrent, thepiratebay]: proxy_list = tracker.proxy_select() url = tracker.cycle_proxies(proxy_list) output = tracker.get_results(url, input_title, page_limit) for result in tracker.mapper[1::]: magnets.append(result[1]) for magnet in magnets: print(magnet) else: import torrench.modules.linuxtracker as linuxtracker linuxtracker.main(input_title)
def resolve_args(self): """Resolve input arguments.""" if self.args.clear_html: if not self.args.thepiratebay: print("error: use -c with -t") sys.exit(2) else: self.remove_temp_files() if self.args.thepiratebay or self.args.kickasstorrent or self.args.skytorrents or self.args.xbit: if not self.file_exists(): print( "\nConfig file not configured. Configure to continue. Read docs for more info.\n" ) print( "Config file either does not exist or is not enabled! Exiting!" ) sys.exit(2) else: if self.args.thepiratebay: self.logger.debug("using thepiratebay") if self.args.top: self.logger.debug("selected TPB TOP-torrents") self.input_title = None self.page_limit = None self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.thepiratebay as tpb tpb.main(self.input_title, self.page_limit) elif self.args.kickasstorrent: self.logger.debug("Using kickasstorrents") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.kickasstorrent as kat kat.main(self.input_title, self.page_limit) elif self.args.skytorrents: self.logger.debug("Using skytorrents") if self.args.top: self.logger.debug("selected SkyTorrents TOP-torrents") self.input_title = None self.page_limit = None self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.skytorrents as sky sky.main(self.input_title, self.page_limit) elif self.args.xbit: self.logger.debug("Using XBit.pw") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.xbit as xbit xbit.main(self.input_title) elif self.args.distrowatch: self.logger.debug("Using distrowatch") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.distrowatch as distrowatch distrowatch.main(self.input_title) else: self.logger.debug("Using linuxtracker") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.linuxtracker as linuxtracker linuxtracker.main(self.input_title)
def resolve_args(self): """Resolve input arguments.""" _PRIVATE_MODULES = ( self.args.thepiratebay, self.args.kickasstorrent, self.args.skytorrents, self.args.rarbg, self.args.x1337, self.args.nyaa, self.args.idope, self.args.xbit, self.args.libgen, self.args.limetorrents, self.args.newpct ) # These modules are only enabled through manual configuration. if self.args.clear_html: if not self.args.thepiratebay: print("error: use -c with -t") sys.exit(2) else: self.remove_temp_files() if any(_PRIVATE_MODULES): if not self.file_exists(): print( "\nConfig file not configured. Configure to continue. Read docs for more info." ) print( "Config file either does not exist or is not enabled! Exiting!\n" ) sys.exit(2) else: if self.args.thepiratebay: self.logger.debug("using thepiratebay") if self.args.top: self.logger.debug("selected TPB TOP-torrents") self.input_title = None self.page_limit = None self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.thepiratebay as tpb tpb.main(self.input_title, self.page_limit) elif self.args.kickasstorrent: self.logger.debug("Using kickasstorrents") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.kickasstorrent as kat kat.main(self.input_title, self.page_limit) elif self.args.skytorrents: self.logger.debug("Using skytorrents") if self.args.top: self.logger.debug("selected SkyTorrents TOP-torrents") self.input_title = None self.page_limit = None self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.skytorrents as sky sky.main(self.input_title, self.page_limit) elif self.args.nyaa: self.logger.debug("Using Nyaa.si") import torrench.modules.nyaa as nyaa nyaa.main(self.input_title, self.page_limit) elif self.args.xbit: self.logger.debug("Using XBit.pw") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.xbit as xbit xbit.main(self.input_title) elif self.args.rarbg: self.logger.debug("Using RarBg") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.rarbg as rbg rbg.main(self.input_title) elif self.args.x1337: self.logger.debug("Using 1337x") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.x1337 as x13 x13.main(self.input_title, self.page_limit) elif self.args.limetorrents: self.logger.debug("Using LimeTorrents") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.limetorrents as lmt lmt.main(self.input_title, self.page_limit) elif self.args.idope: self.logger.debug("Using Idope") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.idope as idp idp.main(self.input_title, self.page_limit) elif self.args.libgen: self.logger.debug("Using LibGen") self.logger.debug("Input ISBN: [%s]" % (self.input_title)) import torrench.modules.libgen as libg libg.main(self.input_title) elif self.args.newpct: self.logger.debug("Using NewPCT") self.logger.debug("Input title: [%s] ; page_limit: [%s]" % (self.input_title, self.page_limit)) import torrench.modules.newpct as newpct newpct.main(self.input_title, self.page_limit) elif self.args.distrowatch: self.logger.debug("Using distrowatch") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.distrowatch as distrowatch distrowatch.main(self.input_title) elif self.args.interactive: self.logger.debug("Using interactive mode") import torrench.utilities.interactive as interactive interactive.inter() else: self.logger.debug("Using linuxtracker") self.logger.debug("Input title: [%s]" % (self.input_title)) import torrench.modules.linuxtracker as linuxtracker linuxtracker.main(self.input_title)