diff --git a/app.py b/app.py
index 5aba11b..93f7521 100644
--- a/app.py
+++ b/app.py
@@ -220,7 +220,7 @@ def start_pool():
def sitemap():
conn = pool.acquire()
cur = conn.cursor()
- cur.execute('select distinct trunc(pg/40000)+1 nm from mv_pages');
+ cur.execute('select distinct trunc(pg/40000)+1 nm from mv_pages')
nm = cur.fetchall()
return render_template('sitemap.xml', site=site, siten=nm)
@@ -332,7 +332,9 @@ def detail_vin(vin):
user_ip = get_ip(request) ## определение ip клиента
try:
returnVal = cur.callfunc("checkip", int, [user_ip, request.headers.get("CF-IPCountry", 'None'), get_addr(user_ip), 0, 0, 1])
- except:
+ if returnVal == 1:
+ return redirect('/rate_limit.html', 301)
+ except Exception as e:
print(request)
logger.error(traceback.format_exc())
@@ -376,7 +378,8 @@ def search():
conn = pool.acquire()
cur = conn.cursor()
returnVal = cur.callfunc("checkip", int, [user_ip, request.headers.get("CF-IPCountry", 'None'), get_addr(user_ip), 0, 1, 0])
-
+ if returnVal == 1:
+ return redirect('/rate_limit.html', 301)
cur.execute("""select 'None', COALESCE((select value from m_JSONS_FROM_NHTSA v3 where v3.svin =s.svin and v3.variableid ='26'),(select val from vind2 where svin = substr(s.vin, 1, 8) || '*' || substr(s.vin, 10, 2) and varb = 'Make'),'UNKNOWN') make,
COALESCE((select value from m_JSONS_FROM_NHTSA v3 where v3.svin =s.svin and v3.variableid ='28'),(select val from vind2 where svin = substr(s.vin, 1, 8) || '*' || substr(s.vin, 10, 2) and varb = 'Model'),'UNKNOWN') model,
COALESCE((select value from m_JSONS_FROM_NHTSA v3 where v3.svin =s.svin and v3.variableid ='29'),(select val from vind2 where svin = substr(s.vin, 1, 8) || '*' || substr(s.vin, 10, 2) and varb = 'Model Year'),'UNKNOWN') year,
@@ -398,6 +401,10 @@ def search():
logger.error(traceback.format_exc())
return 'bad request!', 500
+@app.route("/rate_limit.html")
+def rate_limit_html():
+ return render_template('rate_limit.html', site=site)
+
## API
@app.route("/api/search")
def api_search():
diff --git a/static/qr_telegram.png b/static/qr_telegram.png
new file mode 100644
index 0000000..62ae8b9
Binary files /dev/null and b/static/qr_telegram.png differ
diff --git a/static/qr_telegram2.png b/static/qr_telegram2.png
new file mode 100644
index 0000000..14d0636
Binary files /dev/null and b/static/qr_telegram2.png differ
diff --git a/telegram_bot.py b/telegram_bot.py
deleted file mode 100644
index 4194269..0000000
--- a/telegram_bot.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import os
-import requests
-from flask import Flask
-from telegram import Update, Bot
-from telegram.ext import CommandHandler, CallbackContext, ApplicationBuilder
-
-app = Flask(__name__)
-TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN' # Замените на ваш токен
-
-async def start(update: Update, context: CallbackContext) -> None:
- await update.message.reply_text('Привет! Используйте /decode
- Please try again later or contact us if you need a business solution. + Please try again later or use our Telegram bot.
-