Merge branch 'f0ckdev' into 'master'
Haufen Bullshit See merge request !60
This commit is contained in:
commit
b8b39685af
@ -20,7 +20,7 @@ module.exports = (lib) => {
|
||||
var tmp = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links
|
||||
tmp.forEach((entry,i,a) => {
|
||||
if(!entry.match(/f0ck\.me/i) && !entry.match(/\.onion/i)) {
|
||||
getLink(entry, ((e.message.match(/(!|-)force/i) && userlevel >= 100)?true:false), (cb) => {
|
||||
getLink(entry, ((e.message.match(/(!|-)force/i) && userlevel >= 100)?true:false), (e.message.match(/(!|-)audio/i)?true:false), (cb) => {
|
||||
if(cb.success === true) {
|
||||
fs.move(cb.file, cb.file + '.' + cb.info.ext, (err) => {
|
||||
if(!err) {
|
||||
@ -64,7 +64,7 @@ module.exports = (lib) => {
|
||||
desc: 'muh'
|
||||
});
|
||||
|
||||
var getLink = (url, force, cb) => {
|
||||
var getLink = (url, force, m4a, cb) => {
|
||||
var yt = /https?:\/\/(www\.)?youtu(\.be\/|be\.com\/)((.+\/)?(watch(\?v=|.+&v=))?(v=)?)([\w_-]{11})(&.+)?/gi;
|
||||
var sc = /https?:\/\/(www\.)?(soundcloud\.com|snd\.sc)(\/\S*)(\/\S*)/gi;
|
||||
lib.checkRepost(url, (cbcr) => {
|
||||
@ -78,14 +78,21 @@ module.exports = (lib) => {
|
||||
var title = inf.title;
|
||||
var iurl = inf.iurl;
|
||||
try {
|
||||
ytdl.downloadFromInfo(inf, { filter: (format) => { return format.container === 'webm'; } })
|
||||
//var dlformat = (m4a?'audioonly':'webm');
|
||||
var dlformat;
|
||||
if(m4a)
|
||||
dlformat = { format: '171' };
|
||||
else
|
||||
dlformat = { filter: (format) => { return format.container === 'webm'; } };
|
||||
|
||||
ytdl.downloadFromInfo(inf, dlformat)
|
||||
.on('response', (res) => {
|
||||
if( ( res.headers['content-length'] <= lib.cfg.main.maxFileSize ) || force ) {
|
||||
info = {
|
||||
type: 'youtube',
|
||||
title: title,
|
||||
mime: 'video/webm',
|
||||
ext: 'webm',
|
||||
mime: (m4a?'audio/mpeg':'video/webm'),
|
||||
ext: (m4a?'mp3':'webm'),
|
||||
thumb: iurl
|
||||
};
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ module.exports = (lib) => {
|
||||
case "reset":
|
||||
lib.cfg.trigger[e.network+e.channel] = lib.genStdTrigger();
|
||||
lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => {
|
||||
e.reply("trigger resetted");
|
||||
e.replyNotice("trigger resetted");
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@ -26,21 +26,21 @@ module.exports = (lib) => {
|
||||
if(triggerexists(trigger)) {
|
||||
lib.cfg.trigger[e.network+e.channel][trigger] = !lib.cfg.trigger[e.network+e.channel][trigger];
|
||||
lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => {
|
||||
e.reply(!cbwc?"trigger "+ trigger +" in channel "+e.channel.getName() + lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][trigger]?'green':'red')+" "+(lib.cfg.trigger[e.network+e.channel][trigger]?'activated':'deactivated'):cbwc);
|
||||
e.replyNotice(!cbwc?"trigger "+ trigger +" in channel "+e.channel.getName() + lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][trigger]?'green':'red')+" "+(lib.cfg.trigger[e.network+e.channel][trigger]?'activated':'deactivated'):cbwc);
|
||||
});
|
||||
}
|
||||
else
|
||||
e.reply("trigger "+trigger+" not found D:");
|
||||
e.replyNotice("trigger "+trigger+" not found D:");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var output = "";
|
||||
e.reply("Trigger in "+e.channel.getName()+" (green: activated, red: deactivated):");
|
||||
e.replyNotice("Trigger in "+e.channel.getName()+" (green: activated, red: deactivated):");
|
||||
for(var key in lib.cfg.trigger[e.network+e.channel])
|
||||
output += lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][key]?'green':'red')+" "+key;
|
||||
e.reply(output);
|
||||
e.replyNotice(output);
|
||||
}
|
||||
},
|
||||
desc: 'muh'
|
||||
|
Loading…
Reference in New Issue
Block a user