Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simpleyt

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpleyt - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

package.json

@@ -20,6 +20,6 @@ {

"description": "Simple youtube search library without need of an api key",
"version": "1.0.2",
"version": "1.0.3",
"dependencies": {
"node-fetch": "^2.6.0"
"miniget": "^2.0.1"
}
}

@@ -15,4 +15,5 @@ # simpleyt

filter: 'video', // Filter only videos
localAddress: '2001:470:1234:5678::a'
// Other parameters are passed to node-fetch
localAddress: '2001:470:1234:5678::a',
family: 6
// Other parameters are passed to miniget
}).then(console.log)

@@ -19,0 +20,0 @@ ```

@@ -1,9 +0,7 @@

const fetch = require('node-fetch')
const miniget = require('miniget')
module.exports = async (query, options = {}) => {
const requestOptions = options ? JSON.parse(JSON.stringify(options)) : null
requestOptions['filter'] = undefined
const response = await (await fetch(
'https://www.youtube.com/results?search_query=' + encodeURIComponent(query), requestOptions
)).text()
const response = await miniget(
'https://www.youtube.com/results?search_query=' + encodeURIComponent(query), options
).text()
const line = response.match(/window\["ytInitialData"]\s*=\s*(.*);+\n/)[0]

@@ -10,0 +8,0 @@ const json = JSON.parse(line.substring(line.indexOf('{'), line.length - 2))

Sorry, the diff of this file is not supported yet

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