分享给别人使用,简单功能和限制数量
@app.route("/getmd/", methods=['POST', 'GET'])
def getmd():
if request.method == 'POST' and request.form['passkey'] == make_passkey('262235.xyz') :
urls = request.form['urls']
urls_list = check_urls(urls)
urls = urls_lines(urls_list)
if len(urls_list) < 5 :
texts = '测试 PASSKEY 一次只允许最多抓取5篇文章,当前数量:' + str(len(urls_list)) + '\n'
texts += pull_urls(urls_list)
return render_template('getmd.html', urls=urls, texts=texts)
else:
texts = '文章大于5: 测试 PASSKEY 一次只允许最多抓取5篇文章,当前数量:' + str(len(urls_list)) + '\n'
return render_template('getmd.html', urls=urls, texts=texts)
else:
if request.method == 'POST' and request.form['passkey'] == 'UUID-1234-5678-1234' :
urls = request.form['urls']
urls_list = check_urls(urls)
urls = urls_lines(urls_list)
texts = '授权 PASSKEY 无限制,当前数量:' + str(len(urls_list)) + '\n'
texts += pull_urls(urls_list)
return render_template('getmd.html', urls=urls, texts=texts)
pass
return render_template('getmd.html', passkey=make_passkey('262235.xyz'))
授权 PASSKEY 无限制,当然是自己使用,高级功能了