summaryrefslogtreecommitdiff
path: root/games_bot.py
blob: bdd63c95c9d15ee637ef991ccffe0d3a2038e75b (plain)
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
#!/usr/bin/env python3
import requests
import re
from time import sleep


rs = requests.session()
rp = rs.post('https://recolor.me/login?json', data = {
    'action':'login', 
    'account_name':'testingaccount1', 
    'account_password':'1234',
    'account_cookie':'1'})

if not rp.json()['account_id']:
    print("wrong login info!")
    exit(1)

rp = rs.get('https://recolor.me/')
key_pos = rp.text.find("site.my_key = \'") + len("site.my_key =  ")
#key = rp.text[key_pos:key_pos+32]
key = re.search("site.my_key = \'(.*)\';", rp.text).groups()[0]

levels = []
levels.append([1, 0, [3, 2, 0, 3]])

rp = rs.post('https://recolor.me/', data = {
    'page':'slide',
    'action':'complete',
    'level':'7',
    'hflip':'1',
    'vflip':'0',
    'solution':'301232',
    'key':key
    })