From ef6290cb8b76a577be9c26d411b0eae991dd347a Mon Sep 17 00:00:00 2001 From: primeakash <85863795+primeakash@users.noreply.github.com> Date: Wed, 27 Dec 2023 02:27:31 +0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20Add=20tmpsend.com=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: primeakash <85863795+primeakash@users.noreply.github.com> --- README.md | 2 +- .../download_utils/direct_link_generator.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef82bbbca33..40020d4324f 100644 --- a/README.md +++ b/README.md @@ -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, 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). + > 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), tmpsend.com, 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? 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 bfb5b40cb3c..354b04fb4c8 100644 --- a/bot/helper/mirror_utils/download_utils/direct_link_generator.py +++ b/bot/helper/mirror_utils/download_utils/direct_link_generator.py @@ -55,6 +55,8 @@ def direct_link_generator(link): return gofile(link) elif "send.cm" in domain: return send_cm(link) + elif "tmpsend.com" in domain: + return tmpsend(link) elif "easyupload.io" in domain: return easyupload(link) elif "streamvid.net" in domain: @@ -1472,3 +1474,18 @@ def pcloud(url): if link := findall(r".downloadlink.:..(https:.*)..", res.text): return link[0].replace("\/", "/") raise DirectDownloadLinkException("ERROR: Direct link not found") + + +def tmpsend(url): + pattern = r"https://tmpsend.com/(\w+)$" + match = search(pattern, url) + + if match: + file_id = match.group(1) + referer_url = f"https://tmpsend.com/thank-you?d={file_id}" + header = f"Referer: {referer_url}" + download_link = f"https://tmpsend.com/download?d={file_id}" + return download_link, header + else: + raise DirectDownloadLinkException("ERROR: Invalid URL format") + \ No newline at end of file