2015-01-18 18:03:38 +01:00
|
|
|
import os
|
2018-01-14 22:23:58 +01:00
|
|
|
import re
|
2015-01-18 18:03:38 +01:00
|
|
|
|
2019-08-25 00:40:39 +02:00
|
|
|
from svtplay_dl.fetcher.dash import dashparse
|
2015-10-04 14:37:16 +02:00
|
|
|
from svtplay_dl.fetcher.hls import hlsparse
|
2019-08-25 00:40:39 +02:00
|
|
|
from svtplay_dl.service import Service
|
2015-01-18 18:03:38 +01:00
|
|
|
|
2015-09-15 20:10:32 +02:00
|
|
|
|
2015-01-18 18:03:38 +01:00
|
|
|
class Raw(Service):
|
2015-12-26 11:46:14 +01:00
|
|
|
def get(self):
|
2019-08-25 00:27:31 +02:00
|
|
|
filename = os.path.basename(self.url[: self.url.rfind("/")])
|
2018-05-08 22:51:27 +02:00
|
|
|
self.output["title"] = filename
|
2015-01-28 20:57:37 +01:00
|
|
|
|
2018-01-14 22:23:58 +01:00
|
|
|
if re.search(".m3u8", self.url):
|
2021-05-16 02:22:37 +02:00
|
|
|
yield from hlsparse(self.config, self.http.request("get", self.url), self.url, output=self.output)
|
2018-02-11 21:04:13 +01:00
|
|
|
|
|
|
|
if re.search(".mpd", self.url):
|
2021-05-16 02:22:37 +02:00
|
|
|
yield from dashparse(self.config, self.http.request("get", self.url), self.url, output=self.output)
|