Skip to content

Conversation

@vinyl-umbrella
Copy link
Contributor

OPENREC.tv recently made a small change.
When fetching m3u8, it now returns 401 if "https://www.openrec.tv" is not specified in the referer.
So I avoid that error by adding a referer.

log.error("There is no video file.")

if m3u8_file is not None:
self.session.http.headers.update({"Referer": "https://www.openrec.tv/"})
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to use self.url instead, so the plugin doesn't rely on a hardcoded string literal.

And as an alternative to setting the header on the entire http session, headers={...} could be set as a keyword on the parse_variant_playlist() call.

@bastimeyer bastimeyer added plugin issue A Plugin does not work correctly PR: needs commit message fix labels Apr 16, 2023
@vinyl-umbrella
Copy link
Contributor Author

Thank you for the review and suggestions.

@bastimeyer bastimeyer merged commit e9f9089 into streamlink:master Apr 16, 2023
@bastimeyer
Copy link
Member

Thanks

@vinyl-umbrella vinyl-umbrella deleted the fix-openrectv branch April 16, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin issue A Plugin does not work correctly PR: needs commit message fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants