diff --git a/README.md b/README.md
index 6d1eff551be..6c79a187c68 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ python3 generate_drive_token.py
## Deployment
-Fork this repo, than upload credentials.json and token.pickle to your forks
+Fork this repo, than upload **token.pickle** to your forks
diff --git a/bot/helper/mirror_utils/download_utils/direct_link_generator.py b/bot/helper/mirror_utils/download_utils/direct_link_generator.py
index 1a6a3973002..74b4f61b9f5 100644
--- a/bot/helper/mirror_utils/download_utils/direct_link_generator.py
+++ b/bot/helper/mirror_utils/download_utils/direct_link_generator.py
@@ -43,30 +43,37 @@ def direct_link_generator(link: str):
else:
raise DirectDownloadLinkException(f'No Direct link function found for {link}')
+""" Zippy-Share up-to-date plugin from https://github.com/UsergeTeam/Userge-Plugins/blob/master/plugins/zippyshare.py """
+""" Thanks to all contributors @aryanvikash, rking32, @BianSepang """
+
+link = r'https://www(\d{1,3}).zippyshare.com/v/(\w{8})/file.html'
+regex_result = (
+ r'var a = (\d{6});\s+var b = (\d{6});\s+document\.getElementById'
+ r'\(\'dlbutton\'\).omg = "f";\s+if \(document.getElementById\(\''
+ r'dlbutton\'\).omg != \'f\'\) {\s+a = Math.ceil\(a/3\);\s+} else'
+ r' {\s+a = Math.floor\(a/3\);\s+}\s+document.getElementById\(\'d'
+ r'lbutton\'\).href = "/d/[a-zA-Z\d]{8}/\"\+\(a \+ \d{6}%b\)\+"/('
+ r'[\w%-.]+)";'
+)
def zippy_share(url: str) -> str:
- """ ZippyShare direct links generator
- Based on https://github.com/LameLemon/ziggy"""
- dl_url = ''
- try:
- link = re.findall(r'\bhttps?://.*zippyshare\.com\S+', url)[0]
- except IndexError:
- raise DirectDownloadLinkException("`No ZippyShare links found`\n")
session = requests.Session()
- base_url = re.search('http.+.com', link).group()
- response = session.get(link)
- page_soup = BeautifulSoup(response.content, "lxml")
- scripts = page_soup.find_all("script", {"type": "text/javascript"})
- for script in scripts:
- if "getElementById('dlbutton')" in script.text:
- url_raw = re.search(r'= (?P\".+\" \+ (?P