This commit is contained in:
karl.hudgell 2021-02-13 13:14:15 +00:00
parent 30990f4a31
commit c5130ed93f
9 changed files with 156 additions and 86 deletions

2
.vscode/launch.json vendored
View File

@ -18,7 +18,7 @@
"skipFiles": [ "skipFiles": [
"<node_internals>/**" "<node_internals>/**"
], ],
"program": "${workspaceFolder}/app.js" "program": "${workspaceFolder}/bin/www"
}, },
{ {
"type": "node", "type": "node",

10
app.js
View File

@ -5,7 +5,8 @@ var cookieParser = require('cookie-parser');
var logger = require('morgan'); var logger = require('morgan');
var indexRouter = require('./routes/index'); var indexRouter = require('./routes/index');
var usersRouter = require('./routes/getStreams'); var streamsRouter = require('./routes/getStreams');
var usersRouter = require('./routes/postUser')
var app = express(); var app = express();
// const basicAuth = require('express-basic-auth') // const basicAuth = require('express-basic-auth')
@ -21,7 +22,8 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter); app.use('/', indexRouter);
app.use('/getStreams', usersRouter); app.use('/getStreams', streamsRouter);
app.use('/postUser', usersRouter);
// app.use(basicAuth({ // app.use(basicAuth({
// users: { 'BBLBTV': 'BBLBTV' }, // users: { 'BBLBTV': 'BBLBTV' },
@ -30,12 +32,12 @@ app.use('/getStreams', usersRouter);
// })) // }))
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function (req, res, next) {
next(createError(404)); next(createError(404));
}); });
// error handler // error handler
app.use(function(err, req, res, next) { app.use(function (err, req, res, next) {
// set locals, only providing error in development // set locals, only providing error in development
res.locals.message = err.message; res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {}; res.locals.error = req.app.get('env') === 'development' ? err : {};

View File

@ -1,36 +0,0 @@
let streamArrays = require('./lib/streamArray.json')
let users = require('./lib/logins.json')
const { gotRequest } = require('./lib/gotRequest')
const delay = ms => new Promise(res => setTimeout(res, ms));
async function main() {
for (let index = 0; index < users.length; index++) {
const user = users[index];
console.log('Trying ' + user.username)
for (let index = 0; index < streamArrays.length; index++) {
await delay(500);
const stream = streamArrays[index];
process.stdout.write('.')
let url = stream.StreamURL + "/player_api.php?username=" + user.username + "&password=" + user.password
let t = await gotRequest(url)
let body = t.body
if (t.statusCode == 200 && body !== "") {
body = JSON.parse(body)
if (body.user_info.auth) {
var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString('en-GB')
process.stdout.write('\n')
console.log('Match - ' + user.username + ' - ' + stream.StreamURL + ' - ' + stream.StreamName + ' - Expires - ' + date)
break
}
}
}
process.stdout.write('\nEnd Of Streams\n\n')
}
console.log('Finished')
}
main()

View File

@ -1,43 +1,53 @@
.App { /* Pen-specific styles */
* {
box-sizing: border-box;
}
body {
font-size: 1.25rem;
font-family: sans-serif;
line-height: 150%;
text-shadow: 0 2px 2px #1b1917;
}
section {
color: #fff;
text-align: center; text-align: center;
} }
.App-logo { div {
height: 40vmin; height: 100%;
pointer-events: none;
} }
@media (prefers-reduced-motion: no-preference) { article {
.App-logo { position: absolute;
animation: App-logo-spin infinite 20s linear; top: 50%;
} left: 50%;
transform: translate(-50%, -50%);
width: 100%;
padding: 20px;
} }
.App-h1 { h1 {
background-color: #282c34; font-size: 1.75rem;
color: white; margin: 0 0 0.75rem 0;
} }
.App-header { /* Pattern styles */
background-color: #282c34; .container {
/* min-height: 100vh; */ display: table;
display: flex; width: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
} }
.App-link { .left-half {
color: #61dafb; background-color: #060b4d9f;
position: absolute;
left: 0px;
width: 50%;
} }
@keyframes App-logo-spin { .right-half {
from { background-color: #060b4d9f;
transform: rotate(0deg); position: absolute;
} right: 0px;
to { width: 50%;
transform: rotate(360deg); }
}
}

View File

@ -1,22 +1,30 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './App.css'; import './App.css';
class App extends Component { class App extends Component {
state = { users: [] } state = { streams: [] }
componentDidMount() { componentDidMount() {
fetch('/getStreams') fetch('/getStreams')
.then(res => res.json()) .then(res => res.json())
.then(users => this.setState({ users })); .then(streams => this.setState({ streams }));
} }
render() { render() {
return ( return (
<div className="App"> <section class="container">
<header className="App-header"> <div class="left-half">
<h1>Servers</h1> <article>
{this.state.users.map(user => <h1>Servers</h1>
<div key={user.StreamName}>{user.StreamName} - {user.StreamURL}</div> {this.state.streams.map(stream =>
)} <div key={stream.StreamName}>{stream.StreamName} - {stream.StreamURL}</div>
</header> )}
</div> </article>
</div>
<div class="right-half">
<article>
<h1>Right Half</h1>
<p>If your knees aren't green by the end of the day, you ought to seriously re-examine your life.</p>
</article>
</div>
</section>
); );
} }
} }

View File

@ -1,9 +1,7 @@
version: '3' version: "3"
services: services:
backend: backend:
# env_file:
# "./backend/backend.env"
build: build:
context: . context: .
dockerfile: .dockerfile dockerfile: .dockerfile
@ -20,4 +18,14 @@ services:
environment: environment:
- PORT=6969 - PORT=6969
links: links:
- "backend:be" - "backend:be"
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
adminer:
image: adminer
restart: always
ports:
- 8080:8080

63
lib/checker.js Normal file
View File

@ -0,0 +1,63 @@
let streamArrays = require('./streamArray.json')
let users = require('./logins.json')
const { gotRequest } = require('./gotRequest')
const delay = ms => new Promise(res => setTimeout(res, ms));
async function singleCheck(username) {
let user = users.find(user => user.username === username)
for (let index = 0; index < streamArrays.length; index++) {
await delay(500);
const stream = streamArrays[index];
process.stdout.write('.')
let url = stream.StreamURL + "/player_api.php?username=" + user.username + "&password=" + user.password
let t = await gotRequest(url)
let body = t.body
if (t.statusCode == 200 && body !== "") {
body = JSON.parse(body)
if (body.user_info.auth) {
var date = new Date(body.user_info.exp_date * 1000)
process.stdout.write('\n')
console.log('Match - ' + user.username + ' - ' + stream.StreamURL + ' - ' + stream.StreamName + ' - Expires - ' + date)
stream.username = user.username
stream.expiaryDate = date.toLocaleDateString('en-GB')
return (stream)
}
}
}
process.stdout.write('\nEnd Of Streams\n\n')
}
async function main() {
for (let index = 0; index < users.length; index++) {
const user = users[index];
console.log('Trying ' + user.username)
for (let index = 0; index < streamArrays.length; index++) {
await delay(500);
const stream = streamArrays[index];
process.stdout.write('.')
let url = stream.StreamURL + "/player_api.php?username=" + user.username + "&password=" + user.password
let t = await gotRequest(url)
let body = t.body
if (t.statusCode == 200 && body !== "") {
body = JSON.parse(body)
if (body.user_info.auth) {
var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString('en-GB')
process.stdout.write('\n')
console.log('Match - ' + user.username + ' - ' + stream.StreamURL + ' - ' + stream.StreamName + ' - Expires - ' + date)
break
}
}
}
process.stdout.write('\nEnd Of Streams\n\n')
}
console.log('Finished')
}
module.exports = {
singleCheck,
main
}

View File

@ -1 +1 @@
[{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"??","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"??","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"??","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"Gambler","StreamURL":"http://iptv.satplex.co.uk:8080"},{"StreamName":"??","StreamURL":"http://37723998.to:2052"},{"StreamName":"??","StreamURL":"http://apkdns.store:8080"},{"StreamName":"??","StreamURL":"http://opplex.tv:8080"}] [{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443","username":"Dazg3012","expiaryDate":"12/30/2021"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://faithhosting.xyz:25461"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"??","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"??","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"Gambler","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"??","StreamURL":"http://iptv.satplex.co.uk:8080"},{"StreamName":"??","StreamURL":"http://37723998.to:2052"},{"StreamName":"??","StreamURL":"http://apkdns.store:8080"}]

15
routes/postUser.js Normal file
View File

@ -0,0 +1,15 @@
var express = require('express');
var router = express.Router();
const { singleCheck } = require('../lib/checker')
/* POST postUser page. */
router.post('/', async function (req, res, next) {
let postedUsername = req.body.username
let data = await singleCheck(postedUsername)
res.send(data);
});
module.exports = router;