-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathzippo.py
74 lines (63 loc) · 2.24 KB
/
zippo.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"""
cron: 30 7 * * *
new Env("微信小程序-zippo")
env add zippo_auth
未完成
"""
#!/usr/bin/env python3
# coding: utf-8
import json
import os
import time
import traceback
import requests
import ApiRequest
import mytool
from notify import send
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
title = '微信小程序-zippo'
tokenName = 'zippo_auth'
class zippo(ApiRequest.ApiRequest):
def __init__(self, data):
super().__init__()
self.sec.headers = {
'Host': 'wx-center.zippo.com.cn',
'Connection': 'keep-alive',
'x-app-id': 'zippo',
'x-platform-id': 'wxaa75ffd8c2d75da7',
'x-platform-env': 'release',
'x-platform': 'wxmp',
'Authorization': data,
'Content-Type': 'application/json;charset=UTF-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090819) XWEB/8531',
'xweb_xhr': '1',
'Referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/69/page-frame.html',
'Accept-Language': 'zh-CN,zh;q=0.9',
}
def login(self):
rj = self.sec.post('https://wx-center.zippo.com.cn/api/daily-signin', params='', json={}).json()
print(rj)
pass
def favorited(self):
jsonData = {
"targetType": "sku",
"targetId": "265",
"favorited": True
}
rj = self.sec.post('https://wx-center.zippo.com.cn/api/favorites', params='', json=jsonData).json()
print(rj)
rj = self.sec.post('https://wx-center.zippo.com.cn/api/missions/5/rewards', params='', json={"id":5}).json()
print(rj)
pass
def unfavorited(self):
jsonData = {
"targetType": "sku",
"targetId": "265",
"favorited": False
}
rj = self.sec.post('https://wx-center.zippo.com.cn/api/favorites', params='', json=jsonData).json()
print(rj)
pass
if __name__ == '__main__':
ApiRequest.ApiMain(['login', 'unfavorited', 'favorited']).run(tokenName, zippo)