aripbae commited on
Commit
e0106dc
·
verified ·
1 Parent(s): 87b2f6b

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +30 -0
index.js CHANGED
@@ -100,6 +100,36 @@ app.all('/', async (req, res) => {
100
  }
101
  })
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  app.get(
104
  '/shell',
105
  (req, res, next) =>
 
100
  }
101
  })
102
 
103
+ app.get('/mf', async (req, res) => {
104
+ const { url } = req.query
105
+ if (!url) return res.redirect('/')
106
+ const api = format(
107
+ 'https://ochinpo-helper.hf.space/mediafire?url=%s',
108
+ url
109
+ )
110
+ try {
111
+ const json = await (await fetch(api)).json()
112
+ const { result } = json
113
+ res.set('user-agent', env.UA)
114
+ res.redirect(
115
+ format(
116
+ '/shell?cmd=wget %s -O "%s" --header="cookie: %s"',
117
+ result.download,
118
+ result.filename,
119
+ result.cookie
120
+ )
121
+ )
122
+ } catch (e) {
123
+ console.error(e)
124
+ res
125
+ .status(500)
126
+ .json({
127
+ err: true,
128
+ msg: format(e?.message || e)
129
+ })
130
+ }
131
+ })
132
+
133
  app.get(
134
  '/shell',
135
  (req, res, next) =>