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

plugins.livestream: Update for API changes #1277

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/livestreamer/plugins/livestream.py
Expand Up @@ -22,7 +22,9 @@
),
}, None)
},
validate.optional("playerUri"): validate.text,
validate.optional("viewerPlusSwfUrl"): validate.url(scheme="http"),
validate.optional("lsPlayerSwfUrl"): validate.text,
validate.optional("hdPlayerSwfUrl"): validate.text
})
_smil_schema = validate.Schema(validate.union({
Expand Down Expand Up @@ -94,12 +96,12 @@ def _get_streams(self):

play_url = stream_info.get("play_url")
if play_url:
swf_url = info.get("viewerPlusSwfUrl") or info.get("hdPlayerSwfUrl")
if not swf_url.startswith("http"):
swf_url = "http://" + swf_url
swf_url = info.get("playerUri") or info.get("hdPlayerSwfUrl") or info.get("lsPlayerSwfUrl") or info.get("viewerPlusSwfUrl")
if swf_url:
swf_url = urljoin(self.url, swf_url)

# Work around broken SSL.
swf_url = swf_url.replace("https://", "http://")
# Work around broken SSL.
swf_url = swf_url.replace("https://", "http://")

qualities = stream_info["qualities"]
for bitrate, stream in self._parse_smil(play_url, swf_url):
Expand Down