Created
May 2, 2024 00:08
-
-
Save SEAPUNK/e97e8e8021ecc8180691f94c42f3b9fa to your computer and use it in GitHub Desktop.
streamlink angelthump plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| $description for the doctors | |
| $url angelthump.com | |
| $type live | |
| """ | |
| import logging | |
| import re | |
| from streamlink.plugin import Plugin, pluginmatcher | |
| from streamlink.plugin.api import validate | |
| from streamlink.stream.hls import HLSStream | |
| log = logging.getLogger(__name__) | |
| @pluginmatcher(re.compile( | |
| r"https?://angelthump\.com/(?P<channel>[^/&?]+)", | |
| )) | |
| class Angelthump(Plugin): | |
| def _get_streams(self): | |
| channel = self.match.group("channel") | |
| self.session.http.headers.update({"Identifier": "SwnpX0RnA99YdRj0SPqs", "Referer": self.url}) | |
| data = self.session.http.post( | |
| f"https://vigor.angelthump.com/{channel}/token", | |
| data={"patreon": False}, | |
| schema=validate.Schema( | |
| validate.parse_json(), | |
| { | |
| "token": str, | |
| "expiresIn": int | |
| } | |
| ), | |
| acceptable_status=(200,)) | |
| log.trace(f"{data!r}") | |
| token = data.get('token') | |
| return HLSStream.parse_variant_playlist(self.session, f"https://vigor.angelthump.com/hls/{channel}.m3u8?token={token}") | |
| __plugin__ = Angelthump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment