discord-ytdl-core
Advanced tools
Comparing version 1.0.2 to 1.0.3-dev
const ytdl = require("discord-ytdl-core"); | ||
const Discord = require("discord.js"); // discord.js v11.5.1 | ||
const Discord = require("discord.js"); | ||
const client = new Discord.Client(); | ||
client.on("ready", () => { | ||
console.log("boom") | ||
console.log("boom"); | ||
}); | ||
@@ -12,16 +12,13 @@ | ||
if (msg.content === "??play") { | ||
if (!msg.member.voiceChannel) return msg.channel.send("You're not in a voice channel?"); | ||
if (!msg.member.voice.channel) return msg.channel.send("You're not in a voice channel?"); | ||
let input = ytdl("https://youtube.com/watch?v=7wtfhZwyrcc", { | ||
filter: "audioonly", | ||
quality: "highestaudio", | ||
highWaterMark: 1 << 25, | ||
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=15'] | ||
}); | ||
msg.member.voiceChannel.join() | ||
msg.member.voice.channel.join() | ||
.then(connection => { | ||
connection.playOpusStream(input, | ||
connection.play(input, | ||
{ | ||
highWaterMark: 1, | ||
bitrate: 320000 | ||
type: "opus" | ||
}) | ||
@@ -28,0 +25,0 @@ }) |
{ | ||
"name": "discord-ytdl-core", | ||
"version": "1.0.2", | ||
"version": "1.0.3-dev", | ||
"description": "Simple ytdl wrapper for discord bots with custom ffmpeg args support.", | ||
@@ -38,11 +38,11 @@ "main": "index.js", | ||
"dependencies": { | ||
"ffmpeg-static": "^4.0.1", | ||
"prism-media": "^1.2.1", | ||
"ytdl-core": "^1.0.9" | ||
"ytdl-core": "^2.1.1" | ||
}, | ||
"devDependencies": { | ||
"@discordjs/opus": "^0.1.0", | ||
"discord.js": "^11.5.1" | ||
"discord.js": "^11.5.1", | ||
"ffmpeg-static": "^4.0.1" | ||
}, | ||
"runkitExampleFilename": "example.js" | ||
} |
# discord-ytdl-core | ||
Simple ytdl wrapper for discord bots with custom ffmpeg args support. | ||
[v1.0.3-dev] | ||
```bash | ||
npm i discord-ytdl-core | ||
npm i INEX07/discord-ytdl-core | ||
``` | ||
@@ -14,14 +15,25 @@ | ||
const ytdl = require("discord-ytdl-core"); | ||
const client = new (require("discord")).Client(); | ||
function playStream(connection) { | ||
return connection.play(ytdl("url", { | ||
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10'] | ||
client.on("ready", () => console.log("Online!")); | ||
function playStream(connection, url) { | ||
return connection.play(ytdl(url, { | ||
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10'] // bassboost (ffmpeg args) | ||
}), { | ||
type: 'opus' | ||
type: 'opus' // play as opus | ||
}) | ||
} | ||
client.on("message", async (message) => { | ||
if (message.author.bot || !message.guild) return; | ||
if (message.content.startsWith("?p")) { | ||
let connection = await message.member.voice.channel.join(); | ||
return playStream(connection, "video_url"); | ||
} | ||
client.login("TOKEN"); | ||
``` | ||
# Discord | ||
**[Click Me](https://discord.gg/AHdaSqr)** | ||
**[Click Me](https://discord.gg/5qN9fsF)** |
const ytdl = require("../index"); | ||
const Discord = require("discord.js"); // discord.js v11.5.1 | ||
const Discord = require("discord.js"); | ||
const client = new Discord.Client(); | ||
@@ -12,17 +12,11 @@ | ||
if (msg.content === "??play") { | ||
if (!msg.member.voiceChannel) return msg.channel.send("You're not in a voice channel?"); | ||
if (!msg.member.voice.channel) return msg.channel.send("You're not in a voice channel?"); | ||
let input = ytdl("https://youtube.com/watch?v=ERu6jh_1gR0", { | ||
filter: "audioonly", | ||
quality: "highestaudio", | ||
highWaterMark: 1 << 25, | ||
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10'] | ||
}); | ||
msg.member.voiceChannel.join() | ||
msg.member.voice.channel.join() | ||
.then(connection => { | ||
connection.playOpusStream(input, | ||
{ | ||
highWaterMark: 1, | ||
bitrate: 320000 | ||
}) | ||
connection.play(input, { type: "opus" }) | ||
}) | ||
@@ -29,0 +23,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16276
2
7
39
3
1
77
2
1
+ Addedm3u8stream@0.7.1(transitive)
+ Addedytdl-core@2.1.7(transitive)
- Removedffmpeg-static@^4.0.1
- Removed@derhuerst/http-basic@8.2.4(transitive)
- Removed@types/node@10.17.60(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedconcat-stream@2.0.0(transitive)
- Removeddebug@4.3.7(transitive)
- Removedenv-paths@2.2.1(transitive)
- Removedffmpeg-static@4.4.1(transitive)
- Removedhttp-response-object@3.0.2(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedm3u8stream@0.6.5(transitive)
- Removedms@2.1.3(transitive)
- Removedparse-cache-control@1.0.1(transitive)
- Removedprogress@2.0.3(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedytdl-core@1.0.9(transitive)
Updatedytdl-core@^2.1.1