-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Using the multi output version of the import, you can reference assets. If an asset is 404, it will still download the asset which will obviously be corrupted.
Input page: https://www.xeljanz.com/psa
Import code:
export default {
transform: ({
document, url, html, params,
}) => {
const main = document.body;
let path = WebImporter.FileUtils.sanitizePath(new URL(url).pathname.replace(/\.html$/, '').replace(/\/$/, ''));
const results = [{
path,
element: main,
}];
main.querySelectorAll('video').forEach((video) => {
const source = video.querySelector('source');
if (source && source.src) {
const u = new URL(source.src, url);
const newPath = WebImporter.FileUtils.sanitizePath(u.pathname);
results.push({
path: newPath,
from: u.toString(),
});
}
});
return results;
},
};
This will download some mp4 but most of them do not exist. Also the status is not up-to-date.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working