Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ᴅᴇꜰ ᴄᴍ_ɢᴇᴛ_ɪɴꜰᴏ(ᴜʀʟ):
- ɪᴍᴘᴏʀᴛ ᴊꜱᴏɴ
- ɪᴍᴘᴏʀᴛ ᴜʀʟʟɪʙ.ʀᴇꞯᴜᴇꜱᴛ
- ɪᴍᴘᴏʀᴛ ʀᴇ
- ᴅᴇꜰ ʙᴇᴛwᴇᴇɴ(ꜱᴛᴀʀᴛ, ᴇɴᴅ, ꜱᴛʀɪɴɢ):
- ʀᴇᴛᴜʀɴ ʀᴇ.ꜰɪɴᴅᴀʟʟ(ʀᴇ.ᴇꜱᴄᴀᴘᴇ(ꜱᴛᴀʀᴛ)+'(.*?)'+ʀᴇ.ᴇꜱᴄᴀᴘᴇ(ᴇɴᴅ), ꜱᴛʀɪɴɢ, ꜰʟᴀɢꜱ=ʀᴇ.DOTALL)[0]
- ʜᴇᴀᴅᴇʀꜱ = {
- "Uꜱᴇʀ-Aɢᴇɴᴛ": ʀ"Mᴏzɪʟʟᴀ/5.0 (Wɪɴᴅᴏwꜱ NT 10.0; Wɪɴ64; x64; ʀᴠ:96.0) Gᴇᴄᴋᴏ/20100101 Fɪʀᴇꜰᴏx/96.0"
- }
- ʀᴇꜱᴘ = ᴜʀʟʟɪʙ.ʀᴇꞯᴜᴇꜱᴛ.ᴜʀʟᴏᴘᴇɴ(ᴜʀʟʟɪʙ.ʀᴇꞯᴜᴇꜱᴛ.Rᴇꞯᴜᴇꜱᴛ(ᴜʀʟ, ʜᴇᴀᴅᴇʀꜱ=ʜᴇᴀᴅᴇʀꜱ)).ʀᴇᴀᴅ().ᴅᴇᴄᴏᴅᴇ("UTF-8")
- ᴅᴀᴛᴀ = ʙᴇᴛwᴇᴇɴ('<ꜱᴄʀɪᴘᴛ>wɪɴᴅᴏw.ᴄʟᴏᴜᴅSᴇᴛᴛɪɴɢꜱ =', ';</ꜱᴄʀɪᴘᴛ>', ʀᴇꜱᴘ).ʀᴇᴘʟᴀᴄᴇ('/', ʀ'\/')
- ᴅᴀᴛᴀ = ʀᴇ.ꜱᴜʙ(ʀ'"[^"]+x3ᴄ.*?",', '"",', ᴅᴀᴛᴀ)
- ʀᴇᴛᴜʀɴ ᴊꜱᴏɴ.ʟᴏᴀᴅꜱ(ᴅᴀᴛᴀ)
- ᴅᴇꜰ ᴄᴍ_ɢᴇᴛ_ᴅɪʀᴇᴄᴛ_ʟɪɴᴋ(ᴜʀʟ):
- ᴅᴀᴛᴀ = ᴄᴍ_ɢᴇᴛ_ɪɴꜰᴏ(ᴜʀʟ)
- ʀᴇᴛᴜʀɴ "/".ᴊᴏɪɴ([
- ᴅᴀᴛᴀ["ᴅɪꜱᴘᴀᴛᴄʜᴇʀ"]["wᴇʙʟɪɴᴋ_ɢᴇᴛ"][0]["ᴜʀʟ"],
- ᴅᴀᴛᴀ["ʀᴇꞯᴜᴇꜱᴛ"]["wᴇʙʟɪɴᴋ"]
- ])
- ᴅɪʀᴇᴄᴛ_ʟɪɴᴋ = ᴄᴍ_ɢᴇᴛ_ᴅɪʀᴇᴄᴛ_ʟɪɴᴋ("ʜᴛᴛᴘꜱ://ᴄʟᴏᴜᴅ.ᴍᴀɪʟ.ʀᴜ/ᴘᴜʙʟɪᴄ/5ᴘᴏV/ᴄRDxAʙPEQ")
- ᴘʀɪɴᴛ(ᴅɪʀᴇᴄᴛ_ʟɪɴᴋ)
- <🚫> <�<<:==><no format>
- def cm_get_info(url):
- import json
- import urllib.request
- import re
- def between(start, end, string):
- return re.findall(re.escape(start)+'(.*?)'+re.escape(end), string, flags=re.DOTALL)[0]
- headers = {
- "User-Agent": r"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
- }
- resp = urllib.request.urlopen(urllib.request.Request(url, headers=headers)).read().decode("UTF-8")
- data = between('<script>window.cloudSettings =', ';</script>', resp).replace('/', r'\/')
- data = re.sub(r'"[^"]+x3c.*?",', '"",', data)
- return json.loads(data)
- def cm_get_direct_link(url):
- data = cm_get_info(url)
- return "/".join([
- data["dispatcher"]["weblink_get"][0]["url"],
- data["request"]["weblink"]
- ])
- direct_link = cm_get_direct_link("https://cloud.mail.ru/public/5poV/cRDxAbPEQ")
- print(direct_link)
Add Comment
Please, Sign In to add comment