Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
yt-trending-scraper
Advanced tools
Identifies the currently trending videos on YouTube and returns all trending site information about every video without accessing the YouTube API.
Weekly downloads
Readme
This NodeJS library can scrape all available trending pages of YouTube without any API usage. It is developed for and tailored towards easy usage in the FreeTube rewrite but can be used with any other project as well.
Therefore, this library does not require any API keys, with the attached maximum quotas, but instead might take longer to receive the required data.
The library works as long as YouTube keeps its web page layout the same. Therefore, there is no guarantee that this library will work at all times. If this library should not work at some point, please create an issue and let me know so that I can take a look into it. Pull requests are also welcomed in this case.
npm install yt-trending-scraper
const ytrend = require("yt-trending-scraper")
scrape_trending_page(parameters) Returns a list of objects containing all the information of the trending videos.
The parameters object can contain the following options:
geoLocation: String,
parseCreatorOnRise: Boolean,
page: String
geoLocation is an optional parameter to change the country (e.g. JP for Japan) of the trending page. The alpha2 code of the country must be used
parseCreatorOnRise is an optional parameter which allows the parser to process any horizontal video list, which usually is a creator on the rise. But this is not always available, so the scraper will process as usual even when the parameter is set to true. Defaults to false
page is an optional parameter which allows to choose one of the 4 trending pages below.
default
music
gaming
movies
const parameters = {
geoLocation: 'JP',
parseCreatorOnRise: false,
page: 'music'
}
ytrend.scrape_trending_page(parameters).then((data) =>{
console.log(data);
}).catch((error)=>{
console.log(error);
});
// The data is a list of objects containing the following attributes:
{
videoId: String,
title: String,
type: "video",
author: String,
authorId: String,
authorUrl: String,
videoThumbnails: Array[Objects],
description: String,
viewCount: Number,
published: Number as timestamp,
publishedText: String,
lengthSeconds: Number,
timeText: String,
liveNow: false,
paid: false,
premium: false,
isUpcoming: false,
isCreatorOnRise: Boolean, // indicates whether the video is part of a creator on the rise
isVerified: Boolean,
}
// The thumbnail objects:
{
quality: "String",
url: "String",
width: Number,
height: Number
}
Thanks to PrestoN for the basic instructions and underlying request code and thanks to ~cadence for the HTML extractor RegEx.
FAQs
Identifies the currently trending videos on YouTube and returns all trending site information about every video without accessing the YouTube API.
The npm package yt-trending-scraper receives a total of 2 weekly downloads. As such, yt-trending-scraper popularity was classified as not popular.
We found that yt-trending-scraper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.