Spaces:
Running
Running
rogerxavier
commited on
Update utils.py
Browse files
utils.py
CHANGED
@@ -8,12 +8,12 @@ session = requests.Session()
|
|
8 |
urlBase = 'https://jingling.bifangpu.com'
|
9 |
purchaseBase = urlBase+"/api/resource/purchase"
|
10 |
|
11 |
-
|
12 |
-
cookie
|
13 |
-
|
14 |
|
15 |
-
session.cookies = requests.utils.cookiejar_from_dict(cookie)
|
16 |
|
|
|
17 |
headers = {
|
18 |
"authority": "jingling.bifangpu.com",
|
19 |
"method": "GET",
|
@@ -38,33 +38,6 @@ headers = {
|
|
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 = {
|
|
|
8 |
urlBase = 'https://jingling.bifangpu.com'
|
9 |
purchaseBase = urlBase+"/api/resource/purchase"
|
10 |
|
11 |
+
#截止时间信息:jinglingpan:sessid=37848ef5-bcc5-4125-8063-f2551f2a4573; path=/; expires=Fri, 02 Aug 2024 13:43:50 GMT, jinglingpan:sessid.sig=UbZnoB5l_Y1ajNpMnhOVHSYpmKE; path=/; expires=Fri, 02 Aug 2024 13:43:50 GMT
|
12 |
+
cookie={"jinglingpan:sessid": "37848ef5-bcc5-4125-8063-f2551f2a4573", "jinglingpan:sessid.sig": "UbZnoB5l_Y1ajNpMnhOVHSYpmKE"}
|
13 |
+
|
14 |
|
|
|
15 |
|
16 |
+
session.cookies = requests.utils.cookiejar_from_dict(cookie)
|
17 |
headers = {
|
18 |
"authority": "jingling.bifangpu.com",
|
19 |
"method": "GET",
|
|
|
38 |
}
|
39 |
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
#返回{"code": 10602}说明已经购买过
|
42 |
def try_puchase(fid:str,session)->dict:
|
43 |
payload = {
|