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 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