From 6c5e1227d8efea52012cb3a65be4914b741299ee Mon Sep 17 00:00:00 2001 From: Johannes Habel Date: Fri, 10 Jan 2025 14:12:20 +0100 Subject: [PATCH] - micro patch to fix path issues in CLI - release 1.5.3 --- setup.py | 2 +- xvideos_api/xvideos_api.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index d795e55..369929c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="xvideos_api", - version="1.5.2", + version="1.5.3", packages=find_packages(), install_requires=["bs4", "eaf_base_api", "httpx"], entry_points={ diff --git a/xvideos_api/xvideos_api.py b/xvideos_api/xvideos_api.py index 3d82fb7..e56b4f3 100644 --- a/xvideos_api/xvideos_api.py +++ b/xvideos_api/xvideos_api.py @@ -141,7 +141,7 @@ def download(self, downloader, quality, path="./", callback=None, no_title=False :return: """ if no_title is False: - path = f"{path}{os.sep}{self.title}.mp4" + path = os.path.join(path, f"{self.title}.mp4") try: core.download(video=self, quality=quality, path=path, callback=callback, downloader=downloader) @@ -329,16 +329,15 @@ def main(): parser.add_argument("--output", metavar="Output directory", type=str, help="The output path (with filename)", required=True) parser.add_argument("--downloader", type=str, help="The Downloader (threaded,ffmpeg,default)", required=True) - parser.add_argument("--use-title", metavar="True,False", type=bool, + parser.add_argument("--no-title", metavar="True,False", type=str, help="Whether to apply video title automatically to output path or not", required=True) args = parser.parse_args() - + no_title = BaseCore().str_to_bool(args.no_title) if args.download: client = Client() video = client.get_video(args.download) - path = BaseCore.return_path(args=args, video=video) - video.download(quality=args.quality, path=path, downloader=args.downloader) + video.download(quality=args.quality, path=args.output, downloader=args.downloader, no_title=no_title) if args.file: videos = [] @@ -351,8 +350,7 @@ def main(): videos.append(client.get_video(url)) for video in videos: - path = core.return_path(args=args, video=video) - video.download(quality=args.quality, path=path, downloader=args.downloader) + video.download(quality=args.quality, path=args.output, downloader=args.downloader, no_title=no_title) if __name__ == "__main__":