mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Create a scrapingbee url when using the fallback
Javascript hoists variables to the top of scope, so `url` here refers to the `url` variable defined lower in the block.
This commit is contained in:
parent
2231d6fc9b
commit
9554f8f6ba
1 changed files with 3 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue