Last active
July 13, 2017 21:16
-
-
Save intact/3ca1e0ea0e8051d8956816ec8d1aee53 to your computer and use it in GitHub Desktop.
Arconai Tv plugin for livestreamer
This file contains 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
import re | |
from livestreamer.plugin import Plugin | |
from livestreamer.plugin.api import http | |
from livestreamer.plugin.api.utils import parse_json | |
from livestreamer.stream import HLSStream | |
_url_re = re.compile(r"https?://www\.arconaitv\.me/stream\.php\?id=\d+") | |
SOURCE_RE = re.compile(r'source +src="([^"]+)" ') | |
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36" | |
class ArconaiTv(Plugin): | |
@classmethod | |
def can_handle_url(cls, url): | |
return _url_re.match(url) | |
def _get_streams(self): | |
page = http.get(self.url) | |
match = SOURCE_RE.search(page.text) | |
if match is None or not match.group(1).endswith(".m3u8"): | |
return | |
yield "live", HLSStream(self.session, match.group(1), headers={"User-Agent": USER_AGENT, 'Referer': self.url}) | |
__plugin__ = ArconaiTv |
thanks for this cousin ++
Site has been updated, please take a look.
Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Intac
Hello Sir Intac,
You are such honorable person. It take only a couple hours.
I already got responded from you with working plugin.
Thank you very much.