support password mediafire folder

this will works only if every file has same password.
This commit is contained in:
Juned KH 2024-07-25 13:24:19 +05:30
parent fb3804cdfc
commit 66a57bc0ee

View File

@ -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]