Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock committed Feb 18, 2024
1 parent 72e64f9 commit c5137ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ def edit_temp_json():

@app.route('/config/<path:url>', methods=['GET'])
def config(url):
'''
user_agent = request.headers.get('User-Agent')
if 'TelegramBot (like TwitterBot)' in user_agent:
return Response(json.dumps({'status': 'error', 'message': 'block'}, indent=4, ensure_ascii=False),
content_type='application/json; charset=utf-8', status=403)
if any(substring in url for substring in ['sing-box-subscribe.vercel.app', 'https:/https:/', 'xxxx',
'%E6%9C%BA%E5%9C%BA', '%E8%AE%A2%E9%98%85', '%E5%9C%B0%E5%9D%80']):
return Response(json.dumps({'status': 'error', 'message_CN': '填写参数不符合规范'}, indent=4,ensure_ascii=False), content_type='application/json; charset=utf-8', status=500)
'''
# temp_json_data_str = os.environ['TEMP_JSON_DATA']
# temp_json_data = json.loads(temp_json_data_str)
temp_json_data = json.loads('{"subscribes":[{"url":"URL","tag":"tag_1","enabled":true,"emoji":1,"subgroup":"","prefix":"","User-Agent":"v2rayng"},{"url":"URL","tag":"tag_2","enabled":false,"emoji":0,"subgroup":"命名/named","prefix":"❤️","User-Agent":"clashmeta"},{"url":"URL","tag":"tag_3","enabled":false,"emoji":1,"subgroup":"","prefix":"","User-Agent":"v2rayng"}],"auto_set_outbounds_dns":{"proxy":"","direct":""},"save_config_path":"./config.json","auto_backup":false,"exclude_protocol":"ssr","config_template":"","Only-nodes":false}')
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def process_subscribes(subscribes):
for subscribe in subscribes:
if 'enabled' in subscribe and not subscribe['enabled']:
continue
if 'sing-box-subscribe.vercel.app' in subscribe['url']:
if 'sing-box-subscribe-doraemon.vercel.app' in subscribe['url']:
continue
_nodes = get_nodes(subscribe['url'])
if _nodes and len(_nodes) > 0:
Expand Down

0 comments on commit c5137ef

Please sign in to comment.