feat: fallback to unsplash cover when article contains no image
This commit is contained in:
@@ -9,7 +9,7 @@ export async function fetchHtmlWithPlaywright(
|
||||
fetchUrl: string,
|
||||
streamResponse: ReturnType<typeof createStreamResponse>,
|
||||
): Promise<string> {
|
||||
streamResponse.enqueue("booting up playwright");
|
||||
streamResponse.info("booting up playwright");
|
||||
|
||||
const config: Parameters<typeof firefox.launch>[0] = {};
|
||||
if (env.PROXY_SERVER) {
|
||||
@@ -24,7 +24,7 @@ export async function fetchHtmlWithPlaywright(
|
||||
// Launch the Playwright browser
|
||||
const browser = await firefox.launch(config);
|
||||
|
||||
streamResponse.enqueue("fetching html");
|
||||
streamResponse.info("fetching html");
|
||||
|
||||
try {
|
||||
// Open a new browser context and page
|
||||
@@ -42,7 +42,7 @@ export async function fetchHtmlWithPlaywright(
|
||||
|
||||
return html;
|
||||
} catch (error) {
|
||||
streamResponse.enqueue("error fetching html");
|
||||
streamResponse.error("error fetching html");
|
||||
console.error(error);
|
||||
return "";
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user