From 2ab626e80e0e2debe0ba74115aacdedb0c8c5855 Mon Sep 17 00:00:00 2001 From: DiegoFleitas Date: Fri, 24 Jul 2020 00:31:29 -0300 Subject: [PATCH] README documentation for #271 --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 07dfc26..e4a6cb8 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,29 @@ playlist('https://www.youtube.com/playlist?list=PLEFA9E9D96CB7F807') ``` +Note node-youtube-dl does not currently support playlist urls with the "list" format: +``` +https://www.youtube.com/watch?v=&list= +``` +Please use instead the equivalent "playlist" format as the example below: +``` +https://www.youtube.com/playlist?list= +``` +The following snippet could be of use when making this format conversion. +``` +function toSupportedFormat(url) { + if (url.includes("list=")) { + var playlistId = url.substring(url.indexOf('list=') + 5); + return "https://www.youtube.com/playlist?list=" + playlistId; + } + return url; +} + +var url = "https://www.youtube.com/watch?v=shF8Sv-OswM&list=PLzIUZKHPb1HbqsPMIFdE0My54iektZrNU" +url = toSupportedFormat(url); +console.log(url) // "https://www.youtube.com/playlist?list=PLzIUZKHPb1HbqsPMIFdE0My54iektZrNU" +``` + ### Getting the list of extractors ``` js