vikarshana commited on
Commit
9ff8475
·
verified ·
1 Parent(s): c232e2f

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +27 -3
index.js CHANGED
@@ -124,12 +124,36 @@ app.get("/api/direct", async (req, res) => {
124
 
125
  const cookies = await page.cookies();
126
  const cookieHeader = cookies.map(c => `${c.name}=${c.value}`).join("; ");
127
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  res.json({
129
  status: true,
130
- cookieHeader
131
  });
132
-
133
  } catch (err) {
134
  res.status(500).json({ status: false, error: err.message });
135
  } finally {
 
124
 
125
  const cookies = await page.cookies();
126
  const cookieHeader = cookies.map(c => `${c.name}=${c.value}`).join("; ");
127
+ const respo = await fetch(intermediate, {
128
+ method: "GET",
129
+ redirect: "auto",
130
+ headers: {
131
+ "authority": "wildshare.net",
132
+ "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",
133
+ "accept-encoding": "gzip, deflate, br, zstd",
134
+ "accept-language": "en-US,en;q=0.9",
135
+ "priority": "u=0, i",
136
+ "referer": intermediate,
137
+ "sec-ch-ua": "\"Not;A=Brand\";v=\"99\", \"Google Chrome\";v=\"139\", \"Chromium\";v=\"139\"",
138
+ "sec-ch-ua-mobile": "?0",
139
+ "cookie": cookieHeader,
140
+ "sec-fetch-dest": "document",
141
+ "sec-fetch-mode": "navigate",
142
+ "sec-fetch-site": "same-origin",
143
+ "sec-fetch-user": "?1",
144
+ "upgrade-insecure-requests": "1",
145
+ "user-agent":
146
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
147
+ },
148
+ });
149
+
150
+ if (response.status === 302 || response.status === 301) {
151
+ const location = response.headers.get("location");
152
  res.json({
153
  status: true,
154
+ location
155
  });
156
+ }
157
  } catch (err) {
158
  res.status(500).json({ status: false, error: err.message });
159
  } finally {