jerrrycans commited on
Commit
65d6b4c
·
verified ·
1 Parent(s): f7681ad

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import urllib.request
2
+ import importlib.util
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