muh
This commit is contained in:
		@@ -32,7 +32,7 @@
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
      setTimeout(scrollListener, 50);
 | 
			
		||||
      setTimeout(scrollListener, 200);
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
  $(document).ready(function () {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ var exec = require('child_process').exec;
 | 
			
		||||
var probe = require('node-ffprobe');
 | 
			
		||||
var crypto = require('crypto');
 | 
			
		||||
var Mime = require('mime');
 | 
			
		||||
var cfg = require('../cfg/main.json');
 | 
			
		||||
var cfg;
 | 
			
		||||
 | 
			
		||||
var bot, sql, debug;
 | 
			
		||||
 | 
			
		||||
@@ -14,6 +14,7 @@ function Lib(tbot, tsql) {
 | 
			
		||||
  this.bot = bot = tbot;
 | 
			
		||||
  this.sql = sql = tsql;
 | 
			
		||||
  this.debug = debug = false;
 | 
			
		||||
  this.cfg = cfg = require('../cfg/main.json');
 | 
			
		||||
  this.admins = [];
 | 
			
		||||
  
 | 
			
		||||
  Lib.prototype.loadUser((cb) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,19 +8,21 @@ module.exports = (bot, trigger, lib) => {
 | 
			
		||||
    name: 'ytdl',
 | 
			
		||||
    call: /https?:\/\/(www\.)?(yotu\.be\/|youtube\.com\/)?((.+\/)?(watch(\?v=|.+&v=))?(v=)?)([\w_-]{11})(&.+)?/gi,
 | 
			
		||||
    level: 0,
 | 
			
		||||
    active: 0,
 | 
			
		||||
    active: 1,
 | 
			
		||||
    func: (e) => {
 | 
			
		||||
      if(e.channel.getName() == '#f0ck') {
 | 
			
		||||
        if(!e.message.match(/\!ignore$/)) {
 | 
			
		||||
      if(e.channel.getName() == '#kbot-dev') {
 | 
			
		||||
        if(!e.message.match(/\!ignore/)) {
 | 
			
		||||
          var tmp = e.message.match(/https?:\/\/(www\.)?(yotu\.be\/|youtube\.com\/)?((.+\/)?(watch(\?v=|.+&v=))?(v=)?)([\w_-]{11})(&.+)?/gi); // get links
 | 
			
		||||
          e.reply(tmp);
 | 
			
		||||
          tmp.forEach((entry,i,a) => {
 | 
			
		||||
            var dl = true;
 | 
			
		||||
            var tmpdest = uuid.v1().split('-')[0];
 | 
			
		||||
            lib.checkRepost(entry, (cbcr) => {
 | 
			
		||||
              if(cbcr) {
 | 
			
		||||
                var dat = fs.createWriteStream('./b/'+tmpdest+'.webm');
 | 
			
		||||
                  //ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
 | 
			
		||||
                  ytdl(entry)
 | 
			
		||||
                  //ytdl(entry)
 | 
			
		||||
                try {
 | 
			
		||||
                  ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
 | 
			
		||||
                    .on('response', (res) => {
 | 
			
		||||
                      if(res.headers['content-length'] > lib.cfg.maxFileSize) {
 | 
			
		||||
                        res.destroy();
 | 
			
		||||
@@ -32,6 +34,11 @@ module.exports = (bot, trigger, lib) => {
 | 
			
		||||
                      //e.reply(err);
 | 
			
		||||
                    })
 | 
			
		||||
                    .pipe( dat );
 | 
			
		||||
                }
 | 
			
		||||
                catch(ex) {
 | 
			
		||||
                  e.reply(ex);
 | 
			
		||||
                  dl = false;
 | 
			
		||||
                }
 | 
			
		||||
                dat.on('finish', () => {
 | 
			
		||||
                  if(dl) {
 | 
			
		||||
                    dat.close();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user