damn
This commit is contained in:
parent
aa3dc93eeb
commit
7398dba271
@ -20,7 +20,7 @@ module.exports = (lib, userlevel) => {
|
||||
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)?true:false), (cb) => {
|
||||
getLink(entry, ((e.message.match(/(!|-)force/i) && userlevel >= 100)?true:false), (cb) => {
|
||||
if(cb.success === true) {
|
||||
fs.move(cb.file, cb.file + '.' + cb.info.ext, (err) => {
|
||||
if(!err) {
|
||||
@ -72,7 +72,6 @@ module.exports = (lib, userlevel) => {
|
||||
if(cbcr === true) {
|
||||
var dat = fs.createWriteStream('./b/' + tmpdest);
|
||||
var info;
|
||||
|
||||
if(url.match(yt)) { // ytdl
|
||||
ytdl.getInfo(url, (err, inf) => {
|
||||
if(!err) {
|
||||
@ -81,7 +80,7 @@ module.exports = (lib, userlevel) => {
|
||||
try {
|
||||
ytdl.downloadFromInfo(inf, { filter: (format) => { return format.container === 'webm'; } })
|
||||
.on('response', (res) => {
|
||||
if( ( res.headers['content-length'] <= lib.cfg.main.maxFileSize ) || ( userlevel >= 100 && force ) ) {
|
||||
if( ( res.headers['content-length'] <= lib.cfg.main.maxFileSize ) || force ) {
|
||||
info = {
|
||||
type: 'youtube',
|
||||
title: title,
|
||||
@ -141,7 +140,7 @@ module.exports = (lib, userlevel) => {
|
||||
lib.log('MimeType: '+type);
|
||||
var length = res.headers['content-length'];
|
||||
if(lib.cfg.main.allowedMimes.hasOwnProperty(type)) {
|
||||
if( ( data.length <= lib.cfg.main.maxFileSize ) || ( userlevel >= 100 && force ) ) {
|
||||
if( ( data.length <= lib.cfg.main.maxFileSize ) || force ) {
|
||||
var s = new Readable
|
||||
s.push(data);
|
||||
s.push(null);
|
||||
|
Loading…
Reference in New Issue
Block a user