1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-12-05 01:23:44 +01:00
svtplay-dl/lib/svtplay_dl/fetcher/__init__.py

32 lines
1.2 KiB
Python
Raw Normal View History

from svtplay_dl.utils.http import HTTP
2018-01-30 20:11:37 +01:00
2019-08-25 00:33:51 +02:00
class VideoRetriever:
2020-06-25 20:55:48 +02:00
def __init__(self, config, url, bitrate, output, **kwargs):
2018-05-08 22:46:11 +02:00
self.config = config
2014-04-21 16:50:24 +02:00
self.url = url
2020-06-25 20:55:48 +02:00
self.bitrate = int(bitrate) if bitrate else 0
self.kwargs = kwargs
2018-05-08 22:46:11 +02:00
self.http = HTTP(config)
self.finished = False
2016-03-26 21:38:31 +01:00
self.audio = kwargs.pop("audio", None)
self.files = kwargs.pop("files", None)
self.keycookie = kwargs.pop("keycookie", None)
self.authorization = kwargs.pop("authorization", None)
2020-06-25 20:55:48 +02:00
self.output = output
2018-05-13 13:06:45 +02:00
self.segments = kwargs.pop("segments", None)
2018-05-13 01:45:23 +02:00
self.output_extention = None
2020-06-25 20:55:48 +02:00
channels = kwargs.pop("channels", None)
codec = kwargs.pop("codec", "h264")
2021-04-18 14:06:25 +02:00
self.resolution = kwargs.pop("resolution", "")
self.language = kwargs.pop("language", "")
self.audio_role = kwargs.pop("role", "main")
2021-02-28 22:05:15 +01:00
self.format = f"{codec}-{channels}" if channels else codec
def __repr__(self):
2022-06-03 05:59:52 +02:00
return f"<Video(fetcher={self.__class__.__name__}, bitrate={self.bitrate} format={self.format}, language={self.language}, audio_role={self.audio_role}, resolution={self.resolution}>"
2018-05-25 22:47:26 +02:00
@property
def name(self):
pass