File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function nextBestFormat(formats) {
19
19
return formats . find ( format => ! format . bitrate ) || formats [ 0 ] ;
20
20
}
21
21
22
- module . exports = function download ( url , options = { } ) {
22
+ function download ( url , options = { } ) {
23
23
return new Promise ( ( resolve , reject ) => {
24
24
ytdl . getInfo ( url , ( err , info ) => {
25
25
if ( err ) return reject ( err ) ;
@@ -55,4 +55,6 @@ module.exports = function download(url, options = {}) {
55
55
}
56
56
} ) ;
57
57
} ) ;
58
- } ;
58
+ }
59
+
60
+ module . exports = Object . assign ( download , ytdl ) ;
Original file line number Diff line number Diff line change 1
- /// <reference types="node" />
1
+ import ytdl from 'ytdl-core' ;
2
2
import { Readable } from 'stream' ;
3
- import { downloadOptions , videoFormat } from 'ytdl-core' ;
4
- export interface PrismVideoFormat extends videoFormat {
5
- audio_sample_rate ?: number ;
3
+
4
+ declare function download ( link : string , options ?: ytdl . downloadOptions ) : Promise < Readable > ;
5
+
6
+ declare namespace ytdlDiscord {
7
+ const newDownload : typeof download & typeof ytdl ;
6
8
}
7
- export declare function download ( url : string , options ?: downloadOptions ) : Promise < Readable > ;
9
+
10
+ export = ytdlDiscord . newDownload ;
You can’t perform that action at this time.
0 commit comments