|
1
|
|
|
# -*- coding: utf-8 -*- |
|
2
|
|
|
""" |
|
3
|
|
|
cron: 30 20 * * * |
|
4
|
|
|
new Env('多看阅读'); |
|
5
|
|
|
""" |
|
6
|
|
|
|
|
7
|
|
|
import time |
|
8
|
|
|
|
|
9
|
|
|
import requests |
|
10
|
|
|
|
|
11
|
|
|
from notify_mtr import send |
|
12
|
|
|
from utils import get_data |
|
13
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
class DuoKan: |
|
16
|
|
|
def __init__(self, check_items): |
|
17
|
|
|
self.check_items = check_items |
|
18
|
|
|
self.gift_code_list = [ |
|
19
|
|
|
"d16ad58199c69518a4afd87b5cf0fe67", |
|
20
|
|
|
"828672d6bc39ccd25e1f6ad34e00b86c", |
|
21
|
|
|
"f0ccc1bb1cecea673c197b928fb8dbd9", |
|
22
|
|
|
"6b86c490d92a138de9a0ae6847781caa", |
|
23
|
|
|
"c707047e8b820ba441d29cf87dff341e", |
|
24
|
|
|
"82b2c012a956b18cff2388d24f2574a6", |
|
25
|
|
|
"87d6b5183a361ee1f6ea8cece1ee83c3", |
|
26
|
|
|
"9d42576f7e99c94bb752fde06e6770a5", |
|
27
|
|
|
"e58d1f67a82a539d9331baaa3785a943", |
|
28
|
|
|
"52c95192ebcb1d0113a748df58a72055", |
|
29
|
|
|
"511f33e481fe4504d2637aaf6cbbbaff", |
|
30
|
|
|
"6e986f36f4a45cadf61d2f246b27cdc6", |
|
31
|
|
|
"f27797a6a1d7fe495b0f4de05f799327", |
|
32
|
|
|
"4bd335e899fa665f15eea2f215156321", |
|
33
|
|
|
"9355df762183f084473432b5c6900c44", |
|
34
|
|
|
"4fb21fb04cbbae9d65556c3958603674", |
|
35
|
|
|
"2d02ceb4f1bc916510c7407ce4eca5a5", |
|
36
|
|
|
"ef314bf665af0b51294e624244acd7d6", |
|
37
|
|
|
"1b441a2ab8e9e7dcf11a55b85931132f", |
|
38
|
|
|
"005d2345782ab456e5af167336b70623", |
|
39
|
|
|
"51ac508a4d494654035f17f1d646779b", |
|
40
|
|
|
"0f6579670f1081f1bcba89dd64645b48", |
|
41
|
|
|
"0cd858abe26f0d3db561185fe26bbb75", |
|
42
|
|
|
"b5f5fd5b47fd587cb003807e97bed783", |
|
43
|
|
|
"6ac9509a5cb799efeb1bb877c505f7e3", |
|
44
|
|
|
"b5dd986ffc84762429901ffe633d82a0", |
|
45
|
|
|
"f98a436cc2c85943d23d986a8d84c3bd", |
|
46
|
|
|
"6fc387f2a17b8564ca212e2b16544cc3", |
|
47
|
|
|
"12ead6a62411402378c6311199a0b2ef", |
|
48
|
|
|
"7d8dcf31e2e69fcf6bd8af4f48831e92", |
|
49
|
|
|
"446c3d0303b0dbd6bc2157844f1222ad", |
|
50
|
|
|
"439890227d823ff57bed8ad351fa1b75", |
|
51
|
|
|
"645acf3107722ab26b9d3194ecd156ff", |
|
52
|
|
|
"afcb41dd9bc54d752c26ace985b49960", |
|
53
|
|
|
"1100ab94ccd2e8373af70326c194d8ea", |
|
54
|
|
|
"373d73c0c0975cf959eb4c40dc82b27c", |
|
55
|
|
|
"2167ac28833149e9ad4ca217bcfa1a62", |
|
56
|
|
|
"80547afccc42f34e4c8c4083e00a41a6", |
|
57
|
|
|
"b604dda473644bd8157bafdf4ae518dc", |
|
58
|
|
|
"15eaa8f727b595d512b82f55364b53b9", |
|
59
|
|
|
"8fb656937fd613ccbbcacdc384595b03", |
|
60
|
|
|
"dd8410da0b5144ba4aba5a618723b72e", |
|
61
|
|
|
"204208386b056a2288e541110bfeeec3", |
|
62
|
|
|
"c5b2e7344efd4128bcab5840fa427103", |
|
63
|
|
|
"0168601e4335095c502e2e550ca53114", |
|
64
|
|
|
"dfa12fe056a8deee35da18613173560f", |
|
65
|
|
|
"ed945efdef9c7b2de41249a4fed3945e", |
|
66
|
|
|
"b9ece5964ab62d51f8b70ffd35191e9d", |
|
67
|
|
|
"f0e0ca4ca0b8afd766821a4922a2873c", |
|
68
|
|
|
"5c687b8c6bd641f3f2c0d6aaeceafff6", |
|
69
|
|
|
"c983be6420027231d77b748f9d02c1f2", |
|
70
|
|
|
"7c53358df8156d979cb6cbb74e15877b", |
|
71
|
|
|
"a58058035f73628a7c0847c66c350e88", |
|
72
|
|
|
"79dd039ca5cf401993801710f9900d6b", |
|
73
|
|
|
"5aff116c2cec01fcc69b389034f456a2", |
|
74
|
|
|
"d006927cd9bfd620a6af4f76ee3c4100", |
|
75
|
|
|
"410fe62830eeb91ca48be24ffe596364", |
|
76
|
|
|
"9d18226ff144a72812d0104ce59fb34e", |
|
77
|
|
|
"de439c7f75ca80b1d5b8aba619ee200d", |
|
78
|
|
|
"00d1a0479590793294bfdd5c427643aa", |
|
79
|
|
|
"d57176b1ce88135243bd501e448b8559", |
|
80
|
|
|
"7c500eff681637b97dd526bb11737abb", |
|
81
|
|
|
"3e197e47aaac926ccd50c37eb2828311", |
|
82
|
|
|
"7db084ea5987f841ad77240bcbb8ce54", |
|
83
|
|
|
"cce74f0facc50d47c0dd0e3e2f7435fb", |
|
84
|
|
|
"f8bb53fbeb9b2d45db8aca1401817599", |
|
85
|
|
|
"5baf7f0f355db11eeb0e936b675cdb82", |
|
86
|
|
|
"4478a3354de6bcd7e91b49e28a2b2b3f", |
|
87
|
|
|
"66a0338d93af82e956122288b08d2b4b", |
|
88
|
|
|
"9f598b2b1c9cd0f2b20e335831cce366", |
|
89
|
|
|
"9f4a45fec88b2820653abba179759eb6", |
|
90
|
|
|
"41086649c9a39ec977ba42f9ce81f828", |
|
91
|
|
|
"06ccca6fd73a6e38f65638ab8abbab76", |
|
92
|
|
|
"0cfa0a034a203bb3a22be499e74906f4", |
|
93
|
|
|
"c0d1da35a8878b7e4dcdf44bf3cd6b96", |
|
94
|
|
|
"f34921e16f6518c1149cc083bd8e1ad7", |
|
95
|
|
|
"ed0be3c70075d1d8f1a412f9e59a12e7", |
|
96
|
|
|
"eb4d6324bae7db952bd220cb4d57a3de", |
|
97
|
|
|
"5ba65d9f8ad735681b594f5092f6ab37", |
|
98
|
|
|
"2fa6e0b612962937edb37ed7043923fd", |
|
99
|
|
|
"baa8268c7d85d793011c5f5b977f8d4b", |
|
100
|
|
|
"f4842a465e4583646abf7df67d8e2915", |
|
101
|
|
|
"12c6332c8c9ded3d58d45f2dae7de8da", |
|
102
|
|
|
"f56609232205692acf6b6a5d337b0965", |
|
103
|
|
|
"3e4eed15387843c668fba53641599d07", |
|
104
|
|
|
"d1b9d9ede145b5d426130986245cb66e", |
|
105
|
|
|
"2979e43f6ab786f5d68cc262105f3c45", |
|
106
|
|
|
"118a18ed578c78f4855b416f8271b29a", |
|
107
|
|
|
"9122e158d034f094627c70ed6c3d0c33", |
|
108
|
|
|
"dd5413c17253e86cc4247984f3bb77e5", |
|
109
|
|
|
"b36bb0124b962efccbb601486665ce9e", |
|
110
|
|
|
"6afb3a719f8b0a0b2f744b3dad8b15ab", |
|
111
|
|
|
"faf18d64268402ed2975a3f60bc9e651", |
|
112
|
|
|
"9f4081944d4ca3fa7b831d7c3b6c289d", |
|
113
|
|
|
"367d7a3d77a9f96cbd7903b33c30b61f", |
|
114
|
|
|
"605276cf621ff9ba34a99e3675a006f6", |
|
115
|
|
|
"a50a734c1a3a749918e20205505ef91d", |
|
116
|
|
|
"271ff14ba5edfe89a80a3430227bc11b", |
|
117
|
|
|
"3bae338062b4bb3a5087eb13cbcc6efe", |
|
118
|
|
|
"9b443d60178a9bcb08bae62c41970abf", |
|
119
|
|
|
"a4f6e97741054f3567ab6a7257c63ab1", |
|
120
|
|
|
"e06a82cc1f05eda4947e5fa0927d89c5", |
|
121
|
|
|
"4fa3b4fc274c283efb02c0a1ddd133e7", |
|
122
|
|
|
"4aa59e16a3961ed1ebd12b7f15d79547", |
|
123
|
|
|
"f75fe88eaa24fc28ac57d963d8b90f2d", |
|
124
|
|
|
"42cbe52b6f74761a5a7a79bf370c30ef", |
|
125
|
|
|
"7d4571b5c9710e3b5481330bc7123ecc", |
|
126
|
|
|
"fcf2f7ec42086809991de5aed5e7ef0d", |
|
127
|
|
|
"bb7de9aaf68a83ac1ddbe75ba913b8af", |
|
128
|
|
|
"a9bd964b97e785fffb641edb9b402d3f", |
|
129
|
|
|
"6a815be6f537b2351e947ed66f74e209", |
|
130
|
|
|
"27ae4e4d71395c6255bf7ea57c496507", |
|
131
|
|
|
"2b07f369e90f4fc34ef419d891a2906f", |
|
132
|
|
|
"7a2dc8a5b3fc0c7ecddb97ed1ce2c833", |
|
133
|
|
|
"e7ad152ef27beb80c5d343f41f885b21", |
|
134
|
|
|
"ba21758aed15a3a20a27f63bc0d84626", |
|
135
|
|
|
"3820f7b8e1ece2614a11264501b5c93e", |
|
136
|
|
|
"c3c41c87e6bf752f5237b4fffa33f08b", |
|
137
|
|
|
"ed21086ff6682ab8495ecbfbb697af4a", |
|
138
|
|
|
"5a2585ff3524f319dfd1f6b735c9a18d", |
|
139
|
|
|
"0e61444507f0a780a1c83b612eb5fb9b", |
|
140
|
|
|
"b105aa5c696648c0f7aae9e3933f8fe0", |
|
141
|
|
|
"fec8f729e9e1d02248b949ce17674e0c", |
|
142
|
|
|
"d3323d5560d15d4bc03575dcd0f53ae9", |
|
143
|
|
|
"15fbf9d24dd05d9d64a18a8fd28f4dcc", |
|
144
|
|
|
"ac0f3bda53081eee547882b2cdc8b04f", |
|
145
|
|
|
"5dd3fadcd4ea6b922e1462431966c2bf", |
|
146
|
|
|
"4acb71816dad0ce9a53d8fee301d857c", |
|
147
|
|
|
"4c7e173f3a046919587db5b2640896e7", |
|
148
|
|
|
"8407dc0459d0b367eaced7e5dfdef8ed", |
|
149
|
|
|
"17e02409659223ff4e32cabd9ad352d9", |
|
150
|
|
|
"c49edc07086b27769eddb981359f56b2", |
|
151
|
|
|
"344822f5d8d53fe9aa7a1c7328cd2c59", |
|
152
|
|
|
"92259343c65ac0feab5cb56b2e851783", |
|
153
|
|
|
"e1e537b0bd37091c0ba4d5f614af9160", |
|
154
|
|
|
"dff1116c175ddaaa20f3985a3d88abc6", |
|
155
|
|
|
"3b1131a7c7273aa61cbd71b044e9beca", |
|
156
|
|
|
"431aab37ef168c383f078b9244008cee", |
|
157
|
|
|
"96c3bb8355d7e3ed7265095374f1c090", |
|
158
|
|
|
"c3a7d304cdb307f073bef5003d1b8b78", |
|
159
|
|
|
"627d884fc905cc353d0028076e39846b", |
|
160
|
|
|
"36ce0d88a6bb2d10e0dc0a697f64df4e", |
|
161
|
|
|
"dc8dbd035d42a5d8170976d5f532dab0", |
|
162
|
|
|
"01c2665e7ea15bc56cca6d955c2e8ae1", |
|
163
|
|
|
"c54ae7eeedc87ac52249684f012d3805", |
|
164
|
|
|
"2df9b3b8f21a682b20d9d77669087a7a", |
|
165
|
|
|
"fded473150a783586c12692fd57d0825", |
|
166
|
|
|
"580499e69f42c0ccba0d1f87a83e41e9", |
|
167
|
|
|
"99433cb83f1cd7176b7cdeaa7be49cd8", |
|
168
|
|
|
"fbd76e8265547376905b3b6004150064", |
|
169
|
|
|
"362768496052ae0dfbe909a9b5c6f54e", |
|
170
|
|
|
"4f33581089c90944e5ad950646b17712", |
|
171
|
|
|
"bffe93cdfe4b8833190e0a59c779e027", |
|
172
|
|
|
"78e042b792c3af7faf7a6ebfedf6af9e", |
|
173
|
|
|
"51a59c881726c2887efe9752bd9db715", |
|
174
|
|
|
"a46ecf03d3f4038ba3de4ae4ac28170f", |
|
175
|
|
|
"48d025f7cc34ac29c21d03b2c1f36449", |
|
176
|
|
|
"8c9ceb77d61c20cb96ee652eb7b838c9", |
|
177
|
|
|
"47a5882c89671429ae532339b7f333ce", |
|
178
|
|
|
"a0b735557416ff3d08d3d8440393061a", |
|
179
|
|
|
"976d3b3a8fbdf33d525075a9288455ab", |
|
180
|
|
|
"636ca4c1db1c4450431ecd7e10a5e671", |
|
181
|
|
|
"8c5cd12180027ee6535a837bd4f0259a", |
|
182
|
|
|
"b82315333974c76793b3c7f517fe977c", |
|
183
|
|
|
"6143d1f3472cd7cf08e3780918019158", |
|
184
|
|
|
"20d032426fd66d49bec4f99579252cfa", |
|
185
|
|
|
"398ee715d1dfd058a912bc7768d35f82", |
|
186
|
|
|
"1f678678966444fb53d118b8134ceb94", |
|
187
|
|
|
"d6641f3ed9444eae2b77ba68d3552f6a", |
|
188
|
|
|
"ab2babaa19539895a5285c1ded6de8c6", |
|
189
|
|
|
"5bc61d3cd53582b859db9cf04fc7e250", |
|
190
|
|
|
"5deb619ed27c2754df4f9c7e3ce16b82", |
|
191
|
|
|
"b81a322830fee59c75985626f7e0a8b5", |
|
192
|
|
|
"e2313ad53d58e181c5fbaef29e5772c3", |
|
193
|
|
|
"70d2aa99ef48b6cf1c0e8c107c0e121d", |
|
194
|
|
|
"0633cdb06253a2b11e9a9ca234a3e9c3", |
|
195
|
|
|
"bd1cbb9764fba94e8f1c0d1c024487af", |
|
196
|
|
|
"301cbdbf26210596f9b22123abff0ca8", |
|
197
|
|
|
"1fc2448ee192a1d0806ae1eb6fcc81fe", |
|
198
|
|
|
"306247030d0b6442c3ded42e9ca99872", |
|
199
|
|
|
"1c8f9a0786a01db1d06989345887967e", |
|
200
|
|
|
"256ec3a54aaae719aae88d8f9c7f9b5f", |
|
201
|
|
|
"45645896cccec48191916fec482979d9", |
|
202
|
|
|
"c3a19c728d6fd39925bd63abe15aa446", |
|
203
|
|
|
"15f45c4cd8fd4a6c0a3fae14ccafff47", |
|
204
|
|
|
"a082c46b09772739af41f01676e1d0d1", |
|
205
|
|
|
"14928418f94f5d35b182001ae0160455", |
|
206
|
|
|
"dfbc5bc946c72650adaaf570f11a1e80", |
|
207
|
|
|
"8a312e3e30d2e8fd1cf8873c3abe1d8c", |
|
208
|
|
|
"ef425403acaabfb2a5b3f6ab0aafce8c", |
|
209
|
|
|
"c78d471822dd961a53afe23e6c2dfa61", |
|
210
|
|
|
"a40f670d8de3784b54784daf63095d88", |
|
211
|
|
|
"49a72ace7fd54d8d0833bb2590db58aa", |
|
212
|
|
|
"38e3808d28de73af3578f6d64020e1fc", |
|
213
|
|
|
"a8be6ab39263d2edf61acafc60949921", |
|
214
|
|
|
"d9c16bf0032800916e948ea26624a253", |
|
215
|
|
|
"dbf3a62ff403c3ba94d5ab1e6219f5bc", |
|
216
|
|
|
"3a6415de684e2978ce17543d66d523f6", |
|
217
|
|
|
"2f69a681ee1ff927df1bdbd5431ced1d", |
|
218
|
|
|
"e55c0390872735ec285dad8ebdd939e0", |
|
219
|
|
|
] |
|
220
|
|
|
self.code_list = [ |
|
221
|
|
|
"K7S36GFSZC", |
|
222
|
|
|
"A2AMBFHP6C", |
|
223
|
|
|
"K5HHKUU14D", |
|
224
|
|
|
"J18UK6YYAY", |
|
225
|
|
|
"1BJGW140U5", |
|
226
|
|
|
] |
|
227
|
|
|
self.headers = { |
|
228
|
|
|
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8" |
|
229
|
|
|
} |
|
230
|
|
|
|
|
231
|
|
|
@staticmethod |
|
232
|
|
|
def get_data(cookies): |
|
233
|
|
|
device_id = cookies.get("device_id") |
|
234
|
|
|
t = int(time.time()) |
|
235
|
|
|
t_device_id = f"{device_id}&{t}" |
|
236
|
|
|
c = 0 |
|
237
|
|
|
for one in t_device_id: |
|
238
|
|
|
c = (c * 131 + ord(one)) % 65536 |
|
239
|
|
|
return f"_t={t}&_c={c}" |
|
240
|
|
|
|
|
241
|
|
|
def sign(self, cookies): |
|
242
|
|
|
url = "https://www.duokan.com/checkin/v0/checkin" |
|
243
|
|
|
data = self.get_data(cookies=cookies) |
|
244
|
|
|
res = requests.post( |
|
245
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
246
|
|
|
).json() |
|
247
|
|
|
return res.get("msg") |
|
248
|
|
|
|
|
249
|
|
|
def delay(self, date, cookies): |
|
250
|
|
|
url = "https://www.duokan.com/store/v0/award/coin/delay" |
|
251
|
|
|
data = f"date={date}&{self.get_data(cookies=cookies)}&withid=1" |
|
252
|
|
|
return requests.post( |
|
253
|
|
|
url=url, data=data, headers=self.headers, cookies=cookies |
|
254
|
|
|
).json() |
|
255
|
|
|
|
|
256
|
|
|
def info(self, cookies): |
|
257
|
|
|
url = "https://www.duokan.com/store/v0/award/coin/list" |
|
258
|
|
|
data = f"sandbox=0&{self.get_data(cookies=cookies)}&withid=1" |
|
259
|
|
|
res = requests.post( |
|
260
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
261
|
|
|
).json() |
|
262
|
|
|
if "尚未登录" not in res.get("msg"): |
|
263
|
|
|
coin = sum(one.get("coin") for one in res.get("data", {}).get("award")) |
|
264
|
|
|
msg = f"当前书豆: {coin}\n" |
|
265
|
|
|
for one in res.get("data", {}).get("award"): |
|
266
|
|
|
if one.get("delay") == 1: # 判断是否有可延迟的豆子 |
|
267
|
|
|
res = self.delay(one.get("expire"), cookies=cookies) |
|
268
|
|
|
msg += f"{one.get('expire')} 到期,{one.get('coin')} 书豆 | 延期:{res.get('msg')}\n" |
|
269
|
|
|
else: |
|
270
|
|
|
msg += f"{one.get('expire')} 到期,{one.get('coin')} 书豆\n" |
|
271
|
|
|
else: |
|
272
|
|
|
msg = "账号异常: Cookie 失效" |
|
273
|
|
|
return msg |
|
274
|
|
|
|
|
275
|
|
|
def free(self, cookies): |
|
276
|
|
|
url = "https://www.duokan.com/hs/v4/channel/query/2027" |
|
277
|
|
|
res = requests.get(url=url, cookies=cookies, headers=self.headers).json() |
|
278
|
|
|
bid = res.get("items")[0].get("data").get("book_id") |
|
279
|
|
|
data = f"payment_name=BC&ch=VSZUVB&book_id={bid}&price=0&allow_discount=1" |
|
280
|
|
|
free_url = "https://www.duokan.com/store/v0/payment/book/create" |
|
281
|
|
|
res = requests.post( |
|
282
|
|
|
url=free_url, data=data, cookies=cookies, headers=self.headers |
|
283
|
|
|
).json() |
|
284
|
|
|
if "尚未登录" in res.get("msg"): |
|
285
|
|
|
return "今日限免: Cookie 失效" |
|
286
|
|
|
book_title = res.get("book").get("title") |
|
287
|
|
|
book_msg = res.get("msg") |
|
288
|
|
|
return f"今日限免: {book_title} · {book_msg}" |
|
289
|
|
|
|
|
290
|
|
|
def gift(self, cookies): |
|
291
|
|
|
url = "https://www.duokan.com/events/common_task_gift_check" |
|
292
|
|
|
data = f"code=KYKJF7LL0G&{self.get_data(cookies=cookies)}&withid=1" |
|
293
|
|
|
res = requests.post( |
|
294
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
295
|
|
|
).json() |
|
296
|
|
|
if res.get("chances") == 0: |
|
297
|
|
|
return "体验任务: 已经做完啦" |
|
298
|
|
|
if res.get("chances"): |
|
299
|
|
|
num = 0 |
|
300
|
|
|
url = "https://www.duokan.com/events/common_task_gift" |
|
301
|
|
|
for gift_code in self.gift_code_list: |
|
302
|
|
|
data = f"code=KYKJF7LL0G&chances=1&sign={gift_code}&{self.get_data(cookies=cookies)}&withid=1" |
|
303
|
|
|
res = requests.post( |
|
304
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
305
|
|
|
).json() |
|
306
|
|
|
if res.get("msg") == "成功": |
|
307
|
|
|
num += 30 |
|
308
|
|
|
print("体验任务完成啦!豆子 +30") |
|
309
|
|
|
else: |
|
310
|
|
|
print(res.get("data")) |
|
311
|
|
|
return f"体验任务: 获得 {num} 豆子" |
|
312
|
|
|
return f"体验任务: {res.text}" |
|
313
|
|
|
|
|
314
|
|
|
def add_draw(self, cookies): |
|
315
|
|
|
success_count = 0 |
|
316
|
|
|
url = "https://www.duokan.com/store/v0/event/chances/add" |
|
317
|
|
|
for _ in range(6): |
|
318
|
|
|
data = ( |
|
319
|
|
|
f"code=8ulcky4bknbe_f&count=1&{self.get_data(cookies=cookies)}&withid=1" |
|
320
|
|
|
) |
|
321
|
|
|
res = requests.post( |
|
322
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
323
|
|
|
).json() |
|
324
|
|
|
if res.get("result") == 0: |
|
325
|
|
|
success_count += 1 |
|
326
|
|
|
return f"添加抽奖: {success_count} 次" |
|
327
|
|
|
|
|
328
|
|
|
def draw(self, cookies): |
|
329
|
|
|
success_count = 0 |
|
330
|
|
|
url = "https://www.duokan.com/store/v0/event/drawing" |
|
331
|
|
|
for _ in range(6): |
|
332
|
|
|
data = f"code=8ulcky4bknbe_f&{self.get_data(cookies=cookies)}&withid=1" |
|
333
|
|
|
res = requests.post( |
|
334
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
335
|
|
|
).json() |
|
336
|
|
|
if res.get("result") == 0: |
|
337
|
|
|
success_count += 1 |
|
338
|
|
|
return f"成功抽奖: {success_count} 次" |
|
339
|
|
|
|
|
340
|
|
|
def download(self, cookies): |
|
341
|
|
|
url = "https://www.duokan.com/events/common_task_gift" |
|
342
|
|
|
data = f"code=J18UK6YYAY&chances=17&{self.get_data(cookies=cookies)}&withid=1" |
|
343
|
|
|
res = requests.post( |
|
344
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
345
|
|
|
).json() |
|
346
|
|
|
return "下载任务: " + res.get("msg") |
|
347
|
|
|
|
|
348
|
|
|
def task(self, cookies): |
|
349
|
|
|
success_count = 0 |
|
350
|
|
|
url = "https://www.duokan.com/events/tasks_gift" |
|
351
|
|
|
for code in self.code_list: |
|
352
|
|
|
data = f"code={code}&chances=3&{self.get_data(cookies=cookies)}&withid=1" |
|
353
|
|
|
res = requests.post( |
|
354
|
|
|
url=url, data=data, cookies=cookies, headers=self.headers |
|
355
|
|
|
).json() |
|
356
|
|
|
if res.get("result") == 0: |
|
357
|
|
|
success_count += 1 |
|
358
|
|
|
return f"其他任务: 完成 {success_count} 个" |
|
359
|
|
|
|
|
360
|
|
|
def main(self): |
|
361
|
|
|
msg_all = "" |
|
362
|
|
|
for check_item in self.check_items: |
|
363
|
|
|
cookie = { |
|
364
|
|
|
item.split("=")[0]: item.split("=")[1] |
|
365
|
|
|
for item in check_item.get("cookie").split("; ") |
|
366
|
|
|
} |
|
367
|
|
|
sign_msg = self.sign(cookies=cookie) |
|
368
|
|
|
free_msg = self.free(cookies=cookie) |
|
369
|
|
|
gift_msg = self.gift(cookies=cookie) |
|
370
|
|
|
add_draw_msg = self.add_draw(cookies=cookie) |
|
371
|
|
|
draw_msg = self.draw(cookies=cookie) |
|
372
|
|
|
download_msg = self.download(cookies=cookie) |
|
373
|
|
|
task_msg = self.task(cookies=cookie) |
|
374
|
|
|
info_msg = self.info(cookies=cookie) |
|
375
|
|
|
msg = ( |
|
376
|
|
|
f"每日签到: {sign_msg}\n{free_msg}\n{gift_msg}\n" |
|
377
|
|
|
f"{add_draw_msg}\n{draw_msg}\n{download_msg}\n{task_msg}\n{info_msg}" |
|
378
|
|
|
) |
|
379
|
|
|
msg_all += msg + "\n\n" |
|
380
|
|
|
return msg_all |
|
381
|
|
|
|
|
382
|
|
|
|
|
383
|
|
|
if __name__ == "__main__": |
|
384
|
|
|
_data = get_data() |
|
385
|
|
|
_check_items = _data.get("DUOKAN", []) |
|
386
|
|
|
result = DuoKan(check_items=_check_items).main() |
|
387
|
|
|
send("多看阅读", result) |
|
388
|
|
|
|