1.0.0 • Published 4 years ago
ytscrape v1.0.0
YT Scrape
A youtube search api scraper, without the need for the tokens. Features:
Usage:
Installation:
You know how this goes, to install simply run:
npm install ytscrape --save
Searching the web:
To get started with searching for things, you must import the module:
const ytScrape = require("ytscrape");
to search, use the module like so:
ytScrape("funny cat videos", (error, videos) => {
//do something with the data
})
In the above code, error
is a regular javascript error object, or, null. Whereas videos
will allways be an array of video objects, or null.
Object layouts:
video:
{
"title": "<video title>",
"url": "https://youtube.com/watch?v=<video id>",
"id": "<video id>",
"metadata": {
"title": "<video title>",
"keywords": [
//array of keywords associated with the video
],
"description": "<video description>",
"duration": {
"hours": 0,
"minutes": 5,
"seconds": 17
},
"thumbnail": "https://i.ytimg.com/vi/<video id>/maxresdefault.jpg",
"familyFriendly": true,
"youtubeGenre": "Comedy",
"links": [
//array of video source links
]
}
}
source
Note: not all of the tags below are there for every source, they vary depending on if it is a video or audio source
{ "url": "<youtube backend source link>", "fps": "30", "size": "1280x720", "bitrate": "2184764", "quality_label": "720p" }
1.0.0
4 years ago