Skip to content

Commit

Permalink
downloading fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
borfirbora committed May 7, 2024
1 parent 223ba35 commit 9bcbf72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions addon/globalPlugins/basic_youtube_downloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def recogniseLink(self, link):
elif "youtube.com/playlist?" in link:
return pytube.Playlist(link)
elif "youtu.be/" in link:
return pytube.YouTube("https://youtube.com/watch?v={}".format(parse.urlparse(link).path[1::]))
return pytube.YouTube("https://www.youtube.com/watch?v={}".format(parse.urlparse(link).path[1::]))
else:
gui.speech.speakMessage(_("It is not a valid link"))
self.terminate()
Expand Down Expand Up @@ -116,9 +116,11 @@ def downloadVideo(self, quality, video: pytube.YouTube, f_path):
video.register_on_complete_callback(self.onComplete)
video.register_on_progress_callback(self.onProgress)
if quality == 0:
video.streams.get_highest_resolution().download(f_path)
d = video.streams.get_highest_resolution()
d.download(f_path)
elif quality == 1:
video.streams.get_lowest_resolution().download(f_path)
d = video.streams.get_lowest_resolution()
d.download(f_path)
self.clearGestureBindings()
self.bindGestures(self._GlobalPlugin__gestures)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class Cipher:
def __init__(self, js: str):
self.transform_plan: List[str] = get_transform_plan(js)
var_regex = re.compile(r"^\w+\W")
var_regex = re.compile(r"^\$*\w+\W")
var_match = var_regex.search(self.transform_plan[0])
if not var_match:
raise RegexMatchError(
Expand Down
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _(arg):
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description": _("A plugin that can download Youtube videos and playlists."),
# version
"addon_version": "1.5",
"addon_version": "1.5.1",
# Author(s)
"addon_author": "Bora FIRLANGEÇ <borafirlangec@gmail.com>",
# URL for the add-on documentation support
Expand Down

0 comments on commit 9bcbf72

Please sign in to comment.