Merge pull request #925 from omnivore-app/fix/scrapingbee-url

Create a scrapingbee url when using the fallback
This commit is contained in:
Jackson Harper 2022-07-05 09:03:13 -07:00 committed by GitHub
commit 6b1f21398e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,18 +358,18 @@ async function fetchContent(req, res) {
// fallback to scrapingbee
const sbResult = await fetchContentWithScrapingBee(url);
const url = finalUrl || sbResult.url;
const sbUrl = finalUrl || sbResult.url;
const content = sbResult.domContent;
logRecord.fetchContentTime = Date.now() - functionStartTime;
const apiResponse = await sendCreateArticleMutation(userId, {
url,
url: sbUrl,
articleSavingRequestId,
preparedDocument: {
document: content,
pageInfo: {
title: sbResult.title,
canonicalUrl: url,
canonicalUrl: sbUrl,
},
},
skipParsing: !content,