Package Exports
- scrape-youtube
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scrape-youtube) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
scrape-youtube
What is this?*
A lightning fast package to scrape YouTube search results. This was made and optimized for Discord Bots.
Install
npm install scrape-youtube
Require
import youtube from 'scrape-youtube';
// const youtube = require('scrape-youtube').default;
Search
youtube.search('Short Change Hero').then(results => {
console.log(results)
});
Example Response
This is the structure of a single result. The search function will return an array of up to 20 results.
{
"id": "lkvScx3Po8I",
"title": "The Heavy - Short Change Hero",
"link": "https://www.youtube.com/watch?v=lkvScx3Po8I",
"description": "... long description ...",
"thumbnail": "https://i.ytimg.com/vi/lkvScx3Po8I/hqdefault.jpg",
"channel": {
"name": "Magloire Lamine",
"link": "https://youtube.com/user/TENESANGO",
"verified": false,
"thumbnail": "https://yt3.ggpht.com/a/AATXAJz3kOe_LDvhRWpQLu1wHb5xU7HNOKvpKQnLQA=s88-c-k-c0xffffffff-no-rj-mo"
},
"views": 7960221,
"duration": 238,
"uploaded": "6 years ago"
}
Notes
- Currently additional types like playlists, live streams and movies are unsupported. These will be re-added in some time.
- You can load another page by passing
{ page: 1 }
as the second parameter.