diff --git a/docs/README.md b/docs/README.md index 1ea6ed9..1fa5b92 100644 --- a/docs/README.md +++ b/docs/README.md @@ -77,6 +77,7 @@ let data = await search('Rick Roll', { limit: 1, source : { soundcloud : "tracks - quality : `number` :- Sets quality of stream [ 0 = Lowest, 1 = Medium ]. Leave this empty to get highest audio quality. - cookie : `string` :- **[Cookies](https://github.com/play-dl/play-dl/discussions/34)** are optional and are required for playing age restricted videos. +- proxy : `Proxy` :- Optional parameter to add support of proxies. As of now, HTTPS proxies are only supported. So make sure to get HTTPS proxies only. #### stream(url : `string`, options? : [`StreamOptions`](https://github.com/play-dl/play-dl/tree/main/docs#streamoptions-)) @@ -91,6 +92,14 @@ let source = await stream("url", { quality : 1 }) // Next to Lowest quality. let source = await stream("url", { cookie: COOKIE }) //This will create a stream Class and also give cookies. +let source = await stream(url, { proxy : ['url'] }) // Accepts a url which has port in in it. + +let source = await stream(url. {proxy : [{ + host : "IP or hostname", + port : 8080 + }] +}) // Or add a json containing hostname and port. + let resource = createAudioResource(source.stream, { inputType : source.type }) // This creates resource for playing @@ -104,7 +113,7 @@ _This is basic to create a stream from a info [ from [video_info](https://github ```js let source = await stream_from_info(info) // This will create a stream Class from video_info or SoundCoudTrack Class. Highest Quality - + let source = await stream_from_info(info, { quality : 0 }) // Lowest quality let source = await stream_from_info(info, { quality : 1 }) // Next to Lowest quality. @@ -112,7 +121,15 @@ let source = await stream_from_info(info, { quality : 1 }) // Next to Lowest qua let source = await stream_from_info(info, { cookie: COOKIE }) //This will create a stream Class and also give cookies if retrying. - let resource = createAudioResource(source.stream, { +let source = await stream_from_info(url, { proxy : ['url'] }) // Accepts a url which has port in in it. + +let source = await stream_from_info(url. {proxy : [{ + host : "IP or hostname", + port : 8080 + }] +}) // Or add a json containing hostname and port. + +let resource = createAudioResource(source.stream, { inputType : source.type }) // This creates resource for playing ``` diff --git a/docs/YouTube/README.md b/docs/YouTube/README.md index d054fd3..0267d44 100644 --- a/docs/YouTube/README.md +++ b/docs/YouTube/README.md @@ -43,22 +43,37 @@ let id = extractID(url) ## Video -### video_basic_info(url : `string`, cookie? : `string`) +### InfoOptions + +_This are the info options that can be passed as a parameter in `video_info` and `video_basic_info`_ + +- cookie : **[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.** +- proxy : Optional parameter to add support of proxies. As of now, HTTPS proxies are only supported. So make sure to get HTTPS proxies only. + +```js +const video = await video_basic_info(url, { cookie : "cookies" }) // Gives cookies support + +const video = await video_basic_info(url, { proxy : ['url'] }) // Accepts a url which has port in in it. + +const video = await video_basic_info(url. {proxy : [{ + host : "IP or hostname", + port : 8080 + }] +}) // Or add a json containing hostname and port. +``` + +### video_basic_info(url : `string`, options? : [`InfoOptions`]()) _The basic video details `play-dl` fetches at first from url or videoID._ -**[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.** - ```js const video = await video_basic_info(url) ``` -### video_info(url : `string`, cookie? : `string`) +### video_info(url : `string`, , options? : [`InfoOptions`]()) _This contains everything with deciphered formats along with `video_details`. It can fetech data from url or videoID._ -**[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.** - ```js const video = await video_info(url) ``` @@ -74,18 +89,18 @@ const video = await video_info(url) ## Playlist -### playlist_info(url : `string`, parseIncomplete : `boolean`) +### playlist_info(url : `string`, options : `PlaylistOptions`) _This fetches all details about a playlist from a url or playlistID._ -**parseIncomplete** is optional parameter if you want to parse playlist with hidden videos. - ```js const playlist = await playlist_info(url) //This only fetches first 100 videos from a playlist -const playlist = await playlist_info(url, true) +const playlist = await playlist_info(url, { incomplete : true }) //This only fetches first 100 videos from a playlist and also parses playlist with hidden videos + +const playlist = await playlist_info(url, { proxy : [''] }) // Same 2 options as mentioned in InfoOptions ``` - #### fetch() `method`