mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Forgot that we use HTTPS now
This commit is contained in:
@@ -22,20 +22,21 @@ try{
|
||||
}
|
||||
catch(err){
|
||||
console.log("Starting without https (probably on localhost)");
|
||||
if(err["errno"] != 34)console.log(err);
|
||||
var cors_proxy = require('cors-anywhere');
|
||||
var request = require('request');
|
||||
if(err["errno"] != 34)console.log(err);
|
||||
var cors_proxy = require('cors-anywhere');
|
||||
|
||||
cors_proxy.createServer({
|
||||
requireHeader: ['origin', 'x-requested-with'],
|
||||
removeHeaders: ['cookie', 'cookie2'],
|
||||
}).listen(8080, function() {
|
||||
console.log('Running CORS Anywhere on :' + 8080);
|
||||
});
|
||||
var http = require('http');
|
||||
server = http.createServer(handler);
|
||||
cors_proxy.createServer({
|
||||
requireHeader: ['origin', 'x-requested-with'],
|
||||
removeHeaders: ['cookie', 'cookie2'],
|
||||
}).listen(8080, function() {
|
||||
console.log('Running CORS Anywhere on :' + 8080);
|
||||
});
|
||||
var http = require('http');
|
||||
server = http.createServer(handler);
|
||||
}
|
||||
|
||||
var request = require('request');
|
||||
|
||||
var io = require('socket.io')(server, {'pingTimeout': 25000});
|
||||
|
||||
//db
|
||||
@@ -656,15 +657,9 @@ function change_song(coll, error)
|
||||
{
|
||||
db.collection(coll).find({now_playing:true}, function(err, now_playing_doc){
|
||||
if(error){
|
||||
console.log("coll: " + coll);
|
||||
console.log("err: " + err);
|
||||
console.log("error: " + error);
|
||||
console.log("now_playing_doc: " + now_playing_doc);
|
||||
console.log("request: " + request);
|
||||
request.get('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg')
|
||||
.on('response', function (response) {
|
||||
request('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg', function (err, response, body) {
|
||||
console.log(response);
|
||||
if (response.statusCode == 404) {
|
||||
if (err || response.statusCode == 404) {
|
||||
db.collection(coll).remove({now_playing:true}, function(err, docs){
|
||||
change_song_post(coll);
|
||||
io.to(coll).emit("channel", ["deleted", now_playing_doc[0].id]);
|
||||
|
||||
Reference in New Issue
Block a user