From 9e08dae06c66ef00c510059061ab3bf349ed7529 Mon Sep 17 00:00:00 2001 From: JuanBindez Date: Sun, 3 Nov 2024 14:32:47 -0300 Subject: [PATCH] 8.3-rc8 (#308 #309 #310) --- build.sh | 2 +- pyproject.toml | 2 +- pytubefix/cli.py | 27 ++++++++++++++------------- pytubefix/version.py | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/build.sh b/build.sh index 49d9044..4cc1da6 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ VERSION=8 MINOR=3 PATCH= -EXTRAVERSION="-rc7" +EXTRAVERSION="-rc8" NOTES="(#308 #309 #310)" BRANCH="dev" diff --git a/pyproject.toml b/pyproject.toml index 1fd55be..20f3a69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pytubefix" -version = "8.3-rc7" +version = "8.3-rc8" authors = [ { name="Juan Bindez", email="juanbindez780@gmail.com" }, ] diff --git a/pytubefix/cli.py b/pytubefix/cli.py index 4d1dd24..cb15687 100644 --- a/pytubefix/cli.py +++ b/pytubefix/cli.py @@ -307,6 +307,18 @@ def _perform_args_on_youtube(youtube: YouTube, args: argparse.Namespace) -> None if args.build_playback_report: build_playback_report(youtube) + oauth = False + cache = False + + if args.oauth: + oauth = True + cache = True + + print("Loading video...") + youtube = YouTube(args.url, use_oauth=oauth, allow_oauth_cache=cache) + + download_highest_resolution_progressive(youtube=youtube, resolution="highest", target=args.target) + def main(): parser = argparse.ArgumentParser(description=main.__doc__) @@ -324,7 +336,7 @@ def main(): if "/playlist" in args.url: print("Loading playlist...") - playlist = Playlist(args.url, use_oauth=oauth, allow_oauth_cache=cache) + playlist = Playlist(args.url) args.target = args.target or safe_filename(playlist.title) for youtube_video in playlist.videos: @@ -334,20 +346,9 @@ def main(): print(f"There was an error with video: {youtube_video}") print(e) - oauth = False - cache = False - - if args.oauth: - oauth = True - cache = True - - print("Loading video...") - youtube = YouTube(args.url, use_oauth=oauth, allow_oauth_cache=cache) - _perform_args_on_youtube(youtube, args) - else: print("Loading video...") - youtube = YouTube(args.url, use_oauth=oauth, allow_oauth_cache=cache) + youtube = YouTube(args.url) _perform_args_on_youtube(youtube, args) if __name__ == "__main__": diff --git a/pytubefix/version.py b/pytubefix/version.py index d09b6f3..4d20a37 100644 --- a/pytubefix/version.py +++ b/pytubefix/version.py @@ -1,4 +1,4 @@ -__version__ = "8.3-rc7" +__version__ = "8.3-rc8" if __name__ == "__main__": print(__version__) \ No newline at end of file