Skip to content
This repository was archived by the owner on May 2, 2026. It is now read-only.

fix: animepahe unable to stream/download#174

Merged
Benexl merged 1 commit intomasterfrom
minor-fixes
Dec 28, 2025
Merged

fix: animepahe unable to stream/download#174
Benexl merged 1 commit intomasterfrom
minor-fixes

Conversation

@Type-Delta
Copy link
Copy Markdown
Collaborator

fix #172

Copilot AI review requested due to automatic review settings December 28, 2025 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #172 where the AnimePahe provider was unable to stream or download anime. The fix adds proper HTTP headers required by the CDN provider to successfully stream content.

Key Changes:

  • Extracts the actual stream host from the stream URL and uses it in the Host header
  • Adds comprehensive STREAM_HEADERS with CORS-compliant headers (Origin, Referer, etc.)
  • Passes custom headers to the Server object so they're used during download/streaming

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
viu_media/libs/provider/anime/animepahe/provider.py Adds logic to extract stream hostname from URLs and constructs custom headers combining User-Agent, dynamic Host, and STREAM_HEADERS for streaming
viu_media/libs/provider/anime/animepahe/mappers.py Updates map_to_server function signature to accept and pass headers to the Server object
viu_media/libs/provider/anime/animepahe/constants.py Defines new CDN provider constants and STREAM_HEADERS with CORS-compliant headers for successful streaming
viu_media/core/downloader/yt_dlp.py Adds debug logging to show the URL and headers being used during download for troubleshooting

"DNT": "1",
"Connection": "keep-alive",
"Referer": "https://animepahe.si/",
"Referer": ANIMEPAHE_BASE + '/',
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string concatenation pattern using + operator is inconsistent with the f-string style used elsewhere in this file. Consider using f-strings for consistency: "Referer": f"{ANIMEPAHE_BASE}/"

Copilot uses AI. Check for mistakes.
"Origin": CDN_PROVIDER_BASE,
"Sec-GPC": "1",
"Connection": "keep-alive",
"Referer": CDN_PROVIDER_BASE + '/',
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string concatenation pattern using + operator is inconsistent with the f-string style used elsewhere in this file. Consider using f-strings for consistency: "Referer": f"{CDN_PROVIDER_BASE}/"

Suggested change
"Referer": CDN_PROVIDER_BASE + '/',
"Referer": f"{CDN_PROVIDER_BASE}/",

Copilot uses AI. Check for mistakes.
@Benexl
Copy link
Copy Markdown
Collaborator

Benexl commented Dec 28, 2025

it works great

@Benexl Benexl merged commit 42f7e1d into master Dec 28, 2025
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

animepahe cant download or stream

3 participants