swiftshadow 2.2.1__tar.gz → 2.3.0__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.
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/PKG-INFO +1 -1
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Getting Started/Using-Proxy-Class.md +17 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/pyproject.toml +1 -1
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/__init__.py +1 -1
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/classes.py +27 -5
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/helpers.py +11 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/providers.py +31 -12
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/tests/test_proxy.py +9 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/uv.lock +1 -1
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/.github/CODEOWNERS +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/.github/workflows/python-publish-manual.yml +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/.github/workflows/python-publish.yml +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/.gitignore +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/.python-version +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/LICENSE +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/README.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/404.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Classes/proxyInterface/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Classes/quickProxy/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Models/cache-data/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Models/provider/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Models/proxy/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Getting Started/Usage-In-Async-Environments/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Getting Started/Using-Proxy-Class/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Getting Started/Using-QuickProxy/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Getting Started/examples/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Use Swiftshadow with/AWS-Lambda/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Use Swiftshadow with/https/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Use Swiftshadow with/requests/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/_mkdocstrings.css +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/images/favicon.png +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/bundle.60a45f97.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/bundle.60a45f97.min.js.map +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ar.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.da.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.de.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.du.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.el.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.es.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.fi.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.fr.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.he.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.hi.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.hu.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.hy.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.it.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ja.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.jp.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.kn.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ko.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.multi.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.nl.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.no.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.pt.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ro.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ru.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.sa.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.sv.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.ta.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.te.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.th.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.tr.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.vi.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.zh.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/tinyseg.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/wordcut.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/workers/search.f8cc74c7.min.js +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/workers/search.f8cc74c7.min.js.map +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/logo.png +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/stylesheets/main.a40c8224.min.css +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/stylesheets/main.a40c8224.min.css.map +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/stylesheets/palette.06af60db.min.css +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/stylesheets/palette.06af60db.min.css.map +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/objects.inv +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/providers/index.html +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/search/search_index.json +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/sitemap.xml +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/sitemap.xml.gz +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/API Reference/Classes/proxyInterface.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/API Reference/Classes/quickProxy.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/API Reference/Models/cache-data.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/API Reference/Models/provider.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/API Reference/Models/proxy.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Getting Started/Usage-In-Async-Environments.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Getting Started/Using-QuickProxy.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Getting Started/examples.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Use Swiftshadow with/AWS-Lambda.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Use Swiftshadow with/https.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Use Swiftshadow with/requests.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/assets/logo.png +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/index.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/providers.md +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/mkdocs.yml +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/cache.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/exceptions.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/models.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/types.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/swiftshadow/validator.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/tests/test_models.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/tests/test_quickproxy.py +0 -0
- {swiftshadow-2.2.1 → swiftshadow-2.3.0}/tox.ini +0 -0
@@ -45,6 +45,23 @@ swift = ProxyInterface(protocol='https')
|
|
45
45
|
|
46
46
|
---
|
47
47
|
|
48
|
+
# Selecting Providers
|
49
|
+
|
50
|
+
Swiftshadow allows the user to select only specific Providers from a list of available Providers to circumvent trying to fetch proxies from unavailable Providers. If you come across a Provider that is consistently failing please make sure to report it on the GitHub for its removal or remedy.
|
51
|
+
|
52
|
+
Providers can be imported as needed from the available ones in `swiftshadow.providers`
|
53
|
+
|
54
|
+
```python title="Provider Selection"
|
55
|
+
from swiftshadow.classes import ProxyInterface
|
56
|
+
from swiftshadow.providers import Monosans
|
57
|
+
|
58
|
+
swift = ProxyInterface(selectedProviders=[Monosans])
|
59
|
+
print(swift.get())
|
60
|
+
```
|
61
|
+
|
62
|
+
---
|
63
|
+
|
64
|
+
|
48
65
|
# Proxy Rotation
|
49
66
|
|
50
67
|
## Manual Rotation
|
@@ -19,7 +19,7 @@ def QuickProxy(
|
|
19
19
|
Returns:
|
20
20
|
proxyObject (Proxy): A working proxy object if found or else None.
|
21
21
|
"""
|
22
|
-
for provider in Providers:
|
22
|
+
for provider in Providers.values():
|
23
23
|
if protocol not in provider.protocols:
|
24
24
|
continue
|
25
25
|
if (len(countries) != 0) and (not provider.countryFilter):
|
@@ -5,16 +5,17 @@ from pathlib import Path
|
|
5
5
|
from pickle import dump, dumps, load, loads
|
6
6
|
from random import choice
|
7
7
|
from sys import stdout
|
8
|
-
from typing import Literal
|
8
|
+
from typing import Literal, Any, Callable, Coroutine
|
9
9
|
|
10
10
|
import aiofiles
|
11
11
|
from appdirs import user_cache_dir
|
12
12
|
|
13
13
|
from swiftshadow.cache import checkExpiry, getExpiry
|
14
14
|
from swiftshadow.exceptions import UnsupportedProxyProtocol
|
15
|
-
from swiftshadow.
|
15
|
+
from swiftshadow.helpers import deduplicateProxies
|
16
|
+
from swiftshadow.models import CacheData, Provider
|
16
17
|
from swiftshadow.models import Proxy as Proxy
|
17
|
-
from swiftshadow.providers import Providers
|
18
|
+
from swiftshadow.providers import Providers as ProvidersMap
|
18
19
|
|
19
20
|
logger = getLogger("swiftshadow")
|
20
21
|
logger.setLevel(INFO)
|
@@ -34,6 +35,7 @@ class ProxyInterface:
|
|
34
35
|
Attributes:
|
35
36
|
countries (list[str]): List of ISO country codes to filter proxies by (e.g., ["US", "CA"]).
|
36
37
|
protocol (Literal['https', 'http']): Proxy protocol to use. Defaults to 'http'.
|
38
|
+
selectedProviders (Callable[[list[str], Literal["http", "https"]], Coroutine[Any, Any, list[Proxy]]]]): Selected list of providers to fetch proxies from. Defaults to empty meaning all available Providers.
|
37
39
|
maxproxies (int): Maximum number of proxies to collect from providers. Defaults to 10.
|
38
40
|
autorotate (bool): Whether to automatically rotate proxy on each get() call. Defaults to False.
|
39
41
|
autoUpdate (bool): Whether to automatically update proxies upon class initalisation. Defaults to True.
|
@@ -62,6 +64,11 @@ class ProxyInterface:
|
|
62
64
|
self,
|
63
65
|
countries: list[str] = [],
|
64
66
|
protocol: Literal["https", "http"] = "http",
|
67
|
+
selectedProviders: list[
|
68
|
+
Callable[
|
69
|
+
[list[str], Literal["http", "https"]], Coroutine[Any, Any, list[Proxy]]
|
70
|
+
]
|
71
|
+
] = [],
|
65
72
|
maxProxies: int = 10,
|
66
73
|
autoRotate: bool = False,
|
67
74
|
autoUpdate: bool = True,
|
@@ -75,6 +82,7 @@ class ProxyInterface:
|
|
75
82
|
Args:
|
76
83
|
countries: List of ISO country codes to filter proxies. Empty list = no filtering.
|
77
84
|
protocol: Proxy protocol to retrieve. Choose between 'http' or 'https'.
|
85
|
+
selectedProviders (list[Providers]): Selected list of providers to fetch proxies from. Defaults to empty meaning all available Providers.
|
78
86
|
maxProxies: Maximum proxies to collect from all providers combined.
|
79
87
|
autoRotate: Enable automatic proxy rotation on every get() call.
|
80
88
|
autoUpdate (bool): Whether to automatically update proxies upon class initalisation.
|
@@ -93,6 +101,18 @@ class ProxyInterface:
|
|
93
101
|
} is not supported by swiftshadow, please choose between HTTP or HTTPS"
|
94
102
|
)
|
95
103
|
self.protocol: Literal["https", "http"] = protocol
|
104
|
+
if selectedProviders != []:
|
105
|
+
providers: list[Provider] = []
|
106
|
+
for i in selectedProviders:
|
107
|
+
try:
|
108
|
+
providers.append(ProvidersMap[i])
|
109
|
+
except KeyError:
|
110
|
+
raise ValueError(
|
111
|
+
f"Unkown provider {i.__name__} in the list of Selected Providers."
|
112
|
+
)
|
113
|
+
self.providers: list[Provider] = providers
|
114
|
+
else:
|
115
|
+
self.providers: list[Provider] = list(ProvidersMap.values())
|
96
116
|
|
97
117
|
self.maxproxies: int = maxProxies
|
98
118
|
self.autorotate: bool = autoRotate
|
@@ -161,7 +181,7 @@ class ProxyInterface:
|
|
161
181
|
|
162
182
|
self.proxies = []
|
163
183
|
|
164
|
-
for provider in
|
184
|
+
for provider in self.providers:
|
165
185
|
if self.protocol not in provider.protocols:
|
166
186
|
continue
|
167
187
|
if (len(self.countries) != 0) and (not provider.countryFilter):
|
@@ -184,6 +204,7 @@ class ProxyInterface:
|
|
184
204
|
raise ValueError("No proxies were found for the current filter settings. Tip: https proxies can be rare; recommend setting protocol to http")
|
185
205
|
raise ValueError("No proxies were found for the current filter settings.")
|
186
206
|
|
207
|
+
self.proxies = deduplicateProxies(self.proxies)
|
187
208
|
async with aiofiles.open(
|
188
209
|
self.cacheFolderPath.joinpath("swiftshadow.pickle"), "wb+"
|
189
210
|
) as cacheFile:
|
@@ -232,7 +253,7 @@ class ProxyInterface:
|
|
232
253
|
|
233
254
|
self.proxies = []
|
234
255
|
|
235
|
-
for provider in
|
256
|
+
for provider in self.providers:
|
236
257
|
if self.protocol not in provider.protocols:
|
237
258
|
continue
|
238
259
|
if (len(self.countries) != 0) and (not provider.countryFilter):
|
@@ -253,6 +274,7 @@ class ProxyInterface:
|
|
253
274
|
if len(self.proxies) == 0:
|
254
275
|
raise ValueError("No proxies were found for the current filter settings.")
|
255
276
|
|
277
|
+
self.proxies = deduplicateProxies(self.proxies)
|
256
278
|
with open(
|
257
279
|
self.cacheFolderPath.joinpath("swiftshadow.pickle"), "wb+"
|
258
280
|
) as cacheFile:
|
@@ -46,3 +46,14 @@ async def GenericPlainTextProxyProvider(
|
|
46
46
|
proxies: list[Proxy] = plaintextToProxies(raw, protocol=protocol)
|
47
47
|
results = await validate_proxies(proxies)
|
48
48
|
return results
|
49
|
+
|
50
|
+
|
51
|
+
def deduplicateProxies(proxies: list[Proxy]) -> list[Proxy]:
|
52
|
+
seen: list[str] = []
|
53
|
+
final: list[Proxy] = []
|
54
|
+
for proxy in proxies:
|
55
|
+
proxy_str: str = proxy.as_string()
|
56
|
+
if proxy_str not in seen:
|
57
|
+
final.append(proxy)
|
58
|
+
seen.append(proxy_str)
|
59
|
+
return final
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Literal
|
1
|
+
from typing import Any, Callable, Coroutine, Literal
|
2
2
|
import aiohttp
|
3
3
|
|
4
4
|
from requests import get
|
@@ -168,18 +168,37 @@ async def ProxyDB(
|
|
168
168
|
return proxies
|
169
169
|
|
170
170
|
|
171
|
-
Providers:
|
172
|
-
|
173
|
-
Provider
|
174
|
-
|
175
|
-
Provider(
|
176
|
-
|
171
|
+
Providers: dict[
|
172
|
+
Callable[[list[str], Literal["http", "https"]], Coroutine[Any, Any, list[Proxy]]],
|
173
|
+
Provider,
|
174
|
+
] = {
|
175
|
+
ProxyScrape: Provider(
|
176
|
+
providerFunction=ProxyScrape, countryFilter=True, protocols=["http"]
|
177
|
+
),
|
178
|
+
Monosans: Provider(
|
179
|
+
providerFunction=Monosans, countryFilter=True, protocols=["http"]
|
180
|
+
),
|
181
|
+
MuRongPIG: Provider(
|
182
|
+
providerFunction=MuRongPIG, countryFilter=False, protocols=["http"]
|
183
|
+
),
|
184
|
+
Thespeedx: Provider(
|
185
|
+
providerFunction=Thespeedx, countryFilter=False, protocols=["http"]
|
186
|
+
),
|
187
|
+
Anonym0usWork1221: Provider(
|
177
188
|
providerFunction=Anonym0usWork1221,
|
178
189
|
countryFilter=False,
|
179
190
|
protocols=["http", "https"],
|
180
191
|
),
|
181
|
-
Provider(
|
182
|
-
|
183
|
-
|
184
|
-
Provider(
|
185
|
-
]
|
192
|
+
Mmpx12: Provider(
|
193
|
+
providerFunction=Mmpx12, countryFilter=False, protocols=["http", "https"]
|
194
|
+
),
|
195
|
+
GoodProxy: Provider(
|
196
|
+
providerFunction=GoodProxy, countryFilter=False, protocols=["http"]
|
197
|
+
),
|
198
|
+
OpenProxyList: Provider(
|
199
|
+
providerFunction=OpenProxyList, countryFilter=False, protocols=["http"]
|
200
|
+
),
|
201
|
+
ProxyDB: Provider(
|
202
|
+
providerFunction=ProxyDB, countryFilter=True, protocols=["http", "https"]
|
203
|
+
),
|
204
|
+
}
|
@@ -6,6 +6,7 @@ from appdirs import user_cache_dir
|
|
6
6
|
|
7
7
|
from swiftshadow.classes import ProxyInterface
|
8
8
|
from swiftshadow.models import Proxy
|
9
|
+
from swiftshadow.providers import Providers
|
9
10
|
|
10
11
|
|
11
12
|
def test_basic_proxy():
|
@@ -61,3 +62,11 @@ def test_async_update_autorotate():
|
|
61
62
|
run(swift.async_update())
|
62
63
|
assert isinstance(swift.get(), Proxy)
|
63
64
|
assert isinstance(swift.get(), Proxy)
|
65
|
+
|
66
|
+
|
67
|
+
def test_provider_selection():
|
68
|
+
selectedProvider = list(Providers.keys())[0]
|
69
|
+
swift = ProxyInterface(selectedProviders=[selectedProvider])
|
70
|
+
proxy = swift.get()
|
71
|
+
assert isinstance(proxy, Proxy)
|
72
|
+
assert swift.providers[0] == Providers[selectedProvider]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/API Reference/Classes/proxyInterface/index.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/Getting Started/Usage-In-Async-Environments/index.html
RENAMED
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
|
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
|
File without changes
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js
RENAMED
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
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/workers/search.f8cc74c7.min.js
RENAMED
File without changes
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/javascripts/workers/search.f8cc74c7.min.js.map
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs/assets/stylesheets/palette.06af60db.min.css.map
RENAMED
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
|
{swiftshadow-2.2.1 → swiftshadow-2.3.0}/docs-src/Getting Started/Usage-In-Async-Environments.md
RENAMED
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
|
File without changes
|