V3.5: Fix extract 500 error - skip empty URLs and install yt-dlp in Docker
This commit is contained in:
parent
d6ea3bb076
commit
9701497475
2 changed files with 10 additions and 3 deletions
|
|
@ -23,8 +23,9 @@ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o server cm
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install runtime dependencies (sqlite)
|
# Install runtime dependencies (sqlite + yt-dlp for video extraction fallback)
|
||||||
RUN apk add --no-cache sqlite ca-certificates tzdata
|
RUN apk add --no-cache sqlite ca-certificates tzdata python3 py3-pip && \
|
||||||
|
pip3 install --break-system-packages yt-dlp
|
||||||
|
|
||||||
# Copy backend binary
|
# Copy backend binary
|
||||||
COPY --from=backend-builder /app/backend/server .
|
COPY --from=backend-builder /app/backend/server .
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,13 @@ export const useWatchMovie = (slug: string | undefined, episode: string | undefi
|
||||||
try {
|
try {
|
||||||
const ep = movie.episodes?.find(e => e.number === currentEpisode);
|
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({
|
setSource({
|
||||||
stream_url: ep.url,
|
stream_url: ep.url,
|
||||||
resolution: 'HD',
|
resolution: 'HD',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue