1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00
svtplay-dl/lib/svtplay_dl/service/raw.py
Olof Johansson 5393dc1929 Fix various pylint warnings
None of these were any real problems, but easier to spot real issues if pylint
is a bit quieter. Apart from the pylint overrides being sprinkled over the code
base, this commit also fixes occurences of the following issues:

 - logging-not-lazy
 - logging-format-interpolation
 - unused-import
 - unused-variable
2016-04-03 19:06:45 +02:00

40 lines
1.4 KiB
Python

from __future__ import absolute_import
import os
from svtplay_dl.service import Service
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
class Raw(Service):
def get(self):
data = self.get_urldata()
if self.exclude(self.options):
return
extention = False
filename = os.path.basename(self.url[:self.url.rfind("/")-1])
if self.options.output and os.path.isdir(self.options.output):
self.options.output = os.path.join(os.path.dirname(self.options.output), filename)
extention = True
elif self.options.output is None:
self.options.output = "%s" % filename
extention = True
if self.url.find(".f4m") > 0:
if extention:
self.options.output = "%s.flv" % self.options.output
streams = hdsparse(self.options, self.http.request("get", self.url, params={"hdcore": "3.7.0"}), self.url)
if streams:
for n in list(streams.keys()):
yield streams[n]
if self.url.find(".m3u8") > 0:
streams = hlsparse(self.options, self.http.request("get", self.url), self.url)
if extention:
self.options.output = "%s.ts" % self.options.output
for n in list(streams.keys()):
yield streams[n]