![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
discord-player-youtubei
Advanced tools
An unofficial package to test the use of youtubei in discord-player v6.
This is a preview the v7 version of the YouTube system that discord-player will be using made backwards compatiable with v6.
$ npm install discord-player-youtubei
# ----------- or -----------
$ yarn add discord-player-youtubei
import { YoutubeiExtractor } from "discord-player-youtubei"
const player = useMainPlayer() // or new Player()
player.extractors.register(YoutubeiExtractor, {})
const { YoutubeiExtractor } = require("discord-player-youtubei")
const player = useMainPlayer() // or new Player()
player.extractors.register(YoutubeiExtractor, {})
I have seen many people registering the extractor in their commands. DO NOT DO THIS
As of 1.2.1
, discord-player-youtubei will detect if you are signed in or not and will use YouTube music streaming system. If this is not available, the extractor will use normal YouTube.
You can override this behavior using the overrideBridgeMode
option. See the extractor options below for more information regarding the types
First run the following command
$ npx --no discord-player-youtubei
The token will be printed out shortly
In case of errors, you can directly run the generateOauthTokens
function exported by discord-player-youtubei
import { YoutubeiExtractor } from "discord-player-youtubei"
const player = useMainPlayer()
/**
* getOauthTokens is not a real function exported by discord-player-youtubei.
* It is simply a placeholder for the actual oauth tokens
*
* Do not just put in access token. Put in the entire string.
*/
const oauthTokens = getOauthTokens() // The tokens printed from step above
player.extractors.register(YoutubeiExtractor, {
authentication: oauthTokens
})
name | type | description | required |
---|---|---|---|
useClient | InnerTubeClient | Which client to get the stream from | false |
name | type | description |
---|---|---|
authentication | string | The auth token |
overrideDownloadOptions | DownloadOptions | Override the default download options |
createStream | fn (q, ext): Promise<string|Readable> | Override the streaming function |
signOutOnDeactive | boolean | Revoke the tokens after deactivation |
overrideBridgeMode | "ytmusic" or "yt" | Override the bridging behavior |
streamOptions | StreamOptions | Configure streaming behavior |
disablePlayer | boolean | Disable the JavaScript player. Use ANDORID client for streaming when using this |
interface YoutubeiOptions {
authentication?: string;
overrideDownloadOptions?: DownloadOptions;
createStream?: (q: Track, extractor: BaseExtractor<object>) => Promise<string | Readable>;
signOutOnDeactive?: boolean;
streamOptions?: {
useClient?: InnerTubeClient
};
overrideBridgeMode?: "ytmusic" | "yt"
}
class | function | params | static | description |
---|---|---|---|---|
YoutubeiExtractor | setClientMode | InnerTubeClient | true | Set the innertube client on the fly |
Try installing an alpha or a beta build using npm install discord-player-youtubei@alpha
or npm install discord-player-youtubei@beta
. If this still does not work or you installed a version that is lower than the main version, feel free to open an issue on our GitHub page
If you know how to fix it, please clone this repository and send us a pull request. As this is an open source project, any contributions are welcome!
Just star this repo!
Streaming from YouTube is against their Terms of Service (ToS). Refer to LEGAL.md
to view the risks using YouTube.
FAQs
An unofficial package to test the use of youtubei in discord-player v6.
The npm package discord-player-youtubei receives a total of 816 weekly downloads. As such, discord-player-youtubei popularity was classified as not popular.
We found that discord-player-youtubei demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.