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