This commit is contained in:
2023-09-22 13:35:00 +03:00
committed by nikili0n
parent 67ae781660
commit f06d2d3507
6 changed files with 44 additions and 17 deletions

View File

@ -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):

View File

@ -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