discogs-marketplace-api-nodejs 1.16.4 → 1.16.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,6 +64,10 @@ async function scrape({ currencies, genres, formats, formatDescriptions, conditi
64
64
  ].filter(([, p]) => !!p)).toString(),
65
65
  ].join('?');
66
66
  const browserPage = await browserContext.newPage();
67
+ await browserPage.setExtraHTTPHeaders({
68
+ 'User-Agent': 'Discogs',
69
+ 'Content-Type': 'application/json',
70
+ });
67
71
  const response = await browserPage.goto(urlGenerated);
68
72
  if (!response?.ok()) {
69
73
  const message = response?.headers()['content-type']?.includes('application/json')
@@ -73,7 +77,7 @@ async function scrape({ currencies, genres, formats, formatDescriptions, conditi
73
77
  throw new Error(message || `An error ${response?.status() ?? '?'} occurred.`);
74
78
  }
75
79
  const result = (await response.json());
76
- const { json: detailsResult, ...detailsResponse } = await browserPage.evaluate(async (discogsIds) => {
80
+ const { json: detailsResult, ...detailsResponse } = await browserPage.evaluate(async (discogsIds = [0]) => {
77
81
  const res = await fetch('https://www.discogs.com/graphql', {
78
82
  method: 'POST',
79
83
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discogs-marketplace-api-nodejs",
3
- "version": "1.16.4",
3
+ "version": "1.16.5",
4
4
  "description": "Another (better ?) NodeJs library to fetch data from Discogs marketplace",
5
5
  "keywords": [
6
6
  "discogs",