Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,22 +3,19 @@ import importlib.util
|
|
3 |
import sys
|
4 |
import os
|
5 |
from io import StringIO
|
6 |
-
import requests
|
7 |
-
from flask import Flask, send_file, redirect
|
8 |
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
def home():
|
13 |
-
url = "https://cdn.discordapp.com/attachments/1278553136138817549/1352832525646692392/image.png?ex=67e95638&is=67e804b8&hm=55d6ca3711e2625beaf4a60762ca31f56149ba7e9167aef37450528c0fe8493b&"
|
14 |
-
response = requests.get(url)
|
15 |
-
return response.content, 200, {'Content-Type': 'image/png'}
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
url = "https://cdn.discordapp.com/attachments/1278553136138817549/1352832525646692392/image.png?ex=67e95638&is=67e804b8&hm=55d6ca3711e2625beaf4a60762ca31f56149ba7e9167aef37450528c0fe8493b&"
|
20 |
-
response = requests.get(url)
|
21 |
-
return response.content, 200, {'Content-Type': 'image/png'}
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import sys
|
4 |
import os
|
5 |
from io import StringIO
|
|
|
|
|
6 |
|
7 |
+
secret_token = os.environ.get('token')
|
8 |
|
9 |
+
url = f"https://scriptprivate.deno.dev/{secret_token}/raw"
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
response = urllib.request.urlopen(url)
|
12 |
+
script_content = response.read().decode('utf-8')
|
|
|
|
|
|
|
13 |
|
14 |
+
spec = importlib.util.spec_from_loader("remote_module", loader=None)
|
15 |
+
remote_module = importlib.util.module_from_spec(spec)
|
16 |
+
|
17 |
+
exec(script_content, remote_module.__dict__)
|
18 |
+
|
19 |
+
sys.modules["remote_module"] = remote_module
|
20 |
+
|
21 |
+
app = remote_module.app
|