diff --git a/logs.log b/logs.log index e6d043f..ff2a366 100644 --- a/logs.log +++ b/logs.log @@ -13,3 +13,23 @@ [16-06-20 02:52:49] HTTP server listening on port 8080 [16-06-20 02:52:49] WebSocket server listening on 8080 [16-06-20 02:52:51] New socket connection from ip: ::1, unique id: 7W0rQzo24-UqCalpAAAA +[16-06-20 03:11:04] HTTP server listening on port 8080 +[16-06-20 03:11:04] WebSocket server listening on 8080 +[16-06-20 03:11:05] New socket connection from ip: ::1, unique id: Q2m7dtTGe6lNQxo5AAAA +[16-06-20 03:11:12] New socket connection from ip: ::1, unique id: qJ1bfjS0_61x7G4-AAAB +[16-06-20 03:11:28] HTTP server listening on port 8080 +[16-06-20 03:11:28] WebSocket server listening on 8080 +[16-06-20 03:11:28] New socket connection from ip: ::1, unique id: QNTLHDsXxz7TX4IRAAAA +[16-06-20 03:11:30] New socket connection from ip: ::1, unique id: WpmATpvyOYtWfHp_AAAB +[16-06-20 03:12:50] New socket connection from ip: ::1, unique id: 7HcseLMEU0cMIHLtAAAC +[16-06-20 03:19:16] HTTP server listening on port 8080 +[16-06-20 03:19:16] WebSocket server listening on 8080 +[16-06-20 03:19:16] New socket connection from ip: ::1, unique id: jru-gz5sOMdHMYicAAAA +[16-06-20 03:19:18] New socket connection from ip: ::1, unique id: lCBoInIW8DjhXPaLAAAB +[16-06-20 03:24:30] HTTP server listening on port 8080 +[16-06-20 03:24:30] WebSocket server listening on 8080 +[16-06-20 03:24:31] New socket connection from ip: ::1, unique id: X-G4yZ0D-5ChdSEFAAAA +[16-06-20 03:24:43] HTTP server listening on port 8080 +[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 diff --git a/public/index.js b/public/index.js index 2c1011d..624c52a 100644 --- a/public/index.js +++ b/public/index.js @@ -1,5 +1,20 @@ -let socket = io(); +let Socket = io(); -(() => { +(() => +{ console.log('Starting up'); })(); + +const VideoInput = document.getElementById("VideosToRecord"); + +VideoInput.oninput = () => +{ + const ToSend = { + // TODO: add toggle + ExpectPreview: true, + Content: VideoInput.value.split('\n') + }; + Socket.emit('VideoListUpdate', ToSend); +}; + +Socket.on('VideoListResolution', (req) => console.log(req)); diff --git a/src/server.js b/src/server.js index 978a15c..9436769 100644 --- a/src/server.js +++ b/src/server.js @@ -25,9 +25,24 @@ module.exports.Listen = async () => io.on('connection', async (socket) => { Logger.Log(`New socket connection from ip: ${socket.handshake.address}, unique id: ${socket.id}`); + + SocketHandler(socket); + }); } +function SocketHandler(socket) +{ + socket.on('VideoListUpdate', (req) => VideoListUpdate(socket, req) ); +} + +async function VideoListUpdate(socket, req) +{ + + + socket.emit('VideoListResolution', req.Content); +} + module.exports.App = app; module.exports.Http = http; module.exports.Io = io; diff --git a/src/youtubehelper.js b/src/youtubehelper.js index 2ac00fd..5169da4 100644 --- a/src/youtubehelper.js +++ b/src/youtubehelper.js @@ -1,5 +1,7 @@ const YTDL = require('ytdl-core'); +// TODO: does the video resolver need a queue? + module.exports.GetVideoInfoArr = async (arr) => { @@ -7,5 +9,5 @@ module.exports.GetVideoInfoArr = async (arr) => module.exports.GetVideoInfo = async (video) => { - + }