Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ok #1690

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open

ok #1690

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
4e69a11
Merge branch 'release/1.12.2' into develop
chrippa May 2, 2015
2480558
fix vaughnlive plugin #897
betagan May 10, 2015
db4faa8
Merge pull request #898 from betagan/develop
chrippa May 10, 2015
81b7d85
fixed tvcatchup.com plugin, the website layout changed and the method…
blxd May 11, 2015
ba3962e
Merge pull request #900 from blxd/bugfix/tvcatchup
chrippa May 11, 2015
6931642
plugins.twitch: Handle subdomains with dash in them, e.g. en-gb.
chrippa May 14, 2015
259d712
Meerkat plugin
bdien May 21, 2015
080c9a2
Add Beam.pro plugin.
maop May 21, 2015
a68cc78
Merge pull request #922 from bdien/develop
chrippa May 21, 2015
c51c49d
Merge pull request #920 from maop/beam-plugin
chrippa May 21, 2015
3cab262
tvcatchup now returns a variant playlist
blxd May 26, 2015
d7d36eb
tvplayer.com only works with a browser user agent
blxd May 26, 2015
a8e756c
Merge pull request #928 from blxd/bugfix/tvcatchup
chrippa May 26, 2015
46fe48b
Merge pull request #929 from blxd/bugfix/tvplayer
chrippa May 26, 2015
d4557ad
not all channels return hlsvariant playlists
blxd May 27, 2015
9b41844
Added plugin for blip.tv VOD
Top-Ranger May 29, 2015
d8a664f
Updated blip.tv plugin
Top-Ranger May 30, 2015
c89998b
get azubu live status from api
wolftankk Jun 2, 2015
cebd160
Merge pull request #942 from wolftankk/develop
chrippa Jun 2, 2015
ce9dc43
Merge pull request #936 from Top-Ranger/bliptv
chrippa Jun 2, 2015
fadb7c9
use new api get stream info
wolftankk Jun 10, 2015
081affb
fix video_player error
wolftankk Jun 10, 2015
71fecb0
plugin for Ruv - the Icelandic national television - was added
hannespetur Jun 14, 2015
ddc21a0
removed print statements and started to use quality key as audio if t…
hannespetur Jun 14, 2015
d9b5d79
the plugin added to the plugin matrix
hannespetur Jun 14, 2015
886e400
removed unused import
hannespetur Jun 14, 2015
f24b3f7
alphabetical order is hard
hannespetur Jun 14, 2015
2cabe79
removed redundant assignments of best/worst quality
hannespetur Jun 15, 2015
468b7dd
Merge remote-tracking branch 'upstream/develop' into develop
wolftankk Jun 16, 2015
d381fb4
HLS support added for the Ruv plugin
hannespetur Jun 16, 2015
afc4f7f
Ruv plugin: returning generators instead of a dict
hannespetur Jun 17, 2015
a7f3024
Merge pull request #956 from hannespetur/develop
chrippa Jun 19, 2015
9f0d72a
Add VOD/replay support for periscope.tv
livescope Jun 19, 2015
ba6aa99
Merge pull request #959 from livescope/develop
chrippa Jun 20, 2015
3b6e47b
plugins.artetv: Update json regex
intact Jun 20, 2015
48d27be
Merge pull request #961 from intact/artetv-fix
chrippa Jun 22, 2015
255f2bd
added expressen plugin
Jun 25, 2015
26d532f
added expressen plugin
Jun 25, 2015
1122e8d
update() => assign with subscript
Jun 25, 2015
4208b36
added entry for expressen
Jun 25, 2015
aa02049
Updated douyutv.com plugin
intact Jun 12, 2015
0338535
Added plugin for streamup.com
intact Jun 11, 2015
b16e646
plugins.streamupcom: Check live status
intact Jun 18, 2015
8bd9e8b
plugins.streamupcom: Update for API change
intact Jun 27, 2015
730ee0a
added support for livecoding.tv
Ell Jun 30, 2015
b8dc3e8
removed printing
Ell Jun 30, 2015
6d114db
updated plugin matrix
Ell Jun 30, 2015
ca52b03
Merge pull request #967 from wolftankk/develop
chrippa Jun 30, 2015
a4abc5e
Merge pull request #968 from chvrn/plugin
chrippa Jun 30, 2015
a639bf8
Merge pull request #970 from intact/douyutv-fix
chrippa Jun 30, 2015
efb79cb
Merge pull request #971 from intact/add-streamupcom
chrippa Jun 30, 2015
b1e23a2
Merge pull request #978 from Ell/add-livecodingtv-plugin
chrippa Jun 30, 2015
38b1b56
Support for Tour de France stream
Jul 5, 2015
f517327
add user agent header to the tvcatchup plugin
blxd Jul 6, 2015
fa7f3be
add support to afreecatv.com.tw
Jul 10, 2015
ff9dcf9
First version
WeinerRinkler Jul 21, 2015
c8cc8b0
Error fixed when streamer offline or invalid
WeinerRinkler Jul 21, 2015
efe6693
NPO token fix
boekkooi Jul 27, 2015
7ad7d7f
plugins.streamupcom: Update for API change
intact Jul 28, 2015
292312f
plugins.crunchyroll: added support for locale selection
asermax Jul 29, 2015
b53e414
Sort list of streams by quality
jtsymon Jul 30, 2015
898f73a
plugins.crunchyroll: use locale parameter on the header's user-agent …
asermax Aug 1, 2015
adc441d
Merge pull request #988 from michie1/nos-tdf
chrippa Aug 2, 2015
9005709
Merge pull request #991 from blxd/bugfix/tvcatchup
chrippa Aug 2, 2015
9a93aea
Merge pull request #995 from Summon528/patch-1
chrippa Aug 2, 2015
d66d38a
Merge pull request #1013 from boekkooi/issue-921
chrippa Aug 2, 2015
8e3f98a
Merge pull request #1007 from WeinerRinkler/develop
chrippa Aug 2, 2015
779892c
Merge pull request #1017 from intact/fix-streamupcom
chrippa Aug 2, 2015
6133d8c
Merge pull request #1018 from asermax/crunchyroll-select-locale
chrippa Aug 2, 2015
9c7fba6
cli: Close output on exit.
chrippa Aug 2, 2015
9732607
plugins.afreeca: Fix HLS stream.
Aug 2, 2015
389f090
Show a brief usage when no option is specified.
chrippa Aug 2, 2015
1f231e2
cli: Fix typo.
chrippa Aug 2, 2015
dc28c79
Avoid sorting streams twice
jtsymon Aug 3, 2015
f0832d3
Merge pull request #1019 from jtsymon/develop
chrippa Aug 3, 2015
5a9a17b
GoodGame URL parse fix
pulviscriptor Aug 10, 2015
8dd6a69
Merge pull request #1030 from pulviscriptor/develop
chrippa Aug 10, 2015
f064f83
goodgame ddos validation
Feverqwe Sep 23, 2015
52542a0
plugins.picarto: Update for API and URL change
charmander Sep 23, 2015
970dace
Update periscope.py
matiaspl Oct 15, 2015
8a56c0d
azubutv: set video_player to None if stream is offline
sulami Oct 17, 2015
49cc137
plugins.douyutv: Use new api.
steven7851 Oct 27, 2015
ebd7eea
Update issues.rst
neutric Oct 27, 2015
ad38446
plugin: added media_ccc_de api and protocol changes
meise Oct 31, 2015
05b660e
docs/plugin_matrix: removed needless characters
meise Oct 31, 2015
958a969
Maybe fixed ustream validation failure.
paulguy Nov 17, 2015
08bc232
More strict test for weird stream.
paulguy Nov 17, 2015
ffa38e4
plugins.dailymotion: Add HLS streams support
intact Nov 18, 2015
08439ce
Now catching socket errors on send
Nov 20, 2015
9036ae7
Allow https urls for nrk.no.
Nov 23, 2015
c360f99
Add antenna.gr plugin
pavlos256 Nov 24, 2015
e416532
Update plugin matrix for antenna
pavlos256 Nov 24, 2015
046305c
update the streamup.com plugin
sbstp Dec 10, 2015
e174b08
add stream_id with words
Feverqwe Dec 19, 2015
34412fc
Create servustv.py
ph0o Jan 4, 2016
c0209f3
Add new parameter to Twitch usher URL
javiercantero Jan 10, 2016
a141c5c
plugins.npo: Fix Python 3 compatibility
intact Jan 25, 2016
e7f928c
Merge pull request #1192 from intact/fix-npo
chrippa Jan 26, 2016
1748584
Merge pull request #1174 from javiercantero/twitch-spectre
chrippa Jan 26, 2016
ba3214b
Merge pull request #1077 from Feverqwe/develop
chrippa Jan 26, 2016
f0419fc
Merge pull request #1148 from sbstp/streamup
chrippa Jan 26, 2016
593b328
Merge pull request #1135 from pavlos256/new-plugin-antenna
chrippa Jan 26, 2016
62e3cda
Merge pull request #1133 from oyvindln/nrk-https
chrippa Jan 26, 2016
c80bdb4
Merge pull request #1130 from Globidev/fix-crash-on-httpserver-sigpipe
chrippa Jan 26, 2016
dc96641
Merge pull request #1129 from intact/fix-dailymotion
chrippa Jan 26, 2016
ff8173c
Merge pull request #1126 from paulguy/ustream-fix
chrippa Jan 26, 2016
b408035
Merge pull request #1116 from meise/media_ccc_de_api_change
chrippa Jan 26, 2016
6c5bf1d
Merge pull request #1115 from meise/plugin_matrix_typo
chrippa Jan 26, 2016
1cf6d17
Merge pull request #1106 from steven7851/patch-2
chrippa Jan 26, 2016
7900d11
Merge pull request #1092 from sulami/develop
chrippa Jan 26, 2016
9e81967
Merge pull request #1076 from charmander/fix-picarto
chrippa Jan 26, 2016
9fff0a6
Merge branch 'pr/1168' into develop
chrippa Jan 26, 2016
fc1416d
Merge branch 'pr/1108' into develop
chrippa Jan 26, 2016
9d59cb4
Merge branch 'pr/1089' into develop
chrippa Jan 26, 2016
99f9049
travis: Use new artifacts tool.
chrippa Jan 26, 2016
0e73ecc
docs: Fix readthedocs build.
chrippa Jan 26, 2016
ab80dbd
travis: Build installer exe aswell.
chrippa Feb 2, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
language: python
sudo: false
python:
- 2.6
- 2.7
- 3.3
- 2.6
- 2.7
- 3.3
script: python setup.py test

addons:
apt:
packages:
- nsis

install:
- travis_retry pip install requests argparse --use-mirrors
- travis_retry gem install --version 0.8.9 faraday
- travis_retry gem install travis-artifacts
- travis_retry pip install requests argparse --use-mirrors
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash

after_success:
- sh .travis/build-win32.sh
- bash .travis/build-win32.sh

env:
global:
- ARTIFACTS_AWS_REGION=us-east-1
- ARTIFACTS_S3_BUCKET=livestreamer-builds
- secure: hCNU8Oaw944R+pbHiPFputtgXgC6B02m2UM+7flIatoTnUYTZbwGSkVCxF12s5vSuI4Zg01/54qSuCe4sNxloPmqQ50oxKaxFkq8LlidOjbGw6hq7u+qDvD5+E2PfRwcfDNnso9NbuRSP8TMk9/WRXeBD/SrbgnbZ/1o/LQEKBQ=
- secure: YUltQXSDTBIP0iDbU9NiLv8FP3Xr/TT/JYuuyw8JfRzOcjM0PP+qKXyR9bc/gDpSj2uoLDaKfTQvPGFCYdrd+UuTZmlvV56VYQ2/tG0XXifvINJOyESWBLvQfhySuvC/IDpMhz0yEKI8btKHurlvIdvv/9HKlxVL/EIU3C2apiQ=
- ARTIFACTS_S3_REGION=eu-west-1
- ARTIFACTS_S3_BUCKET=livestreamer-builds

14 changes: 11 additions & 3 deletions .travis/build-win32.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

if [ $TRAVIS_SECURE_ENV_VARS != "true" ]; then
exit 0
fi

if [ $TRAVIS_PYTHON_VERSION != "2.7" ]; then
exit 0
fi
Expand All @@ -10,8 +14,12 @@ git fetch --unshallow

sh win32/build-with-bootstrap.sh
cd dist/
cp *zip livestreamer-latest-win32.zip

for zip in *zip; do
travis-artifacts upload --path "$zip" --target-path ""
if [ $TRAVIS_BRANCH = "develop" ]; then
cp *zip livestreamer-latest-win32.zip
cp *exe livestreamer-latest-win32-setup.exe
fi

for file in ./{*.exe,*.zip}; do
~/bin/artifacts upload --target-paths "/" "$file"
done
4 changes: 2 additions & 2 deletions docs/issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Streams are buffering/lagging
Enable caching in your player
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

By default most players do not cache the data they receieve from Livestreamer.
By default most players do not cache the data they receive from Livestreamer.
Caching can reduce the amount of buffering you run into because the player will
have some breathing room between receving the data and playing it.
have some breathing room between receiving the data and playing it.

============= ======================== ======================================
Player Parameter Note
Expand Down
2 changes: 1 addition & 1 deletion docs/players.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Name Stdin Pipe Named Pipe HTTP
.. [3] Some versions of VLC might be unable to use the stdin pipe and
prints the error message::

VLC is unable to open the MRL 'fd://0'
VLC is unable to open the MRL 'fd://0'

Use one of the other transport methods instead to work around this.

Expand Down
12 changes: 10 additions & 2 deletions docs/plugin_matrix.rst
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ afreeca afreecatv.com Yes No
afreecatv afreeca.tv Yes No
aftonbladet aftonbladet.se Yes Yes
alieztv aliez.tv Yes Yes
antenna antenna.gr -- Yes
ard_live live.daserste.de Yes -- Streams may be geo-restricted to Germany.
ard_mediathek ardmediathek.de Yes Yes Streams may be geo-restricted to Germany.
artetv arte.tv Yes Yes
azubutv azubu.tv Yes No
beam beam.pro Yes No
beattv be-at.tv Yes Yes Playlist not implemented yet.
bambuser bambuser.com Yes Yes
bliptv blip.tv -- Yes
chaturbate chaturbate.com Yes No
connectcast connectcast.tv Yes Yes
crunchyroll crunchyroll.com -- Yes
Expand All @@ -34,6 +37,7 @@ douyutv douyutv.com Yes --
dmcloud api.dmcloud.net Yes --
drdk dr.dk Yes Yes Streams may be geo-restricted to Denmark.
euronews euronews.com Yes No
expressen expressen.se Yes Yes
filmon filmon.com Yes Yes Only SD quality streams.
filmon_us filmon.us Yes Yes
furstream furstre.am Yes No
Expand All @@ -45,8 +49,10 @@ itvplayer itv.com/itvplayer Yes Yes Streams may be geo-restrict
letontv leton.tv Yes --
livestation livestation.com Yes --
livestream new.livestream.com Yes --
media_ccc_de - media.ccc.de Yes Yes Only mp4 and HLS ar are supported.
livecoding livecoding.tv Yes --
media_ccc_de - media.ccc.de Yes Yes Only mp4 and HLS are supported.
- streaming... [4]_
meerkat meerkatapp.co Yes --
mips mips.tv Yes -- Requires rtmpdump with K-S-V patches.
mlgtv mlg.tv Yes --
nhkworld nhk.or.jp/nhkworld Yes No
Expand All @@ -55,9 +61,10 @@ npo npo.nl Yes Yes Streams may be geo-restrict
nrk - tv.nrk.no Yes Yes Streams may be geo-restricted to Norway.
- radio.nrk.no
oldlivestream original.liv... [3]_ Yes No Only mobile streams are supported.
periscope periscope.tv Yes --
periscope periscope.tv Yes Yes Replay/VOD is supported.
picarto picarto.tv Yes --
rtve rtve.es Yes No
ruv ruv.is Yes Yes Streams may be geo-restricted to Iceland.
sbsdiscovery - kanal5play.se -- Yes
- kanal9play.se
- kanal11play.se
Expand All @@ -67,6 +74,7 @@ ssh101 ssh101.com Yes No
streamingvi... [1]_ streamingvid... [2]_ Yes -- RTMP streams requires rtmpdump with
K-S-V patches.
streamlive streamlive.to Yes --
streamupcom streamup.com Yes --
svtplay - svtplay.se Yes Yes Streams may be geo-restricted to Sweden.
- svtflow.se
- oppetarkiv.se
Expand Down
26 changes: 23 additions & 3 deletions src/livestreamer/plugins/afreeca.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"rtmp": "http://sessionmanager01.afreeca.tv:6060/broad_stream_assign.html",
"hls": "http://resourcemanager.afreeca.tv:9090/broad_stream_assign.html"
}
HLS_KEY_URL = "http://api.m.afreeca.com/broad/a/watch"

CHANNEL_RESULT_ERROR = 0
CHANNEL_RESULT_OK = 1
Expand Down Expand Up @@ -55,18 +56,37 @@ def _get_channel_info(self, username):

return http.json(res, schema=_channel_schema)

def _get_hls_key(self, broadcast, username):
headers = {
"Referer": self.url
}
data = {
"bj_id": username,
"broad_no": broadcast
}
res = http.post(HLS_KEY_URL, data=data, headers=headers)

return http.json(res)

def _get_stream_info(self, broadcast, type):
params = {
"return_type": "gs_cdn",
"use_cors": "true",
"cors_origin_url": "m.afreeca.com",
"broad_no": "{broadcast}-mobile-hd-{type}".format(**locals()),
"broad_key": "{broadcast}-flash-hd-{type}".format(**locals())
}
res = http.get(STREAM_INFO_URLS[type], params=params)
return http.json(res, schema=_stream_schema)

def _get_hls_stream(self, broadcast):
def _get_hls_stream(self, broadcast, username):
keyjson = self._get_hls_key(broadcast, username)
if keyjson["result"] != CHANNEL_RESULT_OK:
return
key = keyjson["data"]["hls_authentication_key"]
info = self._get_stream_info(broadcast, "hls")
if "view_url" in info:
return HLSStream(self.session, info["view_url"])
return HLSStream(self.session, info["view_url"], params=dict(aid=key))

def _get_rtmp_stream(self, broadcast):
info = self._get_stream_info(broadcast, "rtmp")
Expand All @@ -90,7 +110,7 @@ def _get_streams(self):
if flash_stream:
yield "live", flash_stream

mobile_stream = self._get_hls_stream(broadcast)
mobile_stream = self._get_hls_stream(broadcast, username)
if mobile_stream:
yield "live", mobile_stream

Expand Down
12 changes: 9 additions & 3 deletions src/livestreamer/plugins/afreecatv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@


VIEW_LIVE_API_URL = "http://api.afreeca.tv/live/view_live.php"
VIEW_LIVE_API_URL_TW = "http://api.afreecatv.com.tw/live/view_live.php"

_url_re = re.compile("http(s)?://(\w+\.)?afreeca.tv/(?P<channel>[\w\-_]+)")
_url_re = re.compile("http(s)?://(\w+\.)?(afreecatv.com.tw|afreeca.tv)/(?P<channel>[\w\-_]+)")
_url_re_tw = re.compile("http(s)?://(\w+\.)?(afreecatv.com.tw)/(?P<channel>[\w\-_]+)")
_flashvars_re = re.compile('<param name="flashvars" value="([^"]+)" />')

_flashvars_schema = validate.Schema(
Expand All @@ -27,7 +29,6 @@
{
"channel": {
"strm": [{
"brt": validate.text,
"bps": validate.text,
"purl": validate.url(scheme="rtmp")
}]
Expand Down Expand Up @@ -57,7 +58,12 @@ def _get_streams(self):
"adok": "",
"bno": ""
}
res = http.get(VIEW_LIVE_API_URL, params=params)

if re.search(_url_re_tw, self.url):
res = http.get(VIEW_LIVE_API_URL_TW, params=params)
else:
res = http.get(VIEW_LIVE_API_URL, params=params)

streams = http.json(res, schema=_view_live_schema)

for stream in streams:
Expand Down
49 changes: 49 additions & 0 deletions src/livestreamer/plugins/antenna.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import re
import json

from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream

_url_re = re.compile("(http(s)?://(\w+\.)?antenna.gr)/webtv/watch\?cid=.+")
_playlist_re = re.compile("playlist:\s*\"(/templates/data/jplayer\?cid=[^\"]+)")
_manifest_re = re.compile("jwplayer:source\s+file=\"([^\"]+)\"")
_swf_re = re.compile("<jwplayer:provider>(http[^<]+)</jwplayer:provider>")

class Antenna(Plugin):
@classmethod
def can_handle_url(self, url):
return _url_re.match(url)

def _get_streams(self):

# Discover root
match = _url_re.search(self.url)
root = match.group(1)

# Download main URL
res = http.get(self.url)

# Find playlist
match = _playlist_re.search(res.text)
playlist_url = root + match.group(1) + "d"

# Download playlist
res = http.get(playlist_url)

# Find manifest
match = _manifest_re.search(res.text)
manifest_url = match.group(1)

# Find SWF
match = _swf_re.search(res.text)
swf_url = match.group(1);

streams = {}
streams.update(
HDSStream.parse_manifest(self.session, manifest_url, pvswf=swf_url)
)

return streams

__plugin__ = Antenna
4 changes: 2 additions & 2 deletions src/livestreamer/plugins/artetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
SWF_URL = "http://www.arte.tv/player/v2/jwplayer6/mediaplayer.6.6.swf"

_url_re = re.compile("http(s)?://(\w+\.)?arte.tv/")
_json_re = re.compile("arte_vp_(?:live-)?url='([^']+)'")
_json_re = re.compile("arte_vp_(?:live-)?url=(['\"])(.+?)\\1")

_schema = validate.Schema(
validate.transform(_json_re.search),
validate.any(
None,
validate.all(
validate.get(1),
validate.get(2),
validate.url(scheme="http")
)
)
Expand Down
49 changes: 16 additions & 33 deletions src/livestreamer/plugins/azubutv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"(KHTML, like Gecko) Chrome/36.0.1944.9 Safari/537.36")
}

_url_re = re.compile("http(s)?://(\w+\.)?azubu.tv/[^/]+")
_url_re = re.compile("http(s)?://(\w+\.)?azubu.tv/(?P<domain>\w+)")
CHANNEL_INFO_URL = "http://api.azubu.tv/public/channel/%s/player"

_viewerexp_schema = validate.Schema(
validate.attr({
Expand Down Expand Up @@ -122,50 +123,32 @@ def _send_amf_request(self, req, key):
return AMFPacket.deserialize(BytesIO(res.content))

def _get_player_params(self, retries=5):
match = _url_re.match(self.url);
domain = match.group('domain');
try:
res = http.get(self.url, headers=HTTP_HEADERS)
res = http.get(CHANNEL_INFO_URL % str(domain))
except PluginError as err:
# The server sometimes gives us 404 for no reason
if "404" in str(err) and retries:
sleep(1)
return self._get_player_params(retries - 1)
else:
raise
channel_info = http.json(res)
channel_info = channel_info['data']

match = re.search("<param name=\"playerKey\" value=\"(.+)\" />", res.text)
if not match:
# The HTML returned sometimes doesn't contain the parameters
if not retries:
raise PluginError("Missing key 'playerKey' in player params")
else:
sleep(1)
return self._get_player_params(retries - 1)
key = channel_info['player_key'];

key = match.group(1)
match = re.search("AZUBU.setVar\(\"firstVideoRefId\", \"(.+)\"\);", res.text)
if not match:
# The HTML returned sometimes doesn't contain the parameters
if not retries:
raise PluginError("Unable to find video reference")
else:
sleep(1)
return self._get_player_params(retries - 1)
is_live = channel_info['is_live'];

video_player = "ref:" + match.group(1)
match = re.search("<param name=\"playerID\" value=\"(\d+)\" />", res.text)
if not match:
# The HTML returned sometimes doesn't contain the parameters
if not retries:
raise PluginError("Missing key 'playerID' in player params")
else:
sleep(1)
return self._get_player_params(retries - 1)
stream_video = channel_info['stream_video']
if stream_video:
video_player = "ref:" + stream_video['reference_id']
else:
is_live = False
video_player = None

player_id = match.group(1)
match = re.search("<!-- live on -->", res.text)
if not match:
match = re.search("<div id=\"channel_live\">", res.text)
is_live = not not match
player_id = channel_info['player_id']

return key, video_player, player_id, is_live

Expand Down
Loading