Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanBindez committed Sep 28, 2023
1 parent cbc043d commit 2f61e54
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pytubefix/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pytubefix/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

colors_list = [
GREEN, LIGTH_GREEN, RED, YELLOW, BLUE, MAGENTA,
BOLD, CYAN, LIGHT_CYAN, INVERTE, RESET
CYAN, LIGHT_CYAN, RESET
]
3 changes: 2 additions & 1 deletion pytubefix/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def find_object_from_startpoint(html, start_point):
'{': '}',
'[': ']',
'"': '"',
'\'': '\'',
'/': '/' # javascript regex
}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pytubefix/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.1.1"
__version__ = "1.1.2"

if __name__ == "__main__":
print(__version__)
15 changes: 7 additions & 8 deletions test.py
Original file line number Diff line number Diff line change
@@ -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)
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

0 comments on commit 2f61e54

Please sign in to comment.