-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharer.js
31 lines (31 loc) · 1018 Bytes
/
sharer.js
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
//https:\/\/sharer\.pw\/file\/.+
function extract(url) {
return JSON.parse(request({
url: url + "/dl",
method: "POST",
headers: {
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "en-US,en;q=0.9",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"pragma": "no-cache",
"sec-ch-ua": "\"Not_A Brand\";v=\"99\", \"Google Chrome\";v=\"109\", \"Chromium\";v=\"109\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest",
"Referer": url,
"Referrer-Policy": "strict-origin-when-cross-origin"
},
body: "_token="+request({
url: url,
method: "GET",
cookies: {
"XSRF-TOKEN": sharer_xsrf_token,
"laravel_session": sharer_laravel_session
}
}).bodyText.match(/_token\s=\s'(.+)'/)[1]
}).bodyText).url
}