Fix typo in direct_link_generator.py

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-03-22 15:48:14 +05:30
parent b4b0dcd3f8
commit d6a513e77b

View File

@ -5,13 +5,15 @@
# #
""" Helper Module containing various sites direct links generators""" """ Helper Module containing various sites direct links generators"""
from os import popen import json
import re import re
import urllib.parse import urllib.parse
import json from os import popen
from random import choice from random import choice
import requests import requests
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from bot.helper.ext_utils.exceptions import DirectDownloadLinkException from bot.helper.ext_utils.exceptions import DirectDownloadLinkException
@ -32,7 +34,7 @@ def direct_link_generator(link: str):
elif 'mediafire.com' in link: elif 'mediafire.com' in link:
return mediafire(link) return mediafire(link)
elif 'sourceforge.net' in link: elif 'sourceforge.net' in link:
return sourceforge(link) return sourceforge(link)
elif 'osdn.net' in link: elif 'osdn.net' in link:
return osdn(link) return osdn(link)
elif 'github.com' in link: elif 'github.com' in link:
@ -40,8 +42,7 @@ def direct_link_generator(link: str):
elif 'androidfilehost.com' in link: elif 'androidfilehost.com' in link:
return androidfilehost(link) return androidfilehost(link)
else: else:
raise DirectDownloadLinkException(re.findall(r"\bhttps?://(.*?[^/]+)", raise DirectDownloadLinkException(f'No Direct link function found for {link}')
link)[0] + 'is not supported')
def gdrive(url: str) -> str: def gdrive(url: str) -> str: