1 Star 0 Fork 0

默一/XueHaiDevKeygen

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
默一 提交于 2020-11-28 22:42 . add cli version, add http auth
from flask import Flask
import datetime, base64, hashlib
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__)
app.config["SECRET_KEY"] = "PaSsw0rD@1234!@#$"
auth = HTTPBasicAuth()
users = {
"admin": "password"
}
@auth.get_password
def get_pw(username):
if username in users:
return users.get(username)
return None
@app.route('/',methods=['GET'])
@auth.login_required
def main():
resp = "nothing"
try:
cur = datetime.datetime.now()
year = cur.year
month = cur.month
day = cur.day
hour = cur.hour
xhstr = "xuehai%d&zhitongyun%d$100fen%d@%d" % (year, month, day, hour)
base64ed = base64.b64encode(xhstr.encode('UTF-8'))
md5ed = hashlib.md5(base64ed+b'\n').hexdigest()
if 12 <= hour and hour <= 24:
resp = md5ed[16:32]
else:
resp = md5ed[0:16]
except:
resp = "error"
return resp
if __name__ == '__main__':
app.run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nekomoyi/xue-hai-dev-keygen.git
[email protected]:nekomoyi/xue-hai-dev-keygen.git
nekomoyi
xue-hai-dev-keygen
XueHaiDevKeygen
master

搜索帮助