{"id":15357546,"url":"https://github.com/drkain/scrape-youtube","last_synced_at":"2025-04-06T10:11:35.315Z","repository":{"id":33025206,"uuid":"150199503","full_name":"DrKain/scrape-youtube","owner":"DrKain","description":"A lightning fast package to scrape YouTube search results","archived":false,"fork":false,"pushed_at":"2024-05-31T21:35:23.000Z","size":182,"stargazers_count":120,"open_issues_count":3,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T09:09:42.865Z","etag":null,"topics":["bot","discord","maintainer-wanted","movie","nodejs","npm","playlist","scrape","search","video","youtube"],"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/DrKain.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-25T02:59:04.000Z","updated_at":"2025-03-28T02:47:39.000Z","dependencies_parsed_at":"2024-05-03T05:46:37.272Z","dependency_job_id":"5f138607-0367-403c-bec1-116570fce388","html_url":"https://github.com/DrKain/scrape-youtube","commit_stats":{"total_commits":102,"total_committers":7,"mean_commits":"14.571428571428571","dds":"0.11764705882352944","last_synced_commit":"4a9f44190538f6c8912e557e04dc084757fc72e4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fscrape-youtube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fscrape-youtube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fscrape-youtube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fscrape-youtube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrKain","download_url":"https://codeload.github.com/DrKain/scrape-youtube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"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":["bot","discord","maintainer-wanted","movie","nodejs","npm","playlist","scrape","search","video","youtube"],"created_at":"2024-10-01T12:36:15.338Z","updated_at":"2025-04-06T10:11:35.286Z","avatar_url":"https://github.com/DrKain.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![scrape-youtube](https://raw.githubusercontent.com/DrKain/scrape-youtube/master/text-logo.png)](#)\n\n[![Version](https://img.shields.io/npm/v/scrape-youtube.svg)](https://www.npmjs.com/package/scrape-youtube)\n[![Downloads](https://img.shields.io/npm/dt/scrape-youtube)](https://www.npmjs.com/package/scrape-youtube)\n[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/DrKain/scrape-youtube/wiki)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/DrKain/scrape-youtube/graphs/commit-activity)\n[![License: MIT](https://img.shields.io/github/license/DrKain/scrape-youtube)](https://github.com/DrKain/scrape-youtube/blob/master/LICENSE)\n\n\u003e A lightning fast package to scrape YouTube search results. This was made for Discord Bots.\n\n## Install\n\n```sh\nnpm install scrape-youtube --save\n```\n\n## Example\n\n```javascript\nimport { youtube } from 'scrape-youtube';\n// const { youtube } = require('scrape-youtube');\n\nyoutube.search('Short Change Hero').then((results) =\u003e {\n    // Unless you specify a custom type you will only receive 'video' results\n    console.log(results.videos);\n});\n// or\nconst { videos } = await youtube.search('Short Change Hero');\n```\n\n## Custom Types\n\nSupported types are: `video`, `live`, `movie`, `channel`, `playlist` and `any`.\nThese types use the `sp` parameter. If you pass your own `sp` value it will overwrite the types. See the \"[custom filters](https://github.com/DrKain/scrape-youtube/wiki#custom-filters)\" section for more information.\n\n```javascript\nyoutube.search('lofi hip hop beats to relax/study to', { type: 'live' }).then((results) =\u003e {\n    console.log(results.streams);\n});\n```\n\n## Examples\n\nPlease see [the examples](https://github.com/DrKain/scrape-youtube/tree/master/examples) directory for examples on what data you will receive from each search.  \nYour IDE should have autocompletion that works with the interface files, but these are here just in case.\n\nIf you want help using this in Discord Bot, please visit the [wiki page](https://github.com/DrKain/scrape-youtube/wiki/Discord-Bot) for TS/JS examples.\n\n## Playlists\n\nPlease note that the \"videos\" listed in playlist responses will only contain 1-2 items. This is what is available from the search results.  \nIf you wish to load an entire playlist, consider using [ytdl-core](https://npmjs.com/package/ytdl-core).\n\n## Custom Filters\n\nYou can pass `{ sp: 'ABC' }` as the second parameter to use custom filters like upload date, duration, features ect.  \nYou will need to fetch the SP parameter yourself from youtube. Please see [this image](https://i.imgur.com/TdAbYaP.png) for an example.\n\n## Request Options\n\nYou can pass `{ request: { } }` as the second parameter to use a proxy, custom headers, agents ect.  \nSee [http.request](https://nodejs.org/api/http.html#http_http_request_options_callback) for more information.\n\n```ts\nconst options = {\n    type: 'video',\n    request: {\n        headers: {\n            Cookie: 'PREF=f2=8000000',\n            'Accept-Language': 'de'\n        }\n    }\n};\n\nyoutube.search('Poets of the fall', options);\n```\n\nFor example, using `Cookie: 'PREF=f2=8000000'` will enable restricted mode to filter out videos with bad language or adult themes.  \nAdditionally, `'Accept-Language': 'de'` will load YouTube in German, sometimes resulting in different titles and content responses.\n\n## Extra Info\n\nYou can use [ytdl-core](https://github.com/fent/node-ytdl-core) by [fent](https://github.com/fent) to load extra information like exact upload dates,\nfull descriptions, like/dislike ratio, video ads ect.  \nPlease see [this](https://github.com/DrKain/scrape-youtube/wiki/Extra-Info) example in the wiki to see how.\n\n## Subscriber count\n\nAs mentioned in issue [#57](https://github.com/DrKain/scrape-youtube/issues/57) some channels appear to have the subscriber count hidden. In this case the package will default to 0.\n\n## Handles\n\nChannel handles will be used if available. Some channels do not have handles, if this is the case the channel link will use the old ID, EG: `/channel/12345` vs `/@user`\nI recommend sticking to the ID as handles are unreliable.\n\n## Quick Info\n\n-   Multiple pages currently can not be loaded. This may change in the future, but currently you will be limited to 20 results.\n-   This package will only make **1** request per search, even when using `any` types.\n-   If this package stops working, please open an issue on GitHub. I will fix it within a day.\n\n## 👤 Author\n\nThis project was made by **Kain (ksir.pw)**\nFeel free to contact me if you have any trouble with this package.\n\n-   Website: [ksir.pw](https://ksir.pw)\n-   Github: [@DrKain](https://github.com/DrKain)\n-   Discord: drkain\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\nFeel free to check [issues page](https://github.com/DrKain/scrape-youtube/issues).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2018 [Kain (ksir.pw)](https://github.com/DrKain).\nThis project is [MIT](https://github.com/DrKain/scrape-youtube/blob/master/LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkain%2Fscrape-youtube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrkain%2Fscrape-youtube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkain%2Fscrape-youtube/lists"}