Skip to content

Commit

Permalink
Update direct_link_generator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rinrinx2 authored Nov 23, 2021
1 parent 7572e7b commit 4ef6ddb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def direct_link_generator(link: str):
raise DirectDownloadLinkException(f"Use /{BotCommands.WatchCommand} to mirror Youtube link\nUse /{BotCommands.ZipWatchCommand} to make zip of Youtube playlist")
elif 'zippyshare.com' in link:
return zippy_share(link)
elif 'yadi.sk' in link:
elif 'yadi.sk' in link or 'disk.yandex.com.ru' in link:
return yandex_disk(link)
elif 'mediafire.com' in link:
return mediafire(link)
Expand Down Expand Up @@ -128,7 +128,7 @@ def yandex_disk(url: str) -> str:
""" Yandex.Disk direct links generator
Based on https://github.com/wldhx/yadisk-direct """
try:
link = re.findall(r'\bhttps?://.*yadi\.sk\S+', url)[0]
link = re.findall(r'\b(https?://.*(yadi|disk)\.(sk|yandex)*(|com.ru)\S+)', url)[0][0]
except IndexError:
return "No Yandex.Disk links found\n"
api = 'https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key={}'
Expand Down

0 comments on commit 4ef6ddb

Please sign in to comment.