-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathsportal.py
More file actions
35 lines (25 loc) · 895 Bytes
/
Copy pathsportal.py
File metadata and controls
35 lines (25 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
$description Sporting channel live stream owned by Sportal, a Bulgarian sports media website.
$url sportal.bg
$type live
"""
import re
from streamlink.logger import getLogger
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.stream.hls import HLSStream
log = getLogger(__name__)
@pluginmatcher(
re.compile(r"https?://(?:www\.)?sportal\.bg/sportal_live_tv\.php"),
)
class Sportal(Plugin):
_hls_re = re.compile(r"""["'](?P<url>[^"']+\.m3u8[^"']*?)["']""")
def _get_streams(self):
res = self.session.http.get(self.url)
m = self._hls_re.search(res.text)
if not m:
return
hls_url = m.group("url")
log.debug(f"URL={hls_url}")
log.warning("SSL certificate verification is disabled.")
return HLSStream.parse_variant_playlist(self.session, hls_url, verify=False).items()
__plugin__ = Sportal