Spaces:
Running
Running
rogerxavier
commited on
Commit
•
978bed2
1
Parent(s):
aa9cce6
Update utils.py
Browse files
utils.py
CHANGED
@@ -9,14 +9,42 @@ urlBase = 'https://jingling.bifangpu.com'
|
|
9 |
purchaseBase = urlBase+"/api/resource/purchase"
|
10 |
|
11 |
# #截止时间信息: jinglingpan:sessid=3685012c-6913-49fb-86d3-815b30601597; path=/; expires=Fri, 02 Aug 2024 13:22:47 GMT, jinglingpan:sessid.sig=ESZRgMwxvb5eols3kmXSi3ybKAw; path=/; expires=Fri, 02 Aug 2024 13:22:47 GMT
|
12 |
-
|
|
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
|
|
|
|
16 |
|
17 |
# headers = {
|
18 |
# "authority": "jingling.bifangpu.com",
|
19 |
# "method": "GET",
|
|
|
20 |
# "path": "/resource/detail/b01940f0f34e6ca91f68b258362d50f1",
|
21 |
# "scheme": "https",
|
22 |
# "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
@@ -37,34 +65,6 @@ purchaseBase = urlBase+"/api/resource/purchase"
|
|
37 |
# "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
38 |
# }
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
cookie_str ='_ga=GA1.2.391687567.1721269988; _gid=GA1.2.1532584807.1721364777; jinglingpan:sessid=678986e8-8f1c-40d7-82c7-01ec3afede65; jinglingpan:sessid.sig=zM0_iCuVe3wphAPiAHljhtL5PoE; Hm_lvt_19198da8061c292cacd55088bd6e3eba=1721364777,1721395448; HMACCOUNT=B1C6D796AC29E639; _gat=1; _ga_Y024PNQKTV=GS1.2.1721395448.4.1.1721395455.0.0.0; Hm_lpvt_19198da8061c292cacd55088bd6e3eba=1721395468'
|
43 |
-
|
44 |
-
headers = {
|
45 |
-
"authority": "jingling.bifangpu.com",
|
46 |
-
"method": "GET",
|
47 |
-
"Cookie":cookie_str,
|
48 |
-
"path": "/resource/detail/b01940f0f34e6ca91f68b258362d50f1",
|
49 |
-
"scheme": "https",
|
50 |
-
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
51 |
-
"Accept-Encoding": "gzip, deflate, br, zstd",
|
52 |
-
"Accept-Language": "zh-CN,zh;q=0.9",
|
53 |
-
"Cache-Control": "max-age=0",
|
54 |
-
"Dnt": "1",
|
55 |
-
"If-None-Match": "\"5b56-ChT6C0U9s3iYKFMBV41XLcqXxRc\"",
|
56 |
-
"Priority": "u=0, i",
|
57 |
-
"Sec-Ch-Ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
|
58 |
-
"Sec-Ch-Ua-Mobile": "?0",
|
59 |
-
"Sec-Ch-Ua-Platform": "\"Windows\"",
|
60 |
-
"Sec-Fetch-Dest": "document",
|
61 |
-
"Sec-Fetch-Mode": "navigate",
|
62 |
-
"Sec-Fetch-Site": "same-origin",
|
63 |
-
"Sec-Fetch-User": "?1",
|
64 |
-
"Upgrade-Insecure-Requests": "1",
|
65 |
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
66 |
-
}
|
67 |
-
|
68 |
#返回{"code": 10602}说明已经购买过
|
69 |
def try_puchase(fid:str,session)->dict:
|
70 |
payload = {
|
|
|
9 |
purchaseBase = urlBase+"/api/resource/purchase"
|
10 |
|
11 |
# #截止时间信息: jinglingpan:sessid=3685012c-6913-49fb-86d3-815b30601597; path=/; expires=Fri, 02 Aug 2024 13:22:47 GMT, jinglingpan:sessid.sig=ESZRgMwxvb5eols3kmXSi3ybKAw; path=/; expires=Fri, 02 Aug 2024 13:22:47 GMT
|
12 |
+
cookie = {'jinglingpan:sessid': '608c4163-16fd-4326-8caf-7b4076fdcaca',
|
13 |
+
'jinglingpan:sessid.sig': 'qEDpK0oDIYLJXZbO1P7UjmJ0OjY'}
|
14 |
|
15 |
+
session.cookies = requests.utils.cookiejar_from_dict(cookie)
|
16 |
+
|
17 |
+
headers = {
|
18 |
+
"authority": "jingling.bifangpu.com",
|
19 |
+
"method": "GET",
|
20 |
+
"path": "/resource/detail/b01940f0f34e6ca91f68b258362d50f1",
|
21 |
+
"scheme": "https",
|
22 |
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
23 |
+
"Accept-Encoding": "gzip, deflate, br, zstd",
|
24 |
+
"Accept-Language": "zh-CN,zh;q=0.9",
|
25 |
+
"Cache-Control": "max-age=0",
|
26 |
+
"Dnt": "1",
|
27 |
+
"If-None-Match": "\"5b56-ChT6C0U9s3iYKFMBV41XLcqXxRc\"",
|
28 |
+
"Priority": "u=0, i",
|
29 |
+
"Sec-Ch-Ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
|
30 |
+
"Sec-Ch-Ua-Mobile": "?0",
|
31 |
+
"Sec-Ch-Ua-Platform": "\"Windows\"",
|
32 |
+
"Sec-Fetch-Dest": "document",
|
33 |
+
"Sec-Fetch-Mode": "navigate",
|
34 |
+
"Sec-Fetch-Site": "same-origin",
|
35 |
+
"Sec-Fetch-User": "?1",
|
36 |
+
"Upgrade-Insecure-Requests": "1",
|
37 |
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
38 |
+
}
|
39 |
|
40 |
+
|
41 |
+
|
42 |
+
# cookie_str ='_ga=GA1.2.391687567.1721269988; _gid=GA1.2.1532584807.1721364777; jinglingpan:sessid=678986e8-8f1c-40d7-82c7-01ec3afede65; jinglingpan:sessid.sig=zM0_iCuVe3wphAPiAHljhtL5PoE; Hm_lvt_19198da8061c292cacd55088bd6e3eba=1721364777,1721395448; HMACCOUNT=B1C6D796AC29E639; _gat=1; _ga_Y024PNQKTV=GS1.2.1721395448.4.1.1721395455.0.0.0; Hm_lpvt_19198da8061c292cacd55088bd6e3eba=1721395468'
|
43 |
|
44 |
# headers = {
|
45 |
# "authority": "jingling.bifangpu.com",
|
46 |
# "method": "GET",
|
47 |
+
# "Cookie":cookie_str,
|
48 |
# "path": "/resource/detail/b01940f0f34e6ca91f68b258362d50f1",
|
49 |
# "scheme": "https",
|
50 |
# "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
|
65 |
# "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
|
66 |
# }
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
#返回{"code": 10602}说明已经购买过
|
69 |
def try_puchase(fid:str,session)->dict:
|
70 |
payload = {
|