V3.5: Fix extract 500 error - skip empty URLs and install yt-dlp in Docker

This commit is contained in:
vndangkhoa 2026-02-16 19:35:00 +07:00
parent d6ea3bb076
commit 9701497475
2 changed files with 10 additions and 3 deletions

View file

@ -23,8 +23,9 @@ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o server cm
FROM alpine:latest
WORKDIR /app
# Install runtime dependencies (sqlite)
RUN apk add --no-cache sqlite ca-certificates tzdata
# Install runtime dependencies (sqlite + yt-dlp for video extraction fallback)
RUN apk add --no-cache sqlite ca-certificates tzdata python3 py3-pip && \
pip3 install --break-system-packages yt-dlp
# Copy backend binary
COPY --from=backend-builder /app/backend/server .

View file

@ -32,7 +32,13 @@ export const useWatchMovie = (slug: string | undefined, episode: string | undefi
try {
const ep = movie.episodes?.find(e => e.number === currentEpisode);
if (ep && (ep.url.includes('.m3u8') || ep.url.includes('index.m3u8'))) {
// If no episode or no URL, don't try to extract — let WatchPage show "Coming Soon"
if (!ep?.url) {
setLoading(false);
return;
}
if (ep.url.includes('.m3u8') || ep.url.includes('index.m3u8')) {
setSource({
stream_url: ep.url,
resolution: 'HD',