From d1e0757dd487c039a4b458537b8db321dac969b1 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 21 Apr 2014 20:04:06 +0200 Subject: [PATCH] viaplay: yield the subs --- lib/svtplay_dl/service/viaplay.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index e58b8c3..3c269c9 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -12,9 +12,10 @@ import json from svtplay_dl.utils.urllib import urlparse from svtplay_dl.service import Service, OpenGraphThumbMixin -from svtplay_dl.utils import get_http_data, subtitle_sami +from svtplay_dl.utils import get_http_data from svtplay_dl.log import log from svtplay_dl.fetcher.rtmp import RTMP +from svtplay_dl.subtitle import subtitle_sami class Viaplay(Service, OpenGraphThumbMixin): supported_domains = [ @@ -66,7 +67,7 @@ class Viaplay(Service, OpenGraphThumbMixin): options.live = True filename = xml.find("Product").find("Videos").find("Video").find("Url").text bitrate = xml.find("Product").find("Videos").find("Video").find("BitRate").text - self.subtitle = xml.find("Product").find("SamiFile").text + yield subtitle_sami(xml.find("Product").find("SamiFile").text) if filename[:4] == "http": data = get_http_data(filename) @@ -90,11 +91,6 @@ class Viaplay(Service, OpenGraphThumbMixin): yield RTMP(options, filename, bitrate) - def get_subtitle(self, options): - if self.subtitle: - data = get_http_data(self.subtitle) - subtitle_sami(options, data) - def find_all_episodes(self, options): format_id = re.search(r'data-format-id="(\d+)"', self.get_urldata()) if not format_id: