All Projects → CodeDotJS → youtube-playlist

CodeDotJS / youtube-playlist

Licence: MIT license
❄️ Extract links, ids, and names from a youtube playlist

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to youtube-playlist

Hashids.js
A small JavaScript library to generate YouTube-like ids from numbers.
Stars: ✭ 3,525 (+4728.77%)
Mutual labels:  npm-package, ids
yt-videos-list
Create and **automatically** update a list of all videos on a YouTube channel (in txt/csv/md form) via YouTube bot with end-to-end web scraping - no API tokens required. Multi-threaded support for YouTube videos list updates.
Stars: ✭ 64 (-12.33%)
Mutual labels:  scraper, youtube-api
scrapetube
Get all videos from a youtube channel, get all videos from a playlist, get all videos that match a search
Stars: ✭ 120 (+64.38%)
Mutual labels:  scraper, youtube-api
sotoki
StackExchange websites to ZIM scraper
Stars: ✭ 64 (-12.33%)
Mutual labels:  scraper
npmlint
[DEPRECATED] Lint your npm package
Stars: ✭ 57 (-21.92%)
Mutual labels:  npm-package
djb2a
DJB2a non-cryptographic hash function
Stars: ✭ 31 (-57.53%)
Mutual labels:  npm-package
fadable
Fade in elements as they move into view, at both the bottom and top of the viewport.
Stars: ✭ 16 (-78.08%)
Mutual labels:  npm-package
Links
A responsive webpage for putting all our links in. A substitute for linktree created using HTML, CSS and JS using custom admin dashboard.
Stars: ✭ 18 (-75.34%)
Mutual labels:  links
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+24.66%)
Mutual labels:  npm-package
CourseCake
By serving course 📚 data that is more "edible" 🍰 for developers, we hope CourseCake offers a smooth approach to build useful tools for students.
Stars: ✭ 21 (-71.23%)
Mutual labels:  scraper
unfurl
Extract rich metadata from URLs
Stars: ✭ 41 (-43.84%)
Mutual labels:  scraper
robotstxt
robots.txt file parsing and checking for R
Stars: ✭ 65 (-10.96%)
Mutual labels:  scraper
TNSR IDS
IDS using a port mirror, Snort and an alert -> RESTCONF utility
Stars: ✭ 30 (-58.9%)
Mutual labels:  ids
youtube-json-server
Your personal Youtube API server to get Youtube API responses without needing credentials.
Stars: ✭ 32 (-56.16%)
Mutual labels:  youtube-api
laravel-linkable
URL binding for Laravel models
Stars: ✭ 22 (-69.86%)
Mutual labels:  links
wazuh-ansible
Wazuh - Ansible playbook
Stars: ✭ 166 (+127.4%)
Mutual labels:  ids
vue-link
One component to link them all 🔗
Stars: ✭ 65 (-10.96%)
Mutual labels:  links
TikTok
Download public videos on TikTok using Python with Selenium
Stars: ✭ 37 (-49.32%)
Mutual labels:  scraper
angular-youtube-player
Simple youtube player created with angular and typescript. See demo.
Stars: ✭ 35 (-52.05%)
Mutual labels:  youtube-api
civic-scraper
Tools for downloading agendas, minutes and other documents produced by local government
Stars: ✭ 21 (-71.23%)
Mutual labels:  scraper



Extract links, ids, durations and names from a youtube playlist


Install

$ npm install --save youtube-playlist

Usage

  • urls
const ytlist = require('youtube-playlist');

const url = 'https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704';

ytlist(url, 'url').then(res => {
  console.log(res);
  /* Object
  { data:
   { playlist:
      [ 'https://youtube.com/watch?v=bgU7FeiWKzc',
        'https://youtube.com/watch?v=3PUVr8jFMGg',
        'https://youtube.com/watch?v=3pXVHRT-amw',
        'https://youtube.com/watch?v=KOVc5o5kURE' ] } }
   */
});

// or

ytlist(url, 'url').then(res => {
  console.log(res.data.playlist);
  /* Array
  [ 'https://youtube.com/watch?v=bgU7FeiWKzc',
  'https://youtube.com/watch?v=3PUVr8jFMGg',
  'https://youtube.com/watch?v=3pXVHRT-amw',
  'https://youtube.com/watch?v=KOVc5o5kURE' ]
   */
});
  • names
ytlist(url, 'name').then(res => {
  console.log(res);
  /*
  { data:
   { playlist:
      [ 'Singleton Design Pattern - Beau teaches JavaScript',
        'Observer Design Pattern - Beau teaches JavaScript',
        'Module Design Pattern - Beau teaches JavaScript',
        'Mediator Design Pattern - Beau teaches JavaScript' ] } }
   */
});
  • ids
ytlist(url, 'id').then(res => {
  console.log(res);
  // => { data: { playlist: [ 'bgU7FeiWKzc', '3PUVr8jFMGg', '3pXVHRT-amw', 'KOVc5o5kURE' ] } }
})
  • durations
ytlist(url, 'duration').then(res => {
  console.log(res);
  // => { data: { playlist: [ 291, 237, 164, 309 ] } }
})
  • multiple details
ytlist(url).then(res => {
  console.log(res.data);
  // = [{}]
});

// or

ytlist(url, ['id', 'name', 'url']).then(res => {
  console.log(res.data);
  /* Array
  [ { id: 'bgU7FeiWKzc',
    name: 'Singleton Design Pattern - Beau teaches JavaScript',
    url: 'https://youtube.com/watch?v=bgU7FeiWKzc',
    isPrivate: false },
  { id: '3PUVr8jFMGg',
    name: 'Observer Design Pattern - Beau teaches JavaScript',
    url: 'https://youtube.com/watch?v=3PUVr8jFMGg',
    isPrivate: false },
  { id: '3pXVHRT-amw',
    name: 'Module Design Pattern - Beau teaches JavaScript',
    url: 'https://youtube.com/watch?v=3pXVHRT-amw',
    isPrivate: false },
  { id: 'KOVc5o5kURE',
    name: 'Mediator Design Pattern - Beau teaches JavaScript',
    url: 'https://youtube.com/watch?v=KOVc5o5kURE',
    isPrivate: false } ]
   */
});

Notice: In multiple details - another prop will be added. isPrivate will be true when the video is private (for not loggedin user).

API

ytlist(url, opts)

opts

  • id : returns only ids of all the videos present in a playlist

  • url : returns only urls of all the videos present in a playlist

  • name : return only name of the videos present in a playlist

  • duration : return only duration (in seconds) of the videos present in a playlist

  • Passing opts either as url or an array of options ['id', 'name', 'url', 'duration'] returns all the details.

Type of

  • url : string

  • opts : string or array

NOTE

  • This api already supports url-redirection, so you are free to use the shortened url.

  • For data extraction, you can either choose -

    • playlist url
    • url of the content from playlist #1

Related

  • Pufetch : The best youtube playlist url scrapper and exporter!

License

MIT © Rishi Giri

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].