BaseExtractor
new BaseExtractor(context)
Parameter | Type | Optional | Description |
---|---|---|---|
context | ExtractorExecutionContext | ❌ | Context that instantiated this extractor |
Properties
public context: ExtractorExecutionContext
Context that instantiated this extractor
public static identifier: string
Identifier for this extractor
public identifier: string
Identifier of this extractor
Methods
public activate(): Promise<void>
This method will be executed when this extractor is activated
public createResponse(playlist?, tracks): ExtractorInfo
Create extractor response
Parameter | Type | Optional | Description |
---|---|---|---|
playlist | null | Playlist | ✅ | The playlist |
tracks | Array<Track> | ❌ | The track array |
public deactivate(): Promise<void>
This method will be executed when this extractor is deactivated
public debug(message): boolean
Write debug message
Parameter | Type | Optional | Description |
---|---|---|---|
message | string | ❌ | The debug message |
public emit(event, args): boolean
Dispatch an event to the player
Parameter | Type | Optional | Description |
---|---|---|---|
event | K | ❌ | The event to dispatch |
args | Parameters<PlayerEvents[K]> | ❌ | The data to dispatch |
public handle(query, context): Promise<ExtractorInfo>
Handle the given query
Parameter | Type | Optional | Description |
---|---|---|---|
query | string | ❌ | The query to handle |
context | ExtractorSearchContext | ❌ | - |
public handlePostStream(stream, next): void
A stream middleware to handle streams before passing it to the player
Parameter | Type | Optional | Description |
---|---|---|---|
stream | Readable | ❌ | The incoming stream |
next | NextFunction | ❌ | The next function |
public stream(info): Promise<string | Readable>
Stream the given track
Parameter | Type | Optional | Description |
---|---|---|---|
info | Track | ❌ | The track to stream |
public validate(query, type?): Promise<boolean>
Validate incoming query
Parameter | Type | Optional | Description |
---|---|---|---|
query | string | ❌ | The query to validate |
type | null | SearchQueryType | ✅ | - |