Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itaisteinherz/is-playlist
Check if an URL is a YouTube playlist
https://github.com/itaisteinherz/is-playlist
Last synced: about 1 month ago
JSON representation
Check if an URL is a YouTube playlist
- Host: GitHub
- URL: https://github.com/itaisteinherz/is-playlist
- Owner: itaisteinherz
- License: mit
- Created: 2017-08-13T22:33:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-21T20:58:25.000Z (about 5 years ago)
- Last Synced: 2024-09-28T03:40:18.486Z (about 2 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-playlist [![Build Status](https://travis-ci.org/itaisteinherz/is-playlist.svg?branch=master)](https://travis-ci.org/itaisteinherz/is-playlist)
> Check if an URL is a YouTube playlist
## Install
```
$ npm install is-playlist
```## Usage
```js
const isPlaylist = require("is-playlist");isPlaylist("https://www.youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI");
//=> trueisPlaylist("https://youtu.be/BCQHnlnPusY?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV");
//=> trueisPlaylist("https://youtu.be/dQw4w9WgXcQ");
//=> falseisPlaylist("https://vimeo.com/channels/staffpicks/229370456");
//=> false
```## API
### isPlaylist(url)
Checks if the given `url` is either a playlist (e.g. https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV) or a video that's part of a playlist (e.g. https://youtu.be/BCQHnlnPusY?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV).
#### url
Type: `string`
URL to check.
## License
MIT © [Itai Steinherz](https://github.com/itaisteinherz)