fix: Decode website for displaying
This commit is contained in:
parent
24544fc115
commit
90a86c2769
12
sites/db.py
12
sites/db.py
@ -1,6 +1,7 @@
|
|||||||
import mysql.connector
|
import mysql.connector
|
||||||
import os
|
import os
|
||||||
import dotenv
|
import dotenv
|
||||||
|
import json
|
||||||
|
|
||||||
dotenv.load_dotenv()
|
dotenv.load_dotenv()
|
||||||
|
|
||||||
@ -23,5 +24,12 @@ def get_website_data(domain):
|
|||||||
connection.close()
|
connection.close()
|
||||||
|
|
||||||
if data == []:
|
if data == []:
|
||||||
return ""
|
return "No data found for this domain"
|
||||||
return data[0][2]
|
|
||||||
|
parsed = data[0][2]
|
||||||
|
parsed = json.loads(parsed)
|
||||||
|
parsed = parsed['data']
|
||||||
|
# Decoding
|
||||||
|
parsed = parsed.encode('utf-8').decode('unicode-escape')
|
||||||
|
|
||||||
|
return parsed
|
Loading…
Reference in New Issue
Block a user