Skip to content

Commit

Permalink
- micro patch to fix path issues in CLI
Browse files Browse the repository at this point in the history
- release 1.5.3
  • Loading branch information
EchterAlsFake committed Jan 10, 2025
1 parent 0d51a05 commit 6c5e122
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
12 changes: 5 additions & 7 deletions xvideos_api/xvideos_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = []
Expand All @@ -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__":
Expand Down

0 comments on commit 6c5e122

Please sign in to comment.