Spaces:
Running
Running
Create app.py
Browse files
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
|