Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from streamlink.plugin import Plugin
- from streamlink.stream import HLSStream
- from streamlink.plugin.api import useragents
- class M3(Plugin):
- url_re = re.compile(r'https?://archivum.mtva.hu/m3')
- @classmethod
- def can_handle_url(cls, url):
- return cls.url_re.match(url) is not None
- def _get_streams(self):
- headers = {"User-Agent": useragents.CHROME,
- "Referer": "https://archivum.mtva.hu/m3",
- }
- body = self.session.http.get('https://archivum.mtva.hu/api/m3/v3/stream?target=live', headers=headers).text
- mrl = None
- match = re.search(r'url":"(.*?)\"', body)
- if match:
- mrl = match.group(1).replace('\/','/').replace("HLS.smil","nodrm.smil")
- if mrl:
- return HLSStream.parse_variant_playlist(self.session, mrl, headers=headers)
- __plugin__ = M3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement