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

spotify-local-control

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotify-local-control - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

example.js

17

index.js

@@ -59,5 +59,5 @@ const https = require('https')

csrfAndOuathAndEndpoints = csrfAndOuathAndEndpoints || Promise.all([
getOauthToken(),
findPort()
])
getOauthToken(),
findPort()
])
.then(function ([oauth, port]) {

@@ -73,3 +73,2 @@ const endpoint = `https://${randomString({length: 10})}.spotilocal.com:${port}`

return csrfAndOuathAndEndpoints.then(([oauth, csrf, endpoint]) => get(endpoint + path, {

@@ -88,3 +87,3 @@ headers: {

return new Promise(function (resolve, reject) {
portscanner.findAPortInUse(4370, 4380, '127.0.0.1', function(error, port) {
portscanner.findAPortInUse(4370, 4380, '127.0.0.1', function (error, port) {
error ? reject(error) : resolve(port)

@@ -97,3 +96,3 @@ })

// null -> promise
function getCsrfToken ({endpoint: endpoint}) {
function getCsrfToken ({endpoint}) {
return get(endpoint + '/simplecsrf/token.json', {

@@ -110,3 +109,7 @@ headers: {

function getOauthToken () {
return get('https://open.spotify.com/token')
return get('https://open.spotify.com/token', {
headers: {
'User-Agent': 'spotify-local-control'
}
})
.then((res) => res.body['t'])

@@ -113,0 +116,0 @@ }

{
"name": "spotify-local-control",
"version": "1.0.1",
"version": "1.0.2",
"description": "Control a local spotify client via spotify-webhelper",
"main": "index.js",
"scripts": {
"deps": "dependency-check . && dependency-check . --extra --no-dev",
"test": "standard && npm run deps"
},
"repository": "f-mer/spotify-local-control",

@@ -7,0 +11,0 @@ "keywords": [

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