From e653cbf645989b17ff7c4461f391bdd3f8fc921c Mon Sep 17 00:00:00 2001 From: Killer069 <65385476+killer069@users.noreply.github.com> Date: Tue, 7 Sep 2021 13:02:26 +0530 Subject: [PATCH] updated YouTube - docs --- docs/YouTube/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/YouTube/README.md b/docs/YouTube/README.md index 42b22d6..37facff 100644 --- a/docs/YouTube/README.md +++ b/docs/YouTube/README.md @@ -52,11 +52,16 @@ let id = extractID(url) }) // This creates resource for playing ``` -### stream_from_info(info : `infoData`) +### stream_from_info(info : `infoData`, cookie? : `string`) *This is basic to create a youtube stream from a info [ from [video_info](https://github.com/play-dl/play-dl#video_infourl--string) function ].* + +**[Cookies](https://github.com/play-dl/play-dl/discussions/34) are optional and are required for playing age restricted videos.** + +**Note :*** cookies are required for retrying purposes. ```js let info = await video_info("url") let source = await stream_from_info(info) // This will create a stream Class which contains type and stream to be played. + let source = await stream_from_info(info, cookie) // This will create a stream Class which contains type and stream to be played and also give cookies if retrying. let resource = createAudioResource(source.stream, { inputType : source.type }) // This creates resource for playing