This commit is contained in:
2026-01-04 23:05:47 +01:00
parent a5f30a65e6
commit 9910bd202a
34 changed files with 51442 additions and 7 deletions

View File

@@ -1,15 +1,15 @@
{
"translatorID": "660fcf3e-3414-41b8-97a5-e672fc2e491d",
"translatorType": 4,
"label": "EBSCO Discovery Layer",
"creator": "Sebastian Karcher",
"target": "^https?://(discovery|research)\\.ebsco\\.com/",
"minVersion": "5.0",
"maxVersion": "",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2024-02-04 04:24:48"
"lastUpdated": "2025-12-22 18:15:00"
}
/*
@@ -117,9 +117,20 @@ async function scrape(doc, url = doc.location.href) {
let risURL = `/linkprocessor/v2-ris?recordId=${recordId}&opid=${opid}&lang=en`;
// Z.debug(risURL)
// this won't work always
let pdfURL = `/linkprocessor/v2-pdf?recordId=${recordId}&sourceRecordId=${recordId}&profileIdentifier=${opid}&intent=download&lang=en`;
let pdfURL;
try {
let [{ result }] = await requestJSON(`/api/viewer/v6/htmlfulltext/${recordId}?opid=${opid}`);
let { links } = result;
Z.debug('Links:');
Z.debug(links);
let downloadLink = links['v2-downloadLinks']?.find(link => link.type === 'pdf');
if (!downloadLink) downloadLink = links.downloadLinks.find(link => link.type === 'pdf');
pdfURL = downloadLink.url;
}
catch (e) {
Zotero.debug('Error while locating PDF download link: ' + e);
pdfURL = `/linkprocessor/v2-pdf?recordId=${recordId}&sourceRecordId=${recordId}&profileIdentifier=${opid}&intent=download&lang=en`
}
let risText = await requestText(risURL);
// Z.debug(risText)
@@ -143,5 +154,6 @@ async function scrape(doc, url = doc.location.href) {
}
/** BEGIN TEST CASES **/
var testCases = [
]
/** END TEST CASES **/