mirror of
https://github.com/imputnet/cobalt.git
synced 2026-10-25 19:42:24 +00:00
Merge 4355a7a4fa into a636575b09
This commit is contained in:
commit
d32eb63806
2 changed files with 24 additions and 8 deletions
22
Dockerfile
22
Dockerfile
|
|
@ -1,26 +1,40 @@
|
|||
FROM node:24-alpine AS base
|
||||
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
FROM base AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
|
||||
RUN corepack enable
|
||||
RUN apk add --no-cache python3 alpine-sdk
|
||||
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --prod --frozen-lockfile
|
||||
RUN pnpm install --prod --frozen-lockfile
|
||||
|
||||
RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
|
||||
|
||||
FROM base AS api
|
||||
|
||||
ARG RAILWAY_GIT_COMMIT_SHA=unknown
|
||||
ARG RAILWAY_GIT_BRANCH=fix-instagram
|
||||
ARG RAILWAY_GIT_REPO_OWNER=unknown
|
||||
ARG RAILWAY_GIT_REPO_NAME=cobalt
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build --chown=node:node /prod/api /app
|
||||
COPY --from=build --chown=node:node /app/.git /app/.git
|
||||
|
||||
RUN mkdir -p /app/.git/logs /app/.git/refs/heads \
|
||||
&& printf 'ref: refs/heads/%s\n' "$RAILWAY_GIT_BRANCH" > /app/.git/HEAD \
|
||||
&& printf '0000000000000000000000000000000000000000 %s railway <railway@local> 0 +0000\tbuild\n' "$RAILWAY_GIT_COMMIT_SHA" > /app/.git/logs/HEAD \
|
||||
&& printf '[remote "origin"]\n\turl = https://github.com/%s/%s.git\n' "$RAILWAY_GIT_REPO_OWNER" "$RAILWAY_GIT_REPO_NAME" > /app/.git/config \
|
||||
&& chown -R node:node /app/.git
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 9000
|
||||
CMD [ "node", "src/cobalt" ]
|
||||
|
||||
CMD ["node", "src/cobalt"]
|
||||
|
|
|
|||
|
|
@ -305,6 +305,8 @@ export default function instagram(obj) {
|
|||
if (sidecar) {
|
||||
const picker = sidecar.edges.filter(e => e.node?.display_url)
|
||||
.map((e, i) => {
|
||||
// if extracted from HTML embed, the first GraphVideo node from a "multipost" post sometimes
|
||||
// reports `is_video` without a `video_url`. this also breaks the official Instagram "multipost" embed.
|
||||
const type = e.node?.is_video && e.node?.video_url ? "video" : "photo";
|
||||
|
||||
let url;
|
||||
|
|
@ -436,13 +438,13 @@ export default function instagram(obj) {
|
|||
if (media_id && !hasData(data)) data = await requestMobileApi(media_id);
|
||||
if (media_id && cookie && !hasData(data)) data = await requestMobileApi(media_id, { cookie });
|
||||
|
||||
// html embed (no cookie, cookie)
|
||||
if (!hasData(data)) data = await requestHTML(id);
|
||||
if (!hasData(data) && cookie) data = await requestHTML(id, cookie);
|
||||
|
||||
// web app graphql api (no cookie, cookie)
|
||||
if (!hasData(data)) data = await requestGQL(id);
|
||||
if (!hasData(data) && cookie) data = await requestGQL(id, cookie);
|
||||
|
||||
// html embed (no cookie, cookie)
|
||||
if (!hasData(data)) data = await requestHTML(id);
|
||||
if (!hasData(data) && cookie) data = await requestHTML(id, cookie);
|
||||
} catch {}
|
||||
|
||||
if (!hasData(data)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue