Start implementation of DivaBotGuardian
1
divabotguardian/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.guardian_env
|
1
divabotguardian/DivaBotGuardian
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit e9b45b34b72f559faf87ea51d9746da802fd0aff
|
1
divabotguardian/processes/3.divabotguardian
Normal file
@ -0,0 +1 @@
|
||||
11401
|
1
divabotguardian/processes/3.ffmpeg
Normal file
@ -0,0 +1 @@
|
||||
11399
|
5
divabotguardian/stream_monitor.sh
Executable file
@ -0,0 +1,5 @@
|
||||
cd /home/sigonasr2/divar/divabotguardian
|
||||
ffmpeg -y -ss 00:00:16 -i `curl http://projectdivar.com/streamdata/$1` -vf fps=10,setpts=N/FRAME_RATE/TB -updatefirst 1 streams/output$1.png &
|
||||
echo $! > processes/$1.ffmpeg
|
||||
java -jar DivaBotGuardian/DivaBotGuardian/DivaBotGuardian.jar $1 &
|
||||
echo $! > processes/$1.divabotguardian
|
BIN
divabotguardian/streams/tempoutput0_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput1_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput2_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput3.png
Normal file
After Width: | Height: | Size: 848 KiB |
BIN
divabotguardian/streams/tempoutput3_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput4_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput5_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput6_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput7_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput8_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
divabotguardian/streams/tempoutput9_3.png
Normal file
After Width: | Height: | Size: 47 KiB |
@ -1386,13 +1386,13 @@ function Submit(p) {
|
||||
Detailed
|
||||
</Route>
|
||||
<Route path="/submitplay/switch">
|
||||
<h2>Nintendo Switch/Twitter Upload</h2>
|
||||
<h2>Playstation/Nintendo Switch/Twitter Upload</h2>
|
||||
Want to upload your scores to the website conveniently? Go to <Link to="/usersettings">Edit Profile Settings</Link> and enter your Twitter username, then follow the steps below!
|
||||
<hr/>
|
||||
<div className="row mb-4">
|
||||
<div className="col-4 m-6">
|
||||
<h4>Step 1</h4>
|
||||
From your Nintendo Switch Album, select up to 4 results screenshots that you want the DivaRBot to parse.
|
||||
From your Nintendo Switch Album or Playstation Gallery, select up to 4 results screenshots that you want the DivaRBot to parse.
|
||||
</div>
|
||||
<div className="col-8 m-6">
|
||||
<img width="100%" className="border rounded shadow" src="http://projectdivar.com/files/switch1.png"/>
|
||||
@ -1427,8 +1427,8 @@ function Submit(p) {
|
||||
<Link to="/submitplay/image" className="nostyle">
|
||||
<div className="card-body">
|
||||
<h5 className="card-title">Image Upload</h5>
|
||||
<p className="card-text">Upload images from your Nintendo Switch for automatic processing/scoring!</p>
|
||||
<p className="card-text"><small className="text-muted">Put up to 50 images in a zip file to mass-upload your screenshotted plays to your profile. You will need to extract them from your microSD card from your Nintendo Switch.</small></p>
|
||||
<p className="card-text">Upload images from your Playstation/Nintendo Switch for automatic processing/scoring!</p>
|
||||
<p className="card-text"><small className="text-muted">Put up to 50 images in a zip file to mass-upload your screenshotted plays to your profile. You will need to extract them from your microSD card from your Nintendo Switch or using a USB for your Playstation.</small></p>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
@ -1436,8 +1436,8 @@ function Submit(p) {
|
||||
<div className="card">
|
||||
<Link to="/submitplay/switch" className="nostyle">
|
||||
<div className="card-body">
|
||||
<h5 className="card-title">Nintendo Switch/Twitter Upload</h5>
|
||||
<p className="card-text">Setup your account for uploading through Twitter using your Nintendo Switch!</p>
|
||||
<h5 className="card-title">Playstation/Nintendo Switch/Twitter Upload</h5>
|
||||
<p className="card-text">Setup your account for uploading through Twitter using your Playstation or Nintendo Switch!</p>
|
||||
<p className="card-text"><small className="text-muted">You can select up to 4 images to post to Twitter at one time.</small></p>
|
||||
</div>
|
||||
</Link>
|
||||
@ -1800,7 +1800,7 @@ function ReleaseList(p) {
|
||||
|
||||
function DivaBot() {
|
||||
const releases=[
|
||||
["05C","http://projectdivar.com/files/releases/DivaBot05C1.zip","23 Sep 2020",<> <Badge variant="info" pill>Recommended</Badge> <i>Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions.</i></>],
|
||||
["05C","http://projectdivar.com/files/releases/DivaBot05C2.zip","24 Sep 2020",<> <Badge variant="info" pill>Recommended</Badge> <i>Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions. Improve difficulty detection.</i></>],
|
||||
["05B","http://projectdivar.com/files/releases/DivaBot05B.zip","22 Sep 2020",<> <IMAGE_BUG/> <i>Improved song select recognition speed.</i></>],
|
||||
["05A","http://projectdivar.com/files/releases/DivaBot05A.zip","21 Sep 2020",<> <i>Added multi-monitor support. Use calibration to switch monitors.</i></>],
|
||||
["05","http://projectdivar.com/files/releases/DivaBot05.zip","21 Sep 2020",<> <i>Added Miku FC. Huge optimizations to result screen capture, improve menu detection algorithms.</i></>],
|
||||
|
@ -2,7 +2,14 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.use(
|
||||
"/streamdata",
|
||||
"/getUserAuthData",
|
||||
createProxyMiddleware({
|
||||
target: 'http://server:4501',
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
app.use(
|
||||
"/streamdata/:id",
|
||||
createProxyMiddleware({
|
||||
target: 'http://server:4501',
|
||||
changeOrigin: true,
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 3c10a63ac967128e56c333106fbc4e5edea21dcf
|
||||
Subproject commit 457bbb6fa840d8a36b2f6b935bb2fc4066891a5f
|
@ -988,11 +988,50 @@ 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])
|
||||
.then((data)=>{
|
||||
if (data.rows.length>0) {
|
||||
res.status(400).json(data.rows[0])
|
||||
} else {
|
||||
res.status(400).send("No user found!")
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch((err)=>{
|
||||
res.status(500).send(err.message)
|
||||
})
|
||||
} else {
|
||||
res.status(400).send("Authentication failed!")
|
||||
}
|
||||
} else {
|
||||
res.status(400).send("Invalid credentials!");
|
||||
}
|
||||
})
|
||||
|
||||
app.get('/streamdata',function (req,res){
|
||||
db.query("select * from streams where id=1")
|
||||
app.get('/streamdata/:id',function (req,res){
|
||||
db.query("select twitch_name from users where id=$1",[req.params.id])
|
||||
.then((data)=>{
|
||||
res.status(200).send(data.rows[0].stream)
|
||||
return twitchStreams.get(data.rows[0].twitch_name)
|
||||
})
|
||||
.then(function(streams) {
|
||||
if (streams.length>0) {
|
||||
var streamchoice = undefined
|
||||
for (var i=0;i<streams.length;i++) {
|
||||
if (streams[i].quality.includes("720p")) {
|
||||
streamchoice = streams[i]
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (streamchoice===undefined) {
|
||||
streamchoice = streams[0];
|
||||
}
|
||||
res.status(200).send(streamchoice.url)
|
||||
} else {
|
||||
res.status(400).send("Not online!")
|
||||
}
|
||||
})
|
||||
.catch((err)=>{
|
||||
res.status(500).send(err.message)
|
||||
@ -1050,7 +1089,7 @@ axios.get('https://api.twitter.com/1.1/search/tweets.json?q=@divarbot', {
|
||||
return Process(data);
|
||||
})
|
||||
.then((data)=>{process_images.forEach((image)=>{console.log(image)})})*/
|
||||
setInterval(
|
||||
/*setInterval(
|
||||
()=>{
|
||||
twitchStreams.get('smallant')
|
||||
.then(function(streams) {
|
||||
@ -1062,7 +1101,7 @@ setInterval(
|
||||
.catch((err)=>{
|
||||
console.log(err.message)
|
||||
})
|
||||
},5000)
|
||||
},5000)*/
|
||||
|
||||
setInterval(
|
||||
()=>{
|
||||
|