Skip to content

Instantly share code, notes, and snippets.

@SEAPUNK
Created May 2, 2024 00:08
Show Gist options
  • Select an option

  • Save SEAPUNK/e97e8e8021ecc8180691f94c42f3b9fa to your computer and use it in GitHub Desktop.

Select an option

Save SEAPUNK/e97e8e8021ecc8180691f94c42f3b9fa to your computer and use it in GitHub Desktop.
streamlink angelthump plugin
"""
$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