From 7b96590519d5fd0304384d9a53339e2c65ff3a8f Mon Sep 17 00:00:00 2001 From: JuanBindez Date: Wed, 4 Oct 2023 15:01:57 -0300 Subject: [PATCH] 1.4.1 --- .bumpversion.cfg | 2 +- README.md | 6 ++++-- pytubefix/__main__.py | 4 ++-- pytubefix/version.py | 2 +- test.py | 13 ++++++++----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index da606d0..800ee9b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.4-rc1 +current_version = 1.4.1 commit = True tag = True diff --git a/README.md b/README.md index de322ed..b07c18b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ ---------- ## usage: +### mp4 video download highest resolution: + ```python from pytubefix import YouTube @@ -31,7 +33,7 @@ ys.download() ---------- -### If you want to save in .mp3 just pass the mp3=True parameter (note the real audio compression format is MP4A), the file is just renamed to .mp3 so that it is recognized by any app: +### If you want to save in .mp3 just pass the mp3=True parameter (MPEG-4 AAC audio codec): ```python @@ -44,7 +46,7 @@ url = input("URL >") yt = YouTube(url, on_progress_callback = on_progress) print(yt.title) -ys = yt.streams.get_audio_only() # use this method -> get_audio_only() +ys = yt.streams.get_audio_only() ys.download(mp3=True) # pass the parameter mp3=True to save in .mp3 ``` diff --git a/pytubefix/__main__.py b/pytubefix/__main__.py index 757700b..7016573 100644 --- a/pytubefix/__main__.py +++ b/pytubefix/__main__.py @@ -337,11 +337,11 @@ def title(self) -> str: :rtype: str """ self._author = self.vid_info.get("videoDetails", {}).get( - "author", "unknown" + "author", "author" ) if self._title: - return self._author + " - " + self._title + return self._title try: self._title = self.vid_info['videoDetails']['title'] #+ self._author diff --git a/pytubefix/version.py b/pytubefix/version.py index 1a28e90..38a30c8 100644 --- a/pytubefix/version.py +++ b/pytubefix/version.py @@ -1,4 +1,4 @@ -__version__ = "1.4-rc1" +__version__ = "1.4.1" if __name__ == "__main__": print(__version__) diff --git a/test.py b/test.py index a038ab9..5988040 100644 --- a/test.py +++ b/test.py @@ -1,7 +1,10 @@ from pytubefix import YouTube +from pytubefix.cli import on_progress - -yt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo') - -caption = yt.captions.get_by_language_code('en') -caption.save_captions("captions.txt") +url = input("URL >") + +yt = YouTube(url, on_progress_callback = on_progress) +print(yt.title) + +ys = yt.streams.get_audio_only() +ys.download(mp3=True) \ No newline at end of file