前几天正好完美88邮箱开放注册,就注册了一个挺靓的[email protected]。突然想到好像qq邮箱也支持别名,但一个个去试哪些没被注册有些麻烦,就试图用python偷个小懒。
查询邮箱别名是否可用的请求地址用chromeF12看一下就好了,大致长这样:https://mail.qq.com/cgi-bin/register?check_tmpl=add_alias&sid=***-&action=framecheck&alias=***&verifycode=。直接使用这个地址去查会提示cookie失效。那简单,把cookie也带上就行了,cookie的获取方法可以在浏览器发出的请求信息中看到,复制过来就行了。然后我们根据返回页面的特征判断查询的别名是否有效就行了。以下附上代码:
import requests
import time
def func(alias):
tf="恭喜你,该邮箱帐号还没有被使用"
ft="该邮箱帐号已经被占用"
url=r""#自己填写
cookie_str = r''#自己填写
cookies = {}
for line in cookie_str.split(';'):
key, value = line.split('=', 1)
cookies[key] = value
headers = {'User-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'}
resp = requests.get(url, headers = headers, cookies = cookies)
res=resp.content.decode('gbk')
if(res.find(tf)!=-1):
return 1
if(res.find(ft)!=-1):
return 0
return -1
func("aliasABC123")
当然,这个查询接口是有频率限制的,2秒查一次应该就没问题了,放服务器上慢慢跑吧




Warning: A non-numeric value encountered in /www/wwwroot/i.pegasi.top/wp-content/themes/begin/inc/function/comment-template.php on line 31
2023年11月25日 15:45 -49楼
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/wwwroot/i.pegasi.top/wp-content/themes/begin/inc/function/setting.php on line 1367
2026年02月25日 00:47 -48楼
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/wwwroot/i.pegasi.top/wp-content/themes/begin/inc/function/setting.php on line 1367
2026年02月25日 00:49 -47楼
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/wwwroot/i.pegasi.top/wp-content/themes/begin/inc/function/setting.php on line 1367