mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
urplay: yield the subs
This commit is contained in:
parent
4c50978acf
commit
6a02d39ae3
@ -7,10 +7,11 @@ import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from svtplay_dl.service import Service, OpenGraphThumbMixin
|
||||
from svtplay_dl.utils import get_http_data, subtitle_tt
|
||||
from svtplay_dl.utils import get_http_data
|
||||
from svtplay_dl.fetcher.rtmp import RTMP
|
||||
from svtplay_dl.fetcher.hls import HLS
|
||||
from svtplay_dl.log import log
|
||||
from svtplay_dl.subtitle import subtitle_tt
|
||||
|
||||
class Urplay(Service, OpenGraphThumbMixin):
|
||||
supported_domains = ['urplay.se', 'ur.se']
|
||||
@ -26,7 +27,7 @@ class Urplay(Service, OpenGraphThumbMixin):
|
||||
sys.exit(2)
|
||||
data = match.group(1)
|
||||
jsondata = json.loads(data)
|
||||
self.subtitle = jsondata["subtitles"].split(",")[0]
|
||||
yield subtitle_tt(jsondata["subtitles"].split(",")[0])
|
||||
basedomain = jsondata["streaming_config"]["streamer"]["redirect"]
|
||||
http = "http://%s/%s" % (basedomain, jsondata["file_html5"])
|
||||
hd = None
|
||||
@ -48,11 +49,6 @@ class Urplay(Service, OpenGraphThumbMixin):
|
||||
options.other = "-v -a %s -y %s" % (jsondata["streaming_config"]["rtmp"]["application"], path_hd)
|
||||
yield RTMP(options, rtmp, "720")
|
||||
|
||||
def get_subtitle(self, options):
|
||||
if self.subtitle:
|
||||
data = get_http_data(self.subtitle)
|
||||
subtitle_tt(options, data)
|
||||
|
||||
def find_all_episodes(self, options):
|
||||
match = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"',
|
||||
self.get_urldata())
|
||||
|
Loading…
Reference in New Issue
Block a user