error handling
This commit is contained in:
50
logs.log
50
logs.log
@@ -33,3 +33,53 @@
|
||||
[16-06-20 03:24:43] WebSocket server listening on 8080
|
||||
[16-06-20 03:24:43] New socket connection from ip: ::ffff:127.0.0.1, unique id: EDr3u3IDv2e1cVwQAAAA
|
||||
[16-06-20 03:24:44] New socket connection from ip: ::1, unique id: 7qeD4lAnehuv25SFAAAB
|
||||
[17-06-20 14:36:15] HTTP server listening on port 8080
|
||||
[17-06-20 14:36:15] WebSocket server listening on 8080
|
||||
[17-06-20 14:36:39] New socket connection from ip: ::1, unique id: ozbgb48APMPxmX5NAAAA
|
||||
[17-06-20 15:14:39] New socket connection from ip: ::1, unique id: 6kcKanwHteEEr5--AAAB
|
||||
[17-06-20 15:32:18] New socket connection from ip: ::1, unique id: o8McTcjvuw1MfGRAAAAC
|
||||
[17-06-20 15:46:09] HTTP server listening on port 8080
|
||||
[17-06-20 15:46:09] WebSocket server listening on 8080
|
||||
[17-06-20 15:46:09] New socket connection from ip: ::1, unique id: ubnHKDJx59Dq5oxCAAAA
|
||||
[17-06-20 15:47:25] HTTP server listening on port 8080
|
||||
[17-06-20 15:47:25] WebSocket server listening on 8080
|
||||
[17-06-20 15:47:26] New socket connection from ip: ::1, unique id: zn8q29M4NnRHrwYTAAAA
|
||||
[17-06-20 15:47:44] HTTP server listening on port 8080
|
||||
[17-06-20 15:47:44] WebSocket server listening on 8080
|
||||
[17-06-20 15:47:45] New socket connection from ip: ::1, unique id: MhUfGB4S6nTKxqoLAAAA
|
||||
[17-06-20 15:48:08] HTTP server listening on port 8080
|
||||
[17-06-20 15:48:08] WebSocket server listening on 8080
|
||||
[17-06-20 15:48:08] New socket connection from ip: ::1, unique id: bs8QSn2XbLWxjkvsAAAA
|
||||
[17-06-20 15:48:18] HTTP server listening on port 8080
|
||||
[17-06-20 15:48:18] WebSocket server listening on 8080
|
||||
[17-06-20 15:48:18] New socket connection from ip: ::1, unique id: iBdKj7PHM7TNNbBeAAAA
|
||||
[17-06-20 15:48:43] HTTP server listening on port 8080
|
||||
[17-06-20 15:48:43] WebSocket server listening on 8080
|
||||
[17-06-20 15:48:43] New socket connection from ip: ::1, unique id: B-ZOpfe9EuKP45G_AAAA
|
||||
[17-06-20 15:49:10] HTTP server listening on port 8080
|
||||
[17-06-20 15:49:10] WebSocket server listening on 8080
|
||||
[17-06-20 15:49:11] New socket connection from ip: ::1, unique id: uMingmcoFe2wFXlhAAAA
|
||||
[17-06-20 16:07:06] HTTP server listening on port 8080
|
||||
[17-06-20 16:07:06] WebSocket server listening on 8080
|
||||
[17-06-20 16:07:07] New socket connection from ip: ::1, unique id: G1xadvSVuyu_DopSAAAA
|
||||
[17-06-20 16:09:55] HTTP server listening on port 8080
|
||||
[17-06-20 16:09:55] WebSocket server listening on 8080
|
||||
[17-06-20 16:09:56] New socket connection from ip: ::1, unique id: VQbAY3Etr39bqeCJAAAA
|
||||
[17-06-20 16:10:41] HTTP server listening on port 8080
|
||||
[17-06-20 16:10:41] WebSocket server listening on 8080
|
||||
[17-06-20 16:10:42] New socket connection from ip: ::1, unique id: XSWa7bGLV7_sv-mKAAAA
|
||||
[17-06-20 16:11:03] HTTP server listening on port 8080
|
||||
[17-06-20 16:11:03] WebSocket server listening on 8080
|
||||
[17-06-20 16:11:04] New socket connection from ip: ::1, unique id: oHgArBsXvI1H_9DvAAAA
|
||||
[17-06-20 16:11:37] HTTP server listening on port 8080
|
||||
[17-06-20 16:11:37] WebSocket server listening on 8080
|
||||
[17-06-20 16:11:37] New socket connection from ip: ::1, unique id: TTiofYgL2EZCed7AAAAA
|
||||
[17-06-20 16:11:54] HTTP server listening on port 8080
|
||||
[17-06-20 16:11:54] WebSocket server listening on 8080
|
||||
[17-06-20 16:11:54] New socket connection from ip: ::1, unique id: QtGnVyqBZgO9sMzeAAAA
|
||||
[17-06-20 16:12:49] HTTP server listening on port 8080
|
||||
[17-06-20 16:12:49] WebSocket server listening on 8080
|
||||
[17-06-20 16:12:49] New socket connection from ip: ::1, unique id: ptUKwzDKPwSNpGGjAAAA
|
||||
[17-06-20 16:13:11] HTTP server listening on port 8080
|
||||
[17-06-20 16:13:11] WebSocket server listening on 8080
|
||||
[17-06-20 16:13:12] New socket connection from ip: ::1, unique id: RGn4_bvVIIU5ZnRmAAAA
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<textarea id="VideosToRecord"></textarea>
|
||||
</div>
|
||||
|
||||
<button id="Download">Download</button>
|
||||
<input type="checkbox" id="AudioOnly">Only Download Audio (.mp3)
|
||||
<!-- <button id="Download">Download</button> -->
|
||||
<!-- <input type="checkbox" id="AudioOnly">Only Download Audio (.mp3) -->
|
||||
|
||||
<script src="index.js"></script>
|
||||
<div id="copyright">Copyright Benjamin Kyd© <script type="text/javascript">document.write(new Date().getFullYear())</script></div>
|
||||
|
||||
@@ -38,9 +38,63 @@ function SocketHandler(socket)
|
||||
|
||||
async function VideoListUpdate(socket, req)
|
||||
{
|
||||
// req format
|
||||
// {
|
||||
// ExptectPreview: bool,
|
||||
// Content: [arr]
|
||||
// }
|
||||
|
||||
let Res = {};
|
||||
|
||||
// res format
|
||||
// errors not present if error is false
|
||||
// content not present if error is true
|
||||
// {
|
||||
// Error: bool,
|
||||
// Errors: [err],
|
||||
// Content: {
|
||||
// id: int,
|
||||
// url: string,
|
||||
// valid: bool,
|
||||
// action: string
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!req || !req.Content)
|
||||
{
|
||||
Res.Error = true;
|
||||
Res.Errors = ErorrsBuilder("Content Error", "No content in request");
|
||||
socket.emit('VideoListResolution', Res);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket.emit('VideoListResolution', req.Content);
|
||||
|
||||
const VideoArray = req.Content;
|
||||
|
||||
|
||||
socket.emit('VideoListResolution', );
|
||||
}
|
||||
|
||||
|
||||
function ErorrsBuilder(...errors)
|
||||
{
|
||||
// errors format
|
||||
// Errors: [{
|
||||
// type: string,
|
||||
// content: string
|
||||
// }],
|
||||
let ret = [];
|
||||
let j = 0;
|
||||
for (let i = 0; i < errors.length; i += 2)
|
||||
{
|
||||
ret[j] = {
|
||||
type: errors[i],
|
||||
content: errors[i+1]
|
||||
};
|
||||
j++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
module.exports.App = app;
|
||||
|
||||
Reference in New Issue
Block a user