up
This commit is contained in:
@ -15,6 +15,7 @@ from src.parsers.MyMail.my_mail_parser import MyMailParser
|
||||
from src.parsers.Yappy.yappy_parser import YappyParser
|
||||
from src.parsers.base_parser import BaseParser
|
||||
|
||||
# TODO: добавить логгер с временными метками в yt-dlp
|
||||
|
||||
class MasterService:
|
||||
def __init__(self):
|
||||
|
@ -19,17 +19,14 @@ class VideoDownloader:
|
||||
self.ydl_opts = ydl_opts
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.info = None
|
||||
|
||||
def get_info(self):
|
||||
with YoutubeDL(self.ydl_opts if self.ydl_opts else {}) as ydl:
|
||||
return ydl.extract_info(self.link, download=False)
|
||||
self.info = ydl.extract_info(self.link, download=False)
|
||||
|
||||
def download(self):
|
||||
domain = urlparse(self.link).netloc
|
||||
# if domain not in self.SUPPORTING_WEBSITES:
|
||||
# raise SiteNotImplementedException
|
||||
|
||||
# TODO: удалить все файлы связанные с текущим видео, которые сейчас остались
|
||||
with YoutubeDL(self.ydl_opts if self.ydl_opts else {}) as ydl:
|
||||
ydl.download([self.link])
|
||||
result = ydl.extract_info(self.link, download=False)
|
||||
return result
|
||||
return self.info
|
||||
|
Reference in New Issue
Block a user