From 2f61e54f7e4dddb3355b48b89381921f602b03d8 Mon Sep 17 00:00:00 2001 From: JuanBindez Date: Thu, 28 Sep 2023 11:28:19 -0300 Subject: [PATCH] 1.1.2 --- pytubefix/__main__.py | 4 ++-- pytubefix/colors.py | 2 +- pytubefix/parser.py | 3 ++- pytubefix/version.py | 2 +- test.py | 15 +++++++-------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pytubefix/__main__.py b/pytubefix/__main__.py index d0f8a4c..757700b 100644 --- a/pytubefix/__main__.py +++ b/pytubefix/__main__.py @@ -341,7 +341,7 @@ def title(self) -> str: ) if self._title: - return self._author + self._title + return self._author + " - " + self._title try: self._title = self.vid_info['videoDetails']['title'] #+ self._author @@ -356,7 +356,7 @@ def title(self) -> str: ) ) # print(self.vid_info['videoDetails']) - return self._author + self._title + return self._author + " - " + self._title @title.setter def title(self, value): diff --git a/pytubefix/colors.py b/pytubefix/colors.py index 8bc93a5..27c932e 100644 --- a/pytubefix/colors.py +++ b/pytubefix/colors.py @@ -18,5 +18,5 @@ colors_list = [ GREEN, LIGTH_GREEN, RED, YELLOW, BLUE, MAGENTA, - BOLD, CYAN, LIGHT_CYAN, INVERTE, RESET + CYAN, LIGHT_CYAN, RESET ] diff --git a/pytubefix/parser.py b/pytubefix/parser.py index 4d6d4ed..984937f 100644 --- a/pytubefix/parser.py +++ b/pytubefix/parser.py @@ -83,6 +83,7 @@ def find_object_from_startpoint(html, start_point): '{': '}', '[': ']', '"': '"', + '\'': '\'', '/': '/' # javascript regex } @@ -102,7 +103,7 @@ def find_object_from_startpoint(html, start_point): # Strings and regex expressions require special context handling because they can contain # context openers *and* closers - if curr_context in ['"', '/']: + if curr_context in ['"', '\'', '/']: # If there's a backslash in a string or regex expression, we skip a character if curr_char == '\\': i += 2 diff --git a/pytubefix/version.py b/pytubefix/version.py index 181bd80..5c8978c 100644 --- a/pytubefix/version.py +++ b/pytubefix/version.py @@ -1,4 +1,4 @@ -__version__ = "1.1.1" +__version__ = "1.1.2" if __name__ == "__main__": print(__version__) diff --git a/test.py b/test.py index f3e344b..b3dbbeb 100644 --- a/test.py +++ b/test.py @@ -1,11 +1,10 @@ from pytubefix import YouTube -from pytubefix import Playlist from pytubefix.cli import on_progress -url = input("URL Here >") - -pl = Playlist(url) - -for video in pl.videos: - ys = video.streams.get_audio_only() - ys.download(mp3=True) \ No newline at end of file +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.download(mp3=True) # pass the parameter mp3=Tre to save in .mp3 \ No newline at end of file