Skip to content

Commit

Permalink
add support pcloud.
Browse files Browse the repository at this point in the history
  • Loading branch information
junedkh committed Nov 10, 2023
1 parent 7c84d13 commit caa816a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ In each single file there is a major change from base code, it's almost totally
- Extract these filetypes
> ZIP, RAR, TAR, 7z, ISO, WIM, CAB, GZIP, BZIP2, APM, ARJ, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RPM, SquashFS, UDF, VHD, XAR, Z, TAR.XZ
- Direct links Supported:
> mediafire (file/folders), hxfile.co, streamtape.com, streamsb.net, streamhub.ink, streamvid.net, doodstream.com, feurl.com, upload.ee, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), filelions.com, streamwish.com, send.cm (file/folders), solidfiles.com, linkbox.to (file/folders), shrdsk.me (sharedisk.io), akmfiles.com, wetransfer.com, gofile.io (file/folders), easyupload.io, mdisk.me (with ytdl), terabox.com (file/folders) (you need to add cookies txt with name) [terabox.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl).
> mediafire (file/folders), hxfile.co, streamtape.com, streamsb.net, streamhub.ink, streamvid.net, doodstream.com, feurl.com, upload.ee, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), filelions.com, streamwish.com, send.cm (file/folders), solidfiles.com, linkbox.to (file/folders), shrdsk.me (sharedisk.io), akmfiles.com, wetransfer.com, pcloud.link, gofile.io (file/folders), easyupload.io, mdisk.me (with ytdl), terabox.com (file/folders) (you need to add cookies txt with name) [terabox.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl).
# How to deploy?

Expand Down
14 changes: 13 additions & 1 deletion bot/helper/mirror_utils/download_utils/direct_link_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def direct_link_generator(link):
return streamvid(link)
elif "shrdsk.me" in domain:
return shrdsk(link)
elif "u.pcloud.link" in domain:
return pcloud(link)
elif any(x in domain for x in ["akmfiles.com", "akmfls.xyz"]):
return akmfiles(link)
elif any(
Expand Down Expand Up @@ -634,7 +636,7 @@ def filepress(url):
"id": res2["data"],
"method": "publicUserDownlaod",
}
api2 = f"https://new2.filepress.store/api/file/downlaod2/"
api2 = "https://new2.filepress.store/api/file/downlaod2/"
res = session.post(
api2,
headers={"Referer": f"{raw.scheme}://{raw.hostname}"},
Expand Down Expand Up @@ -1508,3 +1510,13 @@ def streamhub(url):
if error := html.xpath('//div[@class="alert alert-danger"]/text()[2]'):
raise DirectDownloadLinkException(f"ERROR: {error[0]}")
raise DirectDownloadLinkException("ERROR: direct link not found!")

def pcloud(url):
with create_scraper() as session:
try:
res = session.get(url)
except Exception as e:
raise DirectDownloadLinkException(f"ERROR: {e.__class__.__name__}")
if link := findall(r'.downloadlink.:..(https:.*)..', res.text):
return link[0].replace('\/', '/')
raise DirectDownloadLinkException("ERROR: Direct link not found")

0 comments on commit caa816a

Please sign in to comment.