-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import requests | ||
import json | ||
|
||
''' | ||
作者:www.wrnxr.cc | ||
''' | ||
|
||
print('欢迎访问www.wrnxr.cc,更多资源等着您') | ||
|
||
url='http://data.zz.baidu.com/urls?' | ||
headers={'Content-Type':'text/plain'} | ||
u=str(input(r'请输入您的站点地址,不要带http(s):')) | ||
key=(input('请输入您的准入秘钥:')) | ||
playload={'site':(u),'token':(key)} | ||
with open("url.txt", "rb") as f: | ||
result=requests.post(url,data=f,params=playload,headers=headers) | ||
jr=json.loads(result.text) | ||
if 'error' in jr: | ||
er=jr['error'] | ||
msg=jr['message'] | ||
if 'token is not valid' in msg: | ||
msg=('准入秘钥错误,请检查后重试') | ||
elif 'empty content' in msg: | ||
msg=('需要提交的链接为空,请检查url.txt后重试') | ||
elif 'site init fail' in msg: | ||
msg=('站点初始化失败,请检查站点地址是否正确') | ||
print('错误代码:',er, | ||
'\n返回信息:',msg) | ||
input('按enter退出') | ||
else: | ||
rm=jr['remain'] | ||
su=jr['success'] | ||
|
||
print ('提交成功',su,'条链接\n' | ||
'剩余',rm,'条可提交') | ||
input('按enter退出') |