forked from yejigao/9526498
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path日清食品体验馆.py
47 lines (40 loc) · 1.78 KB
/
日清食品体验馆.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
"""
cron: 0 7 * * *
new Env("微信小程序-日清食品体验馆")
env add wx_riqing = unionId#X-wx8465e1173d1e11b0-Token
"""
from datetime import datetime
# !/usr/bin/env python3
# coding: utf-8
import ApiRequest
tokenName = 'wx_riqing'
msg = ''
class riqing(ApiRequest.ApiRequest):
def __init__(self, data):
super().__init__()
self.sec.headers = {
'Host': 'prod-api.nissinfoodium.com.cn',
'Connection': 'keep-alive',
'User-Id': data.split("#")[0],
'Ep-Version': '1',
'App-Path': 'my/sign-in/sign-in',
'Extra': '{"scene":1053}',
# 'Tag': 'prod/default',
'Enterprise-Hash': '1246b9ecd0972c7b0e50b4c9cdad9f0c',
'App-Name': '%E6%97%A5%E6%B8%85%E9%A3%9F%E5%93%81%E4%BD%93%E9%AA%8C%E9%A6%86',
'Content-Type': 'application/json',
'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(0x6309092b) XWEB/8555',
'xweb_xhr': '1',
'Api-Version': 'v1.0',
'Token': data.split("#")[1],
'App-Version': 'V2.3.6',
'Referer': 'https://servicewechat.com/wx21b71db59d93bd6d/66/page-frame.html',
# 'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
}
def login(self):
日期 = datetime.now().strftime("%Y-%m-") + str(datetime.now().day)
response = self.sec.get(f'https://prod-api.nissinfoodium.com.cn/gw-shop/app/v1/signs/sign?date={日期}&type=1&')
print(response.text)
if __name__ == '__main__':
ApiRequest.ApiMain(['login']).run(tokenName, riqing)