Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #316 from DiegoFleitas/master
Browse files Browse the repository at this point in the history
README documentation for #271
  • Loading branch information
Kikobeats authored Aug 18, 2020
2 parents 3951701 + 2ab626e commit 4cdad10
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<video-id>&list=<playlist id>
```
Please use instead the equivalent "playlist" format as the example below:
```
https://www.youtube.com/playlist?list=<playlist id>
```
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
Expand Down

0 comments on commit 4cdad10

Please sign in to comment.