Fix eporner formats serving a decoy clip instead of the real video
Root cause found live: eporner's CDN mp4 URLs enforce a Referer check
independent of the hash/xhr resolution — a request with no Referer or
one pointing at eporner.com gets the real file, but any other Referer
gets a 302 to a static .../na.mp4 ("not available") decoy. Since our
VideoFormat entries declared no http_headers at all, playback fell
through to whatever default Referer the client happened to send,
occasionally tripping this check and showing the short "this video is
only available at eporner.com" clip.
Verified against a live video: fetching a resolved format URL with an
unrelated Referer reproduces the exact na.mp4 redirect; with the
correct Referer it serves the full file. Each format now explicitly
declares Referer: https://www.eporner.com/ so client-side defaults
can't trip the check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QTqf6orbHZ9rFFpVpcgzcR
This commit is contained in:
@@ -501,6 +501,15 @@ impl EpornerProvider {
|
||||
/// Without this, the client is left to open the bare page URL, which
|
||||
/// eporner serves as a small restricted/preview clip rather than the
|
||||
/// full video.
|
||||
///
|
||||
/// The resolved CDN mp4 URLs also enforce a Referer check independent of
|
||||
/// the hash/xhr dance above: a request whose Referer is absent or points
|
||||
/// at eporner.com is served the real file, but any other non-empty
|
||||
/// Referer gets a 302 to a static `.../na.mp4` ("not available") decoy
|
||||
/// clip — the exact "this video is only available at eporner.com"-style
|
||||
/// clip users see when playback doesn't carry the header the CDN wants.
|
||||
/// Each format therefore declares an explicit `Referer` so the client's
|
||||
/// own default (or lack thereof) can't accidentally trip this check.
|
||||
async fn resolve_formats(
|
||||
requester: &mut Requester,
|
||||
alnum_id: &str,
|
||||
@@ -540,7 +549,8 @@ impl EpornerProvider {
|
||||
let format = VideoFormat::new(src.to_string(), label.to_string(), "mp4".to_string())
|
||||
.format_id(key.clone())
|
||||
.format_note(key.clone())
|
||||
.height(height);
|
||||
.height(height)
|
||||
.http_header("Referer".to_string(), format!("{BASE_URL}/"));
|
||||
ranked.push((height, format));
|
||||
}
|
||||
if ranked.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user