예제 #1
0
    def __init__(self, args):

        self.options = {
            'url': args.url,
            'prefix': '',
            'user_agent': args.user_agent,
            'proxy': args.proxy,
            'verbosity': args.verbosity,
            'threads': 10,
            'chunk_size': 10,  # same as threads
            'run_all': args.run_all,
            'match_all': args.match_all,
            'stop_after': args.stop_after,
            'no_cache_load': args.no_cache_load,
            'no_cache_save': args.no_cache_save,
        }

        self.data = {
            'cache': Cache(),
            'results': Results(self.options),
            'fingerprints': Fingerprints(),
            'matcher': Match(),
            'colorizer': Color(),
            'printer': Printer(args.verbosity, Color()),
            'detected_cms': set(),
            'error_pages': set(),
            'queue': queue.Queue(),
            'requested': queue.Queue()
        }

        self.data['results'].set_printer(self.data['printer'])
        self.data['requester'] = Requester(self.options, self.data)
예제 #2
0
파일: wig.py 프로젝트: xstpl/wig
    def __init__(self, args):
        urls = None
        if args.input_file is not None:
            args.quiet = True

            with open(args.input_file, 'r') as input_file:
                urls = []
                for url in input_file.readlines():
                    url = url.strip()
                    urls.append(url if '://' in url else 'http://' + url)

        else:
            args.url = args.url.lower()
            if '://' not in args.url:
                args.url = 'http://' + args.url

        text_printer = Printer(args.verbosity)
        cache = Cache()
        cache.printer = text_printer

        self.options = {
            'url': args.url,
            'urls': urls,
            'quiet': args.quiet,
            'prefix': '',
            'user_agent': args.user_agent,
            'proxy': args.proxy,
            'verbosity': args.verbosity,
            'threads': 10,
            'batch_size': 20,
            'run_all': args.run_all,
            'match_all': args.match_all,
            'stop_after': args.stop_after,
            'no_cache_load': args.no_cache_load,
            'no_cache_save': args.no_cache_save,
            'write_file': args.output_file,
            'subdomains': args.subdomains
        }

        self.data = {
            'cache': cache,
            'results': Results(self.options),
            'fingerprints': Fingerprints(),
            'matcher': Match(),
            'printer': text_printer,
            'detected_cms': set(),
            'error_pages': set(),
            'requested': queue.Queue()
        }

        if self.options['write_file'] is not None:
            self.json_outputter = OutputJSON(self.options, self.data)

        self.data['printer'].print_logo()

        self.results = None
예제 #3
0
파일: main.py 프로젝트: relomy/dk_results
def main():
    # parse arguments
    parser = argparse.ArgumentParser()
    choices = [
        "NBA", "NFL", "CFB", "PGAMain", "PGAWeekend", "PGAShowdown", "NHL",
        "MLB", "TEN"
    ]
    parser.add_argument("-i",
                        "--id",
                        type=int,
                        required=True,
                        help="Contest ID from DraftKings")
    parser.add_argument("-c", "--csv", help="Slate CSV from DraftKings")
    parser.add_argument(
        "-s",
        "--sport",
        choices=choices,
        required=True,
        help=
        "Type of contest (NBA, NFL, PGAMain, PGAWeekend, PGAShowdown, CFB, NHL, or MLB)",
    )
    parser.add_argument("-v", "--verbose", help="Increase verbosity")
    args = parser.parse_args()

    now = datetime.datetime.now(timezone("US/Eastern"))

    if args.csv:
        fn = args.csv
    else:
        fn = f"DKSalaries_{args.sport}_{now:%A}.csv"

    logger.debug(args)

    # pull contest standings from draftkings
    contest_list = pull_contest_zip(args.id)

    sheet = DFSSheet(args.sport)

    logger.debug(
        f"Creating Results object Results({args.sport}, {args.id}, {args.csv})"
    )
    r = Results(args.sport, args.id, args.csv)
    z = r.players_to_values()
    sheet.write_players(z)
    logger.info("Writing players to sheet")
    sheet.add_last_updated(now)

    if r.vip_list:
        logger.info("Writing vip_lineups to sheet")
        sheet.write_vip_lineups(r.vip_list)

    for u in r.vip_list:
        # logger.info("User: {}".format(u.name))
        logger.info("User: {}".format(u))
예제 #4
0
파일: wig.py 프로젝트: r00tb0x/wig
    def __init__(self, args):

        urls = None
        interactive = True

        if args.input_file is not None:
            interactive = False

            with open(args.input_file, 'r') as input_file:
                urls = []
                for url in input_file.readlines():
                    u = url.strip()
                    urls.append(u if '://' in u else 'http://' + u)

        elif '://' not in args.url:
            args.url = 'http://' + args.url

        self.options = {
            'url': args.url,
            'urls': urls,
            'interactive': interactive,
            'prefix': '',
            'user_agent': args.user_agent,
            'proxy': args.proxy,
            'verbosity': args.verbosity,
            'threads': 10,
            'batch_size': 20,
            'run_all': args.run_all,
            'match_all': args.match_all,
            'stop_after': args.stop_after,
            'no_cache_load': args.no_cache_load,
            'no_cache_save': args.no_cache_save,
            'write_file': args.output_file
        }

        self.data = {
            'cache': Cache(),
            'results': Results(self.options),
            'fingerprints': Fingerprints(),
            'matcher': Match(),
            'colorizer': Color(),
            'printer': Printer(args.verbosity, Color()),
            'detected_cms': set(),
            'error_pages': set(),
            'requested': queue.Queue()
        }

        if self.options['write_file'] is not None:
            self.json_outputter = OutputJSON(self.options, self.data)
예제 #5
0
파일: wig.py 프로젝트: repodiscover/wig
    def __init__(self, host, profile, verbose, desperate):
        self.plugins = self.load_plugins()
        self.host = host
        self.results = Results()
        self.cache = Cache()
        self.profile = Profile(profile)
        self.colorizer = Color()
        self.logs = Log()
        self.verbose = verbose

        self.check_url()
        self.redirect()
        self.cache.set_host(self.host)

        if desperate:
            self.desperate = Desperate()
        else:
            self.desperate = None
예제 #6
0
파일: wig.py 프로젝트: xstpl/wig
 def reset(self):
     self.data['results'] = Results(self.options)
     self.data['cache'] = Cache()