From 14bd23c841cb8160e8cf2f38aa12736ef8da0f89 Mon Sep 17 00:00:00 2001 From: nikili0n Date: Fri, 29 Sep 2023 13:46:52 +0300 Subject: [PATCH] minor fixes --- src/parsers/base_parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parsers/base_parser.py b/src/parsers/base_parser.py index 3c3755a..a298099 100644 --- a/src/parsers/base_parser.py +++ b/src/parsers/base_parser.py @@ -24,10 +24,17 @@ class BaseParser: } downloader = VideoDownloader(link=self.params["link"], ydl_opts=ydl_opts) downloader.get_info() - path_to_video = f"{downloader.info['extractor_key']}/{downloader.info['id']}_{downloader.info['resolution']}.{downloader.info['ext']}" + + if 'resolution' in downloader.info and downloader.info["resolution"]: + resolution = downloader.info['resolution'] + else: + resolution = "NA" + + path_to_video = f"{downloader.info['extractor_key']}/{downloader.info['id']}_{resolution}.{downloader.info['ext']}" if os.path.exists(os.path.join(os.getcwd() + "/downloads/" + path_to_video)): raise FileAlreadyExistException(message=path_to_video) downloader.ydl_opts["quiet"] = False + downloader.ydl_opts["quiet"] = False downloader.download() return path_to_video