{"id":23201076,"url":"https://github.com/codedotjs/youtube-playlist","last_synced_at":"2025-08-18T23:33:02.878Z","repository":{"id":46104672,"uuid":"133013353","full_name":"CodeDotJS/youtube-playlist","owner":"CodeDotJS","description":":snowflake: Extract links, ids, and names from a youtube playlist","archived":false,"fork":false,"pushed_at":"2020-07-19T16:09:54.000Z","size":401,"stargazers_count":90,"open_issues_count":3,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-11T21:11:50.658Z","etag":null,"topics":["api","ids","links","names","nodejs","npm-package","scraper","urls","youtube","youtube-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeDotJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-11T08:37:36.000Z","updated_at":"2024-11-06T12:49:56.000Z","dependencies_parsed_at":"2022-09-08T16:52:26.770Z","dependency_job_id":null,"html_url":"https://github.com/CodeDotJS/youtube-playlist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDotJS%2Fyoutube-playlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDotJS%2Fyoutube-playlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDotJS%2Fyoutube-playlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDotJS%2Fyoutube-playlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeDotJS","download_url":"https://codeload.github.com/CodeDotJS/youtube-playlist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230292740,"owners_count":18203650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ids","links","names","nodejs","npm-package","scraper","urls","youtube","youtube-api"],"created_at":"2024-12-18T15:13:49.522Z","updated_at":"2024-12-18T15:13:49.948Z","avatar_url":"https://github.com/CodeDotJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/CodeDotJS/youtube-playlist/master/media/logo.png\" width=\"340\"\u003e\n\u003cbr\u003e\n  \u003ca href=\"https://travis-ci.org/CodeDotJS/youtube-playlist\"\u003e\n  \u003cimg src=\"https://travis-ci.org/CodeDotJS/youtube-playlist.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/CodeDotJS/youtube-playlist/master/media/mid.png\" width=\"50px;\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/code_style-XO-5ed9c7.svg\"\u003e\n  \u003cbr\u003e\n  \u003cp align=\"center\"\u003eExtract links, ids, durations and names from a youtube playlist\u003c/p\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\n## Install\n\n```\n$ npm install --save youtube-playlist\n```\n\n## Usage\n\n- __`urls`__\n\n```js\nconst ytlist = require('youtube-playlist');\n\nconst url = 'https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704';\n\nytlist(url, 'url').then(res =\u003e {\n  console.log(res);\n  /* Object\n  { data:\n   { playlist:\n      [ 'https://youtube.com/watch?v=bgU7FeiWKzc',\n        'https://youtube.com/watch?v=3PUVr8jFMGg',\n        'https://youtube.com/watch?v=3pXVHRT-amw',\n        'https://youtube.com/watch?v=KOVc5o5kURE' ] } }\n   */\n});\n\n// or\n\nytlist(url, 'url').then(res =\u003e {\n  console.log(res.data.playlist);\n  /* Array\n  [ 'https://youtube.com/watch?v=bgU7FeiWKzc',\n  'https://youtube.com/watch?v=3PUVr8jFMGg',\n  'https://youtube.com/watch?v=3pXVHRT-amw',\n  'https://youtube.com/watch?v=KOVc5o5kURE' ]\n   */\n});\n```\n\n- __`names`__\n\n```js\nytlist(url, 'name').then(res =\u003e {\n  console.log(res);\n  /*\n  { data:\n   { playlist:\n      [ 'Singleton Design Pattern - Beau teaches JavaScript',\n        'Observer Design Pattern - Beau teaches JavaScript',\n        'Module Design Pattern - Beau teaches JavaScript',\n        'Mediator Design Pattern - Beau teaches JavaScript' ] } }\n   */\n});\n```\n\n- __`ids`__\n\n```js\nytlist(url, 'id').then(res =\u003e {\n  console.log(res);\n  // =\u003e { data: { playlist: [ 'bgU7FeiWKzc', '3PUVr8jFMGg', '3pXVHRT-amw', 'KOVc5o5kURE' ] } }\n})\n```\n\n- __`durations`__\n\n```js\nytlist(url, 'duration').then(res =\u003e {\n  console.log(res);\n  // =\u003e { data: { playlist: [ 291, 237, 164, 309 ] } }\n})\n```\n\n- __`multiple details`__\n\n```js\nytlist(url).then(res =\u003e {\n  console.log(res.data);\n  // = [{}]\n});\n\n// or\n\nytlist(url, ['id', 'name', 'url']).then(res =\u003e {\n  console.log(res.data);\n  /* Array\n  [ { id: 'bgU7FeiWKzc',\n    name: 'Singleton Design Pattern - Beau teaches JavaScript',\n    url: 'https://youtube.com/watch?v=bgU7FeiWKzc',\n    isPrivate: false },\n  { id: '3PUVr8jFMGg',\n    name: 'Observer Design Pattern - Beau teaches JavaScript',\n    url: 'https://youtube.com/watch?v=3PUVr8jFMGg',\n    isPrivate: false },\n  { id: '3pXVHRT-amw',\n    name: 'Module Design Pattern - Beau teaches JavaScript',\n    url: 'https://youtube.com/watch?v=3pXVHRT-amw',\n    isPrivate: false },\n  { id: 'KOVc5o5kURE',\n    name: 'Mediator Design Pattern - Beau teaches JavaScript',\n    url: 'https://youtube.com/watch?v=KOVc5o5kURE',\n    isPrivate: false } ]\n   */\n});\n```\n\n__Notice__: In `multiple details` - another prop will be added. `isPrivate` will be true when the video is private (for not loggedin user).\n\n## API\n\n```js\nytlist(url, opts)\n```\n#### `opts`\n\n- __`id`__ `:` `returns only ids of all the videos present in a playlist`\n- __`url`__ `:` `returns only urls of all the videos present in a playlist`\n- __`name`__ `:` `return only name of the videos present in a playlist`\n- __`duration`__ `:` `return only duration (in seconds) of the videos present in a playlist`\n\n- Passing `opts` either as __`url`__ or an array of options __`['id', 'name', 'url', 'duration']`__ returns all the details.\n\n__Type of__\n\n- __`url`__ `:` __`string`__\n\n- __`opts`__ `:` __`string`__ or __`array`__\n\n\n#### NOTE\n\n- This `api` already supports `url-redirection`, so you are free to use the shortened url.\n\n- For data extraction, you can either choose -\n\t- __`playlist url`__\n\t- __`url of the content from playlist`__ __[`#1`](https://github.com/CodeDotJS/youtube-playlist/issues/1)__\n\n\n## Related\n\n- __[`Pufetch`](https://github.com/CodeDotJS/pufetch)__ `:` `The best youtube playlist url scrapper and exporter!`\n\n## License\n\nMIT \u0026copy; [Rishi Giri](http://rishigiri.ml)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedotjs%2Fyoutube-playlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodedotjs%2Fyoutube-playlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedotjs%2Fyoutube-playlist/lists"}