Skip to content

Update popr.ts#45

Merged
An0n-01 merged 5 commits into
cinepro-org:devfrom
userness:patch-1
May 14, 2026
Merged

Update popr.ts#45
An0n-01 merged 5 commits into
cinepro-org:devfrom
userness:patch-1

Conversation

@userness

@userness userness commented May 13, 2026

Copy link
Copy Markdown
Contributor

Credit to @EndOverdosing on vyla-entertainment

Pull Request

Description

This does @EndOverdosing's recommendation to "add an isMasterOrVod" (checkStreamType) " "Also don't detect HLS by file extension since Popr's segments use .png, check the response content for #EXTM3U instead ... And make sure Referer and Origin from stream.headers are being forwarded when proxying"

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)

Related Issues

Fixes This Discussion

Changes Made

  • If a request fails or returns an empty playlist, it is marked as invalid and excluded.
  • Because popr uses .png for HLS files, it checks for #EXTM3U instead of .m3u8
  • Forwards Referer and Origin for Proxying

Checklist

General

  • My code follows the code style of this project
  • My changes generate no new warnings or errors

Provider Checklist (if adding/modifying a provider)

  • Provider extends BaseProvider from @omss/framework
  • Provider has a unique id and descriptive name
  • Provider declares correct capabilities (movies/tv support)
  • Implements getMovieSources() and/or getTVSources() correctly
  • All streaming URLs use this.createProxyUrl() for proxying
  • Includes proper error handling with diagnostics
  • Includes appropriate headers via this.HEADERS
  • Returns standardized ProviderResult format

Testing

How Has This Been Tested?

The logic was verified by comparing the TypeScript implementation against the working JavaScript reference provided by @EndOverdosing..

Performance Impact

  • Potential performance concern (describe below)

Details:
An extra check was added, to prevent the user being returned dead links, but causes a slight increase in resolve time.

@userness userness requested a review from An0n-01 as a code owner May 13, 2026 00:55
@EndOverdosing

Copy link
Copy Markdown

Looks good. Implementation seems solid overall.

Only thing I’d point out: in checkStreamType you’re doing { ...this.HEADERS, ...headers } for the validation request, but then those headers get merged again into proxyHeaders when calling createProxyUrl. Depending on how the proxy handles headers, that could cause duplicates or conflicts.

I’d personally would use streamHeaders directly into createProxyUrl instead of merging in this.HEADERS again. The proxy really only needs stream-specific headers like Referer and Origin, not the scraper User-Agent.

@EndOverdosing EndOverdosing left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This would be slightly slower overall, so I recommend testing each source individually. It would make it easier to identify which source is failing and why. Adding more detailed debugging to each source may be tedious, but it would be more effective overall.

@userness userness left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok I added more debuggs

@An0n-01 An0n-01 changed the base branch from main to dev May 13, 2026 04:36
@An0n-01

An0n-01 commented May 13, 2026

Copy link
Copy Markdown
Member

I'll take a look at this. Thank you both

@GLlgGL

GLlgGL commented May 13, 2026

Copy link
Copy Markdown

Guys dont overthink to much. You can build the proxy manually and it will work on all devices just fine with the headers applies.

const STREMIO_PROXY = "http://127.0.0.1:11470/proxy";


function toStremioProxy(hlsUrl, referer) {
const parsed = new URL(hlsUrl);
const dParam = encodeURIComponent(parsed.protocol + "//" + parsed.host);
const hUA = encodeURIComponent("User-Agent:" + PAGE_HEADERS["User-Agent"]);
const hRef = encodeURIComponent("Referer:" + referer);
return ${STREMIO_PROXY}/d=${dParam}&h=${hUA}&h=${hRef}${parsed.pathname}${parsed.search};
}

Call

url: proxifyStream(finallink),

@An0n-01 An0n-01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good. will test it out on dev branch before merging it tho.

@An0n-01 An0n-01 merged commit a4f0c43 into cinepro-org:dev May 14, 2026
@An0n-01

An0n-01 commented May 14, 2026

Copy link
Copy Markdown
Member

thank you for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants