Implement basic stream monitoring
This commit is contained in:
parent
ea5add10f9
commit
f9852b8ef1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
postgres-data
|
4
divabotguardian/.gitignore
vendored
4
divabotguardian/.gitignore
vendored
@ -1 +1,3 @@
|
||||
.guardian_env
|
||||
.guardian_env
|
||||
streams
|
||||
processes
|
BIN
divabotguardian/cropped.png
Normal file
BIN
divabotguardian/cropped.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
divabotguardian/lib/httpclient-4.5.12.jar
Normal file
BIN
divabotguardian/lib/httpclient-4.5.12.jar
Normal file
Binary file not shown.
BIN
divabotguardian/lib/httpcore-4.4.13.jar
Normal file
BIN
divabotguardian/lib/httpcore-4.4.13.jar
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
11401
|
||||
31083
|
||||
|
@ -1 +1 @@
|
||||
11399
|
||||
31081
|
||||
|
@ -1,6 +1,13 @@
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.use(
|
||||
"/passImageData",
|
||||
createProxyMiddleware({
|
||||
target: 'http://server:4501',
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
app.use(
|
||||
"/getUserAuthData",
|
||||
createProxyMiddleware({
|
||||
|
@ -991,10 +991,11 @@ app.post('/updateuser', function(req, res) {
|
||||
app.post('/getUserAuthData', function(req, res) {
|
||||
if (req.body&&req.body.password&&req.body.userId) {
|
||||
if (req.body.password===process.env.GUARDIANPASSWORD) {
|
||||
db.query("select username,authentication_token from users where id=$1",[req.body.userId])
|
||||
db.query("select uploads,username,authentication_token from users where id=$1",[req.body.userId])
|
||||
.then((data)=>{
|
||||
if (data.rows.length>0) {
|
||||
res.status(400).json(data.rows[0])
|
||||
db.query("update users set uploads=$1 where id=$2",[data.rows[0].uploads+1,req.body.userId])
|
||||
} else {
|
||||
res.status(400).send("No user found!")
|
||||
}
|
||||
@ -1011,6 +1012,20 @@ app.post('/getUserAuthData', function(req, res) {
|
||||
}
|
||||
})
|
||||
|
||||
app.post('/passImageData',function(req,res) {
|
||||
if (req.body&&req.body.user&&req.body.auth&&req.body.url) {
|
||||
axios.post("http://projectdivar.com/image",{user:req.body.user,auth:req.body.auth,url:req.body.url})
|
||||
.then((data)=>{
|
||||
res.status(200).json(data.data)
|
||||
})
|
||||
.catch((err)=>{
|
||||
res.status(500).send(err.message)
|
||||
})
|
||||
} else {
|
||||
res.status(400).send("Invalid credentials!")
|
||||
}
|
||||
})
|
||||
|
||||
app.get('/streamdata/:id',function (req,res){
|
||||
db.query("select twitch_name from users where id=$1",[req.params.id])
|
||||
.then((data)=>{
|
||||
|
@ -80,3 +80,4 @@
|
||||
{"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"}
|
||||
{"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"}
|
||||
{"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"}
|
||||
{"song":"スノーマン","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://projectdivar.com/files/plays/3/690"}
|
||||
|
Loading…
x
Reference in New Issue
Block a user