masterT / bandcamp-scraper

A scraper for https://bandcamp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getAlbumInfo breaks

chaos87 opened this issue · comments

Hi there,

The same error is returned no matter which album url I'm passing.

SyntaxError: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""
at error (.../node_modules/json5/lib/json5.js:56:25)
at word (.../node_modules/json5/lib/json5.js:393:13)
at value (.../node_modules/json5/lib/json5.js:493:56)
at Object.parse (.../node_modules/json5/lib/json5.js:508:18)
at Object.exports.parseAlbumInfo (.../node_modules/bandcamp-scraper/lib/htmlParser.js:281:24)
at .../node_modules/bandcamp-scraper/lib/index.js:51:34
at Function. (.../node_modules/tinyreq/lib/index.js:58:9)
at res (.../node_modules/assured/lib/index.js:27:12)
at IncomingMessage. (.../node_modules/tinyreq/lib/index.js:101:13)
at IncomingMessage.emit (events.js:327:22) {
at: 1,
lineNumber: 1,
columnNumber: 2
}
Validation error on album info: data should have required property 'raw' {
tags: [
{ name: 'pop' },
{ name: 'amour' },
{ name: 'coeur de pirate' },
{ name: 'french' },
{ name: 'french pop' },
{ name: 'grosse boîte' },
{ name: 'montreal' },
{ name: 'piano pop' },
{ name: 'Montréal' }
],
artist: 'Cœur de pirate',
title: 'Blonde',
imageUrl: 'https://f4.bcbits.com/img/a1328452291_2.jpg',
tracks: [
{
name: 'Lève les voiles',
url: 'http://musique.coeurdepirate.com/track/l-ve-les-voiles',
duration: '01:12'
},
{
name: 'Adieu',
url: 'http://musique.coeurdepirate.com/track/adieu',
duration: '02:27'
},
{
name: 'Danse et danse',
url: 'http://musique.coeurdepirate.com/track/danse-et-danse',
duration: '03:10'
},
{
name: 'Golden Baby',
url: 'http://musique.coeurdepirate.com/track/golden-baby',
duration: '03:07'
},
{
name: 'Ava',
url: 'http://musique.coeurdepirate.com/track/ava',
duration: '03:16'
},
{
name: "Loin d'ici",
url: 'http://musique.coeurdepirate.com/track/loin-dici',
duration: '02:43'
},
{
name: 'Les amours dévouées',
url: 'http://musique.coeurdepirate.com/track/les-amours-d-vou-es',
duration: '02:27'
},
{
name: 'Place de la République',
url: 'http://musique.coeurdepirate.com/track/place-de-la-r-publique',
duration: '04:11'
},
{
name: 'Cap Diamant',
url: 'http://musique.coeurdepirate.com/track/cap-diamant',
duration: '02:43'
},
{
name: 'Verseau',
url: 'http://musique.coeurdepirate.com/track/verseau',
duration: '03:53'
},
{
name: 'Saint-Laurent',
url: 'http://musique.coeurdepirate.com/track/saint-laurent',
duration: '03:14'
},
{
name: 'La petite mort',
url: 'http://musique.coeurdepirate.com/track/la-petite-mort',
duration: '03:49'
}
],
url: 'http://musique.coeurdepirate.com/album/blonde'
}
null

Looks like bandcamp changed the variable name in their javascript.
Previously it should have been TralbumData but now it is "data-tralbum"

This is fixed in version 1.2.7.

Awesome thanks!