1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

viaplay: yield the subs

This commit is contained in:
Johan Andersson 2014-04-21 20:04:06 +02:00
parent 4e69ebdf39
commit 28bc0f3389

View File

@ -12,10 +12,11 @@ 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.hds import hdsparse
from svtplay_dl.fetcher.rtmp import RTMP
from svtplay_dl.subtitle import subtitle_sami
class Viaplay(Service, OpenGraphThumbMixin):
supported_domains = [
@ -67,7 +68,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 options.subtitle and options.force_subtitle:
return
@ -100,11 +101,6 @@ class Viaplay(Service, OpenGraphThumbMixin):
options.other = "-W http://flvplayer.viastream.viasat.tv/flvplayer/play/swf/player.swf %s" % path
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: