forked from Supositware/Haha-Yes
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) {
|
||||
console.log(output);
|
||||
if (err) {
|
||||
console.error(err);
|
||||
console.error(err.toString());
|
||||
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 {
|
||||
if (output[2]) {
|
||||
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) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
console.error(err.toString());
|
||||
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';
|
||||
|
||||
|
@ -103,7 +106,7 @@ class DownloadCommand extends Command {
|
|||
const options = {
|
||||
input: `${os.tmpdir()}/${fileName}.${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);
|
||||
|
|
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",
|
||||
"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": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.3.2.tgz",
|
||||
|
@ -953,11 +943,11 @@
|
|||
}
|
||||
},
|
||||
"ansi-escape-sequences": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz",
|
||||
"integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-5.1.2.tgz",
|
||||
"integrity": "sha512-JcpoVp1W1bl1Qn4cVuiXEhD6+dyXKSOgCn2zlzE8inYgCJCBy1aPnUhlz6I4DFum8D4ovb9Qi/iAjUcGvG2lqw==",
|
||||
"requires": {
|
||||
"array-back": "^3.0.1"
|
||||
"array-back": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"ansi-escapes": {
|
||||
|
@ -1019,9 +1009,9 @@
|
|||
"integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk="
|
||||
},
|
||||
"array-back": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz",
|
||||
"integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg=="
|
||||
},
|
||||
"array-equal": {
|
||||
"version": "1.0.0",
|
||||
|
@ -1718,6 +1708,13 @@
|
|||
"find-replace": "^3.0.0",
|
||||
"lodash.camelcase": "^4.3.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": {
|
||||
|
@ -2405,11 +2402,6 @@
|
|||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
|
||||
"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": {
|
||||
"version": "github:1Computer1/discord-akairo#678ae775c89947fcf77c566e04f9035941c42e0e",
|
||||
"version": "github:1Computer1/discord-akairo#10cef7efc7a329cb1e0d96d73ccb4b83bc0afa72",
|
||||
"from": "github:1Computer1/discord-akairo#master"
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "github:discordjs/discord.js#2583ad5da7db5ab92dfa357909f9c713db0a2981",
|
||||
"version": "github:discordjs/discord.js#5b9cdc5cd243b1588c285e22b90d92535a30b993",
|
||||
"from": "github:discordjs/discord.js#master",
|
||||
"requires": {
|
||||
"@discordjs/collection": "^0.1.5",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"form-data": "^3.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"prism-media": "^1.2.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
|
@ -2505,6 +2497,16 @@
|
|||
"ws": "^7.2.1"
|
||||
},
|
||||
"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": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||
|
@ -2669,7 +2671,7 @@
|
|||
}
|
||||
},
|
||||
"erlpack": {
|
||||
"version": "github:discordapp/erlpack#c514d36ec81a7a61ef90b75df261025ab046574d",
|
||||
"version": "github:discordapp/erlpack#5d0064f9e106841e1eead711a6451f99b0d289fd",
|
||||
"from": "github:discordapp/erlpack",
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
|
@ -3340,6 +3342,13 @@
|
|||
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
|
||||
"requires": {
|
||||
"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": {
|
||||
|
@ -4227,17 +4236,27 @@
|
|||
}
|
||||
},
|
||||
"handbrake-js": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/handbrake-js/-/handbrake-js-3.0.8.tgz",
|
||||
"integrity": "sha512-1eWxlN/9ACCkgiCM5OXyL32Howb8KZj9ftxlsijUDztl4ieNeZ04EZ5zc6+uBviFVV7yoqz6ycj2vLxWD/EfBA==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/handbrake-js/-/handbrake-js-5.0.0.tgz",
|
||||
"integrity": "sha512-NtmYKTVAWxrCwKBJ4j/952bKneBWfOzJ6vMxPoEl2MqAgHrNZOWlRT67f7ftfZ8X2S1GsrZ1AgfMdkaDYx8QcA==",
|
||||
"requires": {
|
||||
"ansi-escape-sequences": "^4.0.1",
|
||||
"command-line-args": "^5.0.2",
|
||||
"ansi-escape-sequences": "^5.1.2",
|
||||
"command-line-args": "^5.1.1",
|
||||
"decompress": "^4.2.0",
|
||||
"node-version-matches": "^1.0.1",
|
||||
"object-to-spawn-args": "^1.1.1",
|
||||
"node-version-matches": "^2.0.1",
|
||||
"object-to-spawn-args": "^2.0.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": {
|
||||
|
@ -5495,11 +5514,18 @@
|
|||
}
|
||||
},
|
||||
"node-version-matches": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-1.0.1.tgz",
|
||||
"integrity": "sha512-L1GRq9vkwvJkOdJynEph63N1gNdKRsThm6CkLn+8X9mFzmDv63iEMkZETVkcWVJowpqK72lNVuMZmeenhDoRhw==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-2.0.1.tgz",
|
||||
"integrity": "sha512-oqk6+05FC0dNVY5NuXuhPEMq+m1b9ZjS9SIhVE9EjwCHZspnmjSO8npbKAEieinR8GeEgbecoQcYIvI/Kwcf6Q==",
|
||||
"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": {
|
||||
|
@ -5648,9 +5674,9 @@
|
|||
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
|
||||
},
|
||||
"object-to-spawn-args": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-1.1.1.tgz",
|
||||
"integrity": "sha1-d9qIJ/Bz0BHJ4bFz+JV4FHAkZ4U="
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.0.tgz",
|
||||
"integrity": "sha512-ZMT4owlXg3JGegecLlAgAA/6BsdKHn63R3ayXcAa3zFkF7oUBHcSb0oxszeutYe0FO2c1lT5pwCuidLkC4Gx3g=="
|
||||
},
|
||||
"object.assign": {
|
||||
"version": "4.1.0",
|
||||
|
@ -7792,9 +7818,9 @@
|
|||
}
|
||||
},
|
||||
"unbzip2-stream": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz",
|
||||
"integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.2.tgz",
|
||||
"integrity": "sha512-pZMVAofMrrHX6Ik39hCk470kulCbmZ2SWfQLPmTWqfJV/oUm0gn1CblvHdUu4+54Je6Jq34x8kY6XjTy6dMkOg==",
|
||||
"requires": {
|
||||
"buffer": "^5.2.1",
|
||||
"through": "^2.3.8"
|
||||
|
@ -8106,7 +8132,7 @@
|
|||
}
|
||||
},
|
||||
"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",
|
||||
"requires": {
|
||||
"ffmpeg-static": "^2.4.0",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"fluent-ffmpeg": "^2.1.2",
|
||||
"gm": "^1.23.1",
|
||||
"grpc": "^1.24.1",
|
||||
"handbrake-js": "^3.0.8",
|
||||
"handbrake-js": "^5.0.0",
|
||||
"jimp": "^0.10.3",
|
||||
"libsodium-wrappers": "^0.7.6",
|
||||
"md5-file": "^5.0.0",
|
||||
|
|
Loading…
Reference in a new issue