pyscriptbase 1.1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/PKG-INFO +1 -1
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/script.py +13 -4
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/PKG-INFO +1 -1
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/setup.py +1 -1
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/README.md +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/__init__.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/app.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/cipher.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/database.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/env.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/net.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/panel.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/pusher.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/util.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase/webview.py +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/SOURCES.txt +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/dependency_links.txt +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/requires.txt +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/pyscriptbase.egg-info/top_level.txt +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/setup.cfg +0 -0
- {pyscriptbase-1.1.1 → pyscriptbase-1.1.2}/test/test.py +0 -0
|
@@ -2,6 +2,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
2
2
|
from traceback import format_exc
|
|
3
3
|
from . import net
|
|
4
4
|
from . import database
|
|
5
|
+
import random
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class ScriptApp:
|
|
@@ -12,8 +13,10 @@ class ScriptApp:
|
|
|
12
13
|
self,
|
|
13
14
|
index: int = 1,
|
|
14
15
|
useProxy: bool = True,
|
|
16
|
+
randomProxy: bool = False,
|
|
15
17
|
debug: bool = False,
|
|
16
18
|
useCloud: bool = True,
|
|
19
|
+
randomCloud: bool = False,
|
|
17
20
|
) -> None:
|
|
18
21
|
self.index = index
|
|
19
22
|
self.logs = []
|
|
@@ -21,6 +24,8 @@ class ScriptApp:
|
|
|
21
24
|
self.net = net.NetRequest()
|
|
22
25
|
self.cloudNet = net.CloudRequest()
|
|
23
26
|
self.cloudNet.net = self.net
|
|
27
|
+
self.randomProxy = randomProxy
|
|
28
|
+
self.randomCloud = randomCloud
|
|
24
29
|
useProxy and self.__setProxy__(index)
|
|
25
30
|
useCloud and self.__setCloudProxy__(index)
|
|
26
31
|
|
|
@@ -57,7 +62,10 @@ class ScriptApp:
|
|
|
57
62
|
except:
|
|
58
63
|
ScriptApp._proxies = [None]
|
|
59
64
|
if len(ScriptApp._proxies):
|
|
60
|
-
self.
|
|
65
|
+
if self.randomProxy:
|
|
66
|
+
self.net.proxies = random.choice(ScriptApp._proxies)
|
|
67
|
+
else:
|
|
68
|
+
self.net.proxies = ScriptApp._proxies[index % len(ScriptApp._proxies)]
|
|
61
69
|
|
|
62
70
|
def __setCloudProxy__(self, index: int) -> None:
|
|
63
71
|
config = database.getDataConfig("account", "cloud_proxy")
|
|
@@ -84,9 +92,10 @@ class ScriptApp:
|
|
|
84
92
|
except:
|
|
85
93
|
ScriptApp._cloudProxies = []
|
|
86
94
|
if len(ScriptApp._cloudProxies):
|
|
87
|
-
self.
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
if self.randomCloud:
|
|
96
|
+
self.cloudNet.cloud = random.choice(ScriptApp._cloudProxies)
|
|
97
|
+
else:
|
|
98
|
+
self.cloudNet.cloud = ScriptApp._cloudProxies[index % len(ScriptApp._cloudProxies)]
|
|
90
99
|
|
|
91
100
|
def __log__(self, msg: str | dict = "", flush: bool = False):
|
|
92
101
|
if flush or self.debug:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|