Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
img https (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuweiyou authored Aug 18, 2023
1 parent 7e26e26 commit d09d037
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:18-alpine

RUN apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo Asia/Shanghai > /etc/timezone \
&& apk del tzdata \

RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .

CMD ["npm", "start"]
File renamed without changes.
20 changes: 0 additions & 20 deletions dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion headless.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function headless({cookie, timeout = 1000 * 60, headless = 'new', p
)

const image = text.match(/<img src="(.*?)"/)
return {text, image: image ? image[1].replace('=style/wm_ai', '') : null}
return {text, image: image ? image[1].replace('=style/wm_ai', '').replace('http://', 'https://') : null}
} finally {
browser?.close()
}
Expand Down

0 comments on commit d09d037

Please sign in to comment.