New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

youtube-restriction

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youtube-restriction

Javascript wrapper to check if a YouTube video it's blocked somewhere around the world

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Let's check if your favorite YouTube videos are blocked in your country or someone else's country. This module uses the official Google API v3.

Download

npm install youtube-restriction

Usage

First, do a constructor with your API key. If you don't have API key, check this tutorial.

var restrictionHelper = require("youtube-restriction"); 
var youtubeRestriction = new restrictionHelper("apikey");

Functions

Those functions work with current available videos. It will return error if input it's a deleted video, private video or copyrighted video.

.checkFor(videoURL) Check if a YouTube video it's blocked for some countries, worldwide or not blocked. If the video it's blocked somewhere, it will return an array list with the countries affected. Otherwise it will return that the video it's available worldwide.

youtubeRestriction.checkFor('https://www.youtube.com/watch?v=fzQ6gRAEoy0').then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});

.checkForSpecificCountry(videoURL, countryname) Check if a YouTube video it's blocked for the country you specify. If the video it's blocked there, it will return a true bool. Otherwise it will return a false bool. If the video is not blocked, it will return null. Make sure you specify the country name in English.

youtubeRestriction.checkForSpecificCountry('https://www.youtube.com/watch?v=fzQ6gRAEoy0', 'Japan').then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});

License

MIT, check LICENSE file.

Keywords

FAQs

Package last updated on 16 Mar 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc