Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2265c86966
4 changed files with 85 additions and 52 deletions
|
@ -135,9 +135,13 @@ class ytpCommand extends Command {
|
||||||
return youtubedl.exec(url, ['--rm-cache-dir', '--no-playlist', '--max-filesize', '50m', '--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, async function(err, output) {
|
return youtubedl.exec(url, ['--rm-cache-dir', '--no-playlist', '--max-filesize', '50m', '--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, async function(err, output) {
|
||||||
console.log(output);
|
console.log(output);
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err.toString());
|
||||||
loadingmsg.delete();
|
loadingmsg.delete();
|
||||||
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');
|
if (err.toString().includes('HTTP Error 429') || err.toString().includes('HTTP Error 403')) {
|
||||||
|
return message.channel.send('An error has occured, I can\'t download from the link you provided because the website has blocked the bot. Please try again later or upload that video as mp4 on another website.');
|
||||||
|
} else {
|
||||||
|
return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (output[2]) {
|
if (output[2]) {
|
||||||
if (output[2].includes('File is larger than max-filesize')) {
|
if (output[2].includes('File is larger than max-filesize')) {
|
||||||
|
|
|
@ -74,10 +74,13 @@ class DownloadCommand extends Command {
|
||||||
}
|
}
|
||||||
return youtubedl.exec(link, ['--rm-cache-dir', '-o', `${os.tmpdir()}/${fileName}`], {}, async function(err) {
|
return youtubedl.exec(link, ['--rm-cache-dir', '-o', `${os.tmpdir()}/${fileName}`], {}, async function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err.toString());
|
||||||
loadingmsg.delete();
|
loadingmsg.delete();
|
||||||
return message.channel.send('An error has occured, I can\'t download from the link you provided.');
|
if (err.toString().includes('HTTP Error 429') || err.toString().includes('HTTP Error 403')) {
|
||||||
}
|
return message.channel.send('An error has occured, I can\'t download from the link you provided because the website has blocked the bot. Please try again later.');
|
||||||
|
} else {
|
||||||
|
return message.channel.send('An error has occured, I can\'t download from the link you provided.');
|
||||||
|
} }
|
||||||
|
|
||||||
let ext = 'mp4';
|
let ext = 'mp4';
|
||||||
|
|
||||||
|
@ -103,7 +106,7 @@ class DownloadCommand extends Command {
|
||||||
const options = {
|
const options = {
|
||||||
input: `${os.tmpdir()}/${fileName}.${ext}`,
|
input: `${os.tmpdir()}/${fileName}.${ext}`,
|
||||||
output: `${os.tmpdir()}/${fileName}compressed.${ext}`,
|
output: `${os.tmpdir()}/${fileName}compressed.${ext}`,
|
||||||
preset: 'General/Gmail Small 10 Minutes 288p30'
|
preset: 'Web/Discord Tiny 5 Minutes 240p30'
|
||||||
};
|
};
|
||||||
|
|
||||||
let handbrake = hbjs.spawn(options);
|
let handbrake = hbjs.spawn(options);
|
||||||
|
|
116
package-lock.json
generated
116
package-lock.json
generated
|
@ -71,16 +71,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||||
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||||
},
|
},
|
||||||
"@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@discordjs/opus": {
|
"@discordjs/opus": {
|
||||||
"version": "0.3.2",
|
"version": "0.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.3.2.tgz",
|
||||||
|
@ -953,11 +943,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ansi-escape-sequences": {
|
"ansi-escape-sequences": {
|
||||||
"version": "4.1.0",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-5.1.2.tgz",
|
||||||
"integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==",
|
"integrity": "sha512-JcpoVp1W1bl1Qn4cVuiXEhD6+dyXKSOgCn2zlzE8inYgCJCBy1aPnUhlz6I4DFum8D4ovb9Qi/iAjUcGvG2lqw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"array-back": "^3.0.1"
|
"array-back": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ansi-escapes": {
|
"ansi-escapes": {
|
||||||
|
@ -1019,9 +1009,9 @@
|
||||||
"integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk="
|
"integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk="
|
||||||
},
|
},
|
||||||
"array-back": {
|
"array-back": {
|
||||||
"version": "3.1.0",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz",
|
||||||
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
"integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg=="
|
||||||
},
|
},
|
||||||
"array-equal": {
|
"array-equal": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
@ -1718,6 +1708,13 @@
|
||||||
"find-replace": "^3.0.0",
|
"find-replace": "^3.0.0",
|
||||||
"lodash.camelcase": "^4.3.0",
|
"lodash.camelcase": "^4.3.0",
|
||||||
"typical": "^4.0.0"
|
"typical": "^4.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"array-back": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"commander": {
|
"commander": {
|
||||||
|
@ -2405,11 +2402,6 @@
|
||||||
"version": "3.9.0",
|
"version": "3.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
|
||||||
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
|
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
|
||||||
},
|
|
||||||
"pify": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
|
||||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2488,16 +2480,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"discord-akairo": {
|
"discord-akairo": {
|
||||||
"version": "github:1Computer1/discord-akairo#678ae775c89947fcf77c566e04f9035941c42e0e",
|
"version": "github:1Computer1/discord-akairo#10cef7efc7a329cb1e0d96d73ccb4b83bc0afa72",
|
||||||
"from": "github:1Computer1/discord-akairo#master"
|
"from": "github:1Computer1/discord-akairo#master"
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "github:discordjs/discord.js#2583ad5da7db5ab92dfa357909f9c713db0a2981",
|
"version": "github:discordjs/discord.js#5b9cdc5cd243b1588c285e22b90d92535a30b993",
|
||||||
"from": "github:discordjs/discord.js#master",
|
"from": "github:discordjs/discord.js#master",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/collection": "^0.1.5",
|
"@discordjs/collection": "^0.1.5",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
|
"form-data": "^3.0.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"prism-media": "^1.2.0",
|
"prism-media": "^1.2.0",
|
||||||
"setimmediate": "^1.0.5",
|
"setimmediate": "^1.0.5",
|
||||||
|
@ -2505,6 +2497,16 @@
|
||||||
"ws": "^7.2.1"
|
"ws": "^7.2.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"form-data": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==",
|
||||||
|
"requires": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.3.0",
|
"version": "7.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||||
|
@ -2669,7 +2671,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"erlpack": {
|
"erlpack": {
|
||||||
"version": "github:discordapp/erlpack#c514d36ec81a7a61ef90b75df261025ab046574d",
|
"version": "github:discordapp/erlpack#5d0064f9e106841e1eead711a6451f99b0d289fd",
|
||||||
"from": "github:discordapp/erlpack",
|
"from": "github:discordapp/erlpack",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
|
@ -3340,6 +3342,13 @@
|
||||||
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
|
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"array-back": "^3.0.1"
|
"array-back": "^3.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"array-back": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"find-up": {
|
"find-up": {
|
||||||
|
@ -4227,17 +4236,27 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"handbrake-js": {
|
"handbrake-js": {
|
||||||
"version": "3.0.8",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/handbrake-js/-/handbrake-js-3.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/handbrake-js/-/handbrake-js-5.0.0.tgz",
|
||||||
"integrity": "sha512-1eWxlN/9ACCkgiCM5OXyL32Howb8KZj9ftxlsijUDztl4ieNeZ04EZ5zc6+uBviFVV7yoqz6ycj2vLxWD/EfBA==",
|
"integrity": "sha512-NtmYKTVAWxrCwKBJ4j/952bKneBWfOzJ6vMxPoEl2MqAgHrNZOWlRT67f7ftfZ8X2S1GsrZ1AgfMdkaDYx8QcA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-escape-sequences": "^4.0.1",
|
"ansi-escape-sequences": "^5.1.2",
|
||||||
"command-line-args": "^5.0.2",
|
"command-line-args": "^5.1.1",
|
||||||
"decompress": "^4.2.0",
|
"decompress": "^4.2.0",
|
||||||
"node-version-matches": "^1.0.1",
|
"node-version-matches": "^2.0.1",
|
||||||
"object-to-spawn-args": "^1.1.1",
|
"object-to-spawn-args": "^2.0.0",
|
||||||
"request": "^2.88.0",
|
"request": "^2.88.0",
|
||||||
"rimraf": "^2.6.2"
|
"rimraf": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"rimraf": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||||
|
"requires": {
|
||||||
|
"glob": "^7.1.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"handlebars": {
|
"handlebars": {
|
||||||
|
@ -5495,11 +5514,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-version-matches": {
|
"node-version-matches": {
|
||||||
"version": "1.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-2.0.1.tgz",
|
||||||
"integrity": "sha512-L1GRq9vkwvJkOdJynEph63N1gNdKRsThm6CkLn+8X9mFzmDv63iEMkZETVkcWVJowpqK72lNVuMZmeenhDoRhw==",
|
"integrity": "sha512-oqk6+05FC0dNVY5NuXuhPEMq+m1b9ZjS9SIhVE9EjwCHZspnmjSO8npbKAEieinR8GeEgbecoQcYIvI/Kwcf6Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"semver": "^5.6.0"
|
"semver": "^6.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"semver": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nopt": {
|
"nopt": {
|
||||||
|
@ -5648,9 +5674,9 @@
|
||||||
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
|
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
|
||||||
},
|
},
|
||||||
"object-to-spawn-args": {
|
"object-to-spawn-args": {
|
||||||
"version": "1.1.1",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.0.tgz",
|
||||||
"integrity": "sha1-d9qIJ/Bz0BHJ4bFz+JV4FHAkZ4U="
|
"integrity": "sha512-ZMT4owlXg3JGegecLlAgAA/6BsdKHn63R3ayXcAa3zFkF7oUBHcSb0oxszeutYe0FO2c1lT5pwCuidLkC4Gx3g=="
|
||||||
},
|
},
|
||||||
"object.assign": {
|
"object.assign": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
|
@ -7792,9 +7818,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unbzip2-stream": {
|
"unbzip2-stream": {
|
||||||
"version": "1.3.3",
|
"version": "1.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.2.tgz",
|
||||||
"integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==",
|
"integrity": "sha512-pZMVAofMrrHX6Ik39hCk470kulCbmZ2SWfQLPmTWqfJV/oUm0gn1CblvHdUu4+54Je6Jq34x8kY6XjTy6dMkOg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"buffer": "^5.2.1",
|
"buffer": "^5.2.1",
|
||||||
"through": "^2.3.8"
|
"through": "^2.3.8"
|
||||||
|
@ -8106,7 +8132,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ytpplus-node": {
|
"ytpplus-node": {
|
||||||
"version": "git+https://git@github.com/loicbersier/ytpplus-node.git#cd8c7bb893a16625b6c6150489206498377c1f1a",
|
"version": "git+https://git@github.com/loicbersier/ytpplus-node.git#a9edb7a9596734d0b518cb32e1581f06ce5f7ad7",
|
||||||
"from": "git+https://git@github.com/loicbersier/ytpplus-node.git",
|
"from": "git+https://git@github.com/loicbersier/ytpplus-node.git",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ffmpeg-static": "^2.4.0",
|
"ffmpeg-static": "^2.4.0",
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"gm": "^1.23.1",
|
"gm": "^1.23.1",
|
||||||
"grpc": "^1.24.1",
|
"grpc": "^1.24.1",
|
||||||
"handbrake-js": "^3.0.8",
|
"handbrake-js": "^5.0.0",
|
||||||
"jimp": "^0.10.3",
|
"jimp": "^0.10.3",
|
||||||
"libsodium-wrappers": "^0.7.6",
|
"libsodium-wrappers": "^0.7.6",
|
||||||
"md5-file": "^5.0.0",
|
"md5-file": "^5.0.0",
|
||||||
|
|
Loading…
Reference in a new issue