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

bandcamp-fetch

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bandcamp-fetch - npm Package Compare versions

Comparing version 0.2.1-b.20211020 to 0.2.1-b.20211020b

32

lib/index.js

@@ -185,4 +185,16 @@ const fetch = require('node-fetch');

const _isInfoComplete = (data) => {
return data.name !== '' && (data.type === 'label' || data.label !== null);
return data.name !== null && data.url !== null &&
(data.type === 'label' || data.label !== null);
}
const _fillInfo = (toData, fromData) => {
if (toData.name === null) {
toData.name = fromData.name;
}
if (toData.url === null) {
toData.url = fromData.url;
}
if (toData.label === null) {
toData.label = fromData.label;
}
}

@@ -201,8 +213,3 @@ let url = _getUrl();

let info = parser.parseArtistOrLabelInfo(html, opts);
if (result.name === '') {
result.name = info.name;
}
if (result.label === null) {
result.label = info.label;
}
_fillInfo(result, info);
// Return if result is complete

@@ -220,10 +227,9 @@ if (_isInfoComplete(result)) {

info = parser.parseArtistOrLabelInfo(html, opts);
if (result.name === '') {
result.name = info.name;
}
if (result.label === null) {
result.label = info.label;
}
_fillInfo(result, info);
}
if (result.url === null) {
result.url = artistOrLabelUrl;
}
return result;

@@ -230,0 +236,0 @@ }

@@ -460,6 +460,6 @@ const cheerio = require('cheerio');

type: isLabel ? 'label' : 'artist',
name: bandData.name,
url: bandData.url,
name: bandData.name || null,
url: bandData.url || null,
description: description,
location: $('#band-name-location').find('.location').text(),
location: $('#band-name-location').find('.location').text() || '',
imageUrl: utils.reformatImageUrl($('img.band-photo').attr('src'), opts.imageFormat)

@@ -466,0 +466,0 @@ };

{
"name": "bandcamp-fetch",
"version": "0.2.1-b.20211020",
"version": "0.2.1-b.20211020b",
"description": "JS library for scraping Bandcamp content",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -345,2 +345,5 @@ # bandcamp-fetch

0.2.1-b.20211020b
- Fix URL sometimes null in result of `getArtistOrLabelInfo()`
0.2.1-b.20211020

@@ -347,0 +350,0 @@ - Improve data fetching in `getArtistOrLabelInfo()`

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