def get_profile(username): ins_crawler = InsCrawler() return ins_crawler.get_user_profile(username)
if args.mode in ["posts", "posts_full"]: arg_required("username") posts = get_post_full(args.username, args.number, args.debug) output( posts, args.output, ) elif args.mode == "profile": arg_required("username") ins_crawler = InsCrawler(has_screen=args.debug) ins_crawler.login() profile = ins_crawler.get_user_profile(args.username, True) profile['capture_time'] = int(datetime.now().timestamp()) output(profile, args.output) persist = Persist() profile["username"] = args.username try: persist.persistProfile(profile) except: persist.db.rollback() id_profile = persist.getUserIdByUsername(args.username) if id_profile is None: logger.error( 'The profile of specified username does not exist') raise Exception( 'The profile of specified username does not exist')
def get_profile(username, debug=False, follow_list_enabled=False): ins_crawler = InsCrawler(has_screen=debug) ins_crawler.login() return ins_crawler.get_user_profile(username, follow_list_enabled)
def get_profile(username, debug=False): ins_crawler = InsCrawler(debug) return ins_crawler.get_user_profile(username)