mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-07 03:26:46 +08:00
support password mediafire folder
this will works only if every file has same password.
This commit is contained in:
parent
fb3804cdfc
commit
66a57bc0ee
@ -1048,6 +1048,11 @@ def gofile(url):
|
||||
|
||||
|
||||
def mediafireFolder(url):
|
||||
if "::" in url:
|
||||
_password = url.split("::")[-1]
|
||||
url = url.split("::")[-2]
|
||||
else:
|
||||
_password = ""
|
||||
try:
|
||||
raw = url.split("/", 4)[-1]
|
||||
folderkey = raw.split("/", 1)[0]
|
||||
@ -1109,6 +1114,17 @@ def mediafireFolder(url):
|
||||
html = HTML(session.get(url).text)
|
||||
except:
|
||||
return
|
||||
if html.xpath("//div[@class='passwordPrompt']"):
|
||||
if not _password:
|
||||
raise DirectDownloadLinkException(
|
||||
f"ERROR: {PASSWORD_ERROR_MESSAGE}".format(url)
|
||||
)
|
||||
try:
|
||||
html = HTML(session.post(url, data={"downloadp": _password}).text)
|
||||
except:
|
||||
return
|
||||
if html.xpath("//div[@class='passwordPrompt']"):
|
||||
return
|
||||
if final_link := html.xpath("//a[@id='downloadButton']/@href"):
|
||||
return final_link[0]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user