Writing media associations to disk for debugging.
This commit is contained in:
parent
7cf47cbf8d
commit
22864105ac
|
@ -846,6 +846,7 @@ async function associateReleaseMedia(releases, type = 'release') {
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(associations);
|
console.log(associations);
|
||||||
|
await fs.promises.writeFile(`./associations-${Date.now()}`, JSON.stringify(associations, null, 4));
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -489,7 +489,7 @@ async function scrapeMovie({ query, el }, url, entity, baseRelease, options) {
|
||||||
|
|
||||||
const { dataLayer } = query.exec('//script[contains(text(), "dataLayer")]', ['dataLayer']);
|
const { dataLayer } = query.exec('//script[contains(text(), "dataLayer")]', ['dataLayer']);
|
||||||
const rawData = dataLayer?.[0]?.dvdDetails;
|
const rawData = dataLayer?.[0]?.dvdDetails;
|
||||||
const data = rawData.dvdId && rawData; // dvdDetails is mostly empty in some cache states
|
const data = rawData?.dvdId && rawData; // dvdDetails is mostly empty in some cache states
|
||||||
|
|
||||||
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
|
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue