Skip to content

Commit

Permalink
again fixed link pattern 😒
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed May 8, 2020
1 parent 723b97d commit c770e4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion userge/plugins/misc/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ async def upload(self) -> None:
os.mkdir(Config.DOWN_PATH)
replied = self._message.reply_to_message
is_url = re.search(
r"(?:https?|ftp)://.*\.\S+", self._message.input_str)
r"(?:https?|ftp)://[^\|\s]+\.[^\|\s]+", self._message.input_str)
dl_loc = None
if replied and replied.media:
await self._message.edit("`Downloading From TG...`")
Expand All @@ -685,6 +685,8 @@ async def upload(self) -> None:
await self._message.edit("`Downloading From URL...`")
url = is_url[0]
file_name = os.path.basename(url)
if "|" in self._message.input_str:
file_name = self._message.input_str.split("|")[1].strip()
dl_loc = os.path.join(Config.DOWN_PATH, file_name)
try:
downloader = SmartDL(url, dl_loc, progress_bar=False)
Expand Down
2 changes: 1 addition & 1 deletion userge/plugins/misc/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def uploadtotg(message: Message):
if not path_:
await message.edit("invalid input!, check `.help .upload`", del_in=5)
return
is_url = re.search(r"(?:https?|ftp)://.*\.\S+", path_)
is_url = re.search(r"(?:https?|ftp)://[^\|\s]+\.[^\|\s]+", path_)
del_path = False
if is_url:
del_path = True
Expand Down
2 changes: 1 addition & 1 deletion userge/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__version_mjaor__ = 0
__version_minor__ = 1
__version_micro__ = 4
__version_beta__ = 7
__version_beta__ = 8

__version__ = "{}.{}.{}".format(__version_mjaor__,
__version_minor__,
Expand Down

0 comments on commit c770e4e

Please sign in to comment.