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

nocopyrightsounds-api

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nocopyrightsounds-api

A webscraper for the NoCopyrightSounds website to provide an API

  • 1.1.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-83.87%
Maintainers
1
Weekly downloads
 
Created
Source

NoCopyrightSounds API

This is a webscraper designed to provide api like access to the NCS website

Features

  • List
  • Search

import

//module (reccomended)
import * as ncs from 'nocopyrightsounds-api'

//CommonJS
const ncs = require('nocopyrightsounds-api')

examples

get all songs from the first page in the music library

import * as ncs from 'nocopyrightsounds-api'

ncs
  .getMusic(/*page here*/)
  .then(songs => {
    //use the songs here
    console.log(songs)
  })
  .catch(err => {
    //error handeling here
    console.error(err)
  })

get all songs from the first page of house songs

import * as ncs from 'nocopyrightsounds-api'

ncs
  .search(
    {
      genre: 10
    } /*page here*/
  )
  .then(songs => {
    //use the songs here
    console.log(songs)
  })
  .catch(err => {
    //error handeling here
    console.error(err)
  })

download the newest song

import * as ncs from 'nocopyrightsounds-api'
import * as fs from 'fs'
import https from 'https'

ncs
  .getMusic()
  .then(async songs => {
    const newest = songs[0]
    const directUrl = newest.songUrl

    const writeStream = fs.createWriteStream(`${newest.name}.mp3`)

    https.get(directUrl, res => {
      res.pipe(writeStream)
    })
  })
  .catch(err => {
    //just simple error handeling
    console.error(err)
  })

FAQs

Package last updated on 17 Mar 2022

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