misc.woflram: don't fail if can't grab image
This commit is contained in:
parent
cfa87eb297
commit
76ee7a789b
1 changed files with 9 additions and 3 deletions
|
@ -124,9 +124,15 @@ wolfram.callback = async function (msg, line) {
|
||||||
let image;
|
let image;
|
||||||
|
|
||||||
if (data[1].subpods[0].img.src)
|
if (data[1].subpods[0].img.src)
|
||||||
image = Buffer.from(
|
try {
|
||||||
await fetch(data[1].subpods[0].img.src).then((x) => x.arrayBuffer())
|
const res = await fetch(data[1].subpods[0].img.src);
|
||||||
);
|
if (res) {
|
||||||
|
const imgData = await res.arrayBuffer();
|
||||||
|
image = Buffer.from(imgData);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
let string = "";
|
let string = "";
|
||||||
if (data[1].subpods[0].plaintext.length > 0)
|
if (data[1].subpods[0].plaintext.length > 0)
|
||||||
|
|
Loading…
Reference in a new issue