mvp1
This commit is contained in:
parent
789a51c6e2
commit
af13200158
7
app.js
7
app.js
@ -19,14 +19,17 @@ var tr_client = new Transmission({
|
|||||||
|
|
||||||
app.post("/__api/torrent", async function(req, res, next){
|
app.post("/__api/torrent", async function(req, res, next){
|
||||||
|
|
||||||
if(req.body.api !== '4412') return res.status(421);
|
if(req.body.password !== '4412'){
|
||||||
|
return res.status(421);
|
||||||
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
let cres = await tr_client.addUrl(Buffer.from(req.body.magnet, 'base64').toString('binary'));
|
let cres = await tr_client.addUrl(Buffer.from(req.body.magnet, 'base64').toString('binary'));
|
||||||
console.log(cres)
|
res.json(cres)
|
||||||
|
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.error('error', e)
|
console.error('error', e)
|
||||||
|
res.status(500).json({message: e})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user