fix: Decode website for displaying
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s
Build Docker / Build SLDs Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-08 22:14:06 +11:00
parent 24544fc115
commit 90a86c2769
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -1,6 +1,7 @@
import mysql.connector
import os
import dotenv
import json
dotenv.load_dotenv()
@ -23,5 +24,12 @@ def get_website_data(domain):
connection.close()
if data == []:
return ""
return data[0][2]
return "No data found for this domain"
parsed = data[0][2]
parsed = json.loads(parsed)
parsed = parsed['data']
# Decoding
parsed = parsed.encode('utf-8').decode('unicode-escape')
return parsed