Comparing version 1.0.2 to 1.0.3
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
6026
42
0
65
+ Addedminiget@^2.0.1
+ Addedminiget@2.1.0(transitive)
- Removednode-fetch@^2.6.0
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)