Closed tomlear closed 7 years ago
Everytime I run a script from the examples folder I get this error:
usage: infinity_hashtags_liker.py [-h] [-u U] [-p P] [-proxy PROXY] hashtags [hashtags ...] infinity_hashtags_liker.py: error: the following arguments are required: hashtags
This is the code I'm running:
import sys import os import time import argparse
sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot
parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-u', type=str, help="username") parser.add_argument('-p', type=str, help="password") parser.add_argument('-proxy', type=str, help="proxy") parser.add_argument('hashtags', type=str, nargs='+', help='hashtags') args = parser.parse_args()
bot = Bot() bot.login(username=args.u, password=args.p, proxy=args.proxy)
wait = 5 * 60 # in seconds
while True: for hashtag in args.hashtags: bot.like_hashtag("dogs") time.sleep("5")
Add your hashtags as arguments after infinity_hashtags_liker.py Like python infinity_hashtags_liker.py cats dogs Where "cats" and "dogs" are your hashtags.
python infinity_hashtags_liker.py cats dogs
hi can i use persian or arabic hashtags? like ایران
Everytime I run a script from the examples folder I get this error:
usage: infinity_hashtags_liker.py [-h] [-u U] [-p P] [-proxy PROXY] hashtags [hashtags ...] infinity_hashtags_liker.py: error: the following arguments are required: hashtags
This is the code I'm running:
import sys import os import time import argparse
sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot
parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-u', type=str, help="username") parser.add_argument('-p', type=str, help="password") parser.add_argument('-proxy', type=str, help="proxy") parser.add_argument('hashtags', type=str, nargs='+', help='hashtags') args = parser.parse_args()
bot = Bot() bot.login(username=args.u, password=args.p, proxy=args.proxy)
wait = 5 * 60 # in seconds
while True: for hashtag in args.hashtags: bot.like_hashtag("dogs") time.sleep("5")