Skip to content

Commit

Permalink
Merge pull request #1644 from primeakash/master
Browse files Browse the repository at this point in the history
🆕 Add tmpsend.com support
  • Loading branch information
anasty17 authored Dec 26, 2023
2 parents 32f0b53 + ef6290c commit 4281fc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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, 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?

Expand Down
17 changes: 17 additions & 0 deletions bot/helper/mirror_utils/download_utils/direct_link_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")

0 comments on commit 4281fc2

Please sign in to comment.