-
Notifications
You must be signed in to change notification settings - Fork 1
/
farm_accounts.py
44 lines (32 loc) · 1.04 KB
/
farm_accounts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import logging
import sys
import time
from WeWard import WeWard
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - [%(funcName)s]: %(message)s",
datefmt="%d/%m %H:%M:%S",
level=logging.INFO,
)
logger = logging.getLogger(__name__)
if __name__ == "__main__":
if len(sys.argv) != 3:
logger.info("Usage: farm_accounts.py <email> <password>")
sys.exit(1)
weward = WeWard()
email = sys.argv[1].strip()
password = sys.argv[2].strip()
weward.request_signin_with_email(email)
time.sleep(5)
url = weward.get_url_from_email(email, password)
while url is None:
time.sleep(15)
url = weward.get_url_from_email(email, password)
custom_token = weward.parse_token_from_url(url)
session_path = weward.signup(custom_token)
weward.load_session(session_path)
weward.save_consents()
weward.update_step_source()
weward.upload_profile_informations()
weward.complete_sponsorship_step()
profile_data = weward.get_profile()
logger.info(profile_data)