swiftshadow 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
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/providers.py +36 -21
- {swiftshadow-1.2.0.dist-info → swiftshadow-1.2.1.dist-info}/METADATA +1 -1
- {swiftshadow-1.2.0.dist-info → swiftshadow-1.2.1.dist-info}/RECORD +6 -6
- {swiftshadow-1.2.0.dist-info → swiftshadow-1.2.1.dist-info}/WHEEL +1 -1
- {swiftshadow-1.2.0.dist-info → swiftshadow-1.2.1.dist-info}/LICENSE +0 -0
- {swiftshadow-1.2.0.dist-info → swiftshadow-1.2.1.dist-info}/top_level.txt +0 -0
swiftshadow/providers.py
CHANGED
@@ -1,57 +1,72 @@
|
|
1
1
|
from requests import get
|
2
2
|
from swiftshadow.helpers import checkProxy
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
def Monosans(max, countries=[], protocol="http"):
|
6
|
+
raw = get(
|
7
|
+
"https://raw.githubusercontent.com/monosans/proxy-list/main/proxies.json"
|
8
|
+
).json()
|
6
9
|
results = []
|
7
10
|
count = 0
|
8
11
|
for proxy in raw:
|
9
12
|
if count == max:
|
10
13
|
return results
|
11
|
-
if proxy[
|
12
|
-
if
|
14
|
+
if proxy["protocol"] == protocol:
|
15
|
+
if (
|
16
|
+
len(countries) != 0
|
17
|
+
and proxy["geolocation"]["country"]["iso_code"] not in countries
|
18
|
+
):
|
13
19
|
continue
|
14
|
-
proxy = [f'{proxy[
|
20
|
+
proxy = [f'{proxy["host"]}:{proxy["port"]}', proxy["protocol"]]
|
15
21
|
if checkProxy(proxy):
|
16
22
|
results.append(proxy)
|
17
23
|
count += 1
|
18
24
|
return results
|
19
25
|
|
20
|
-
|
26
|
+
|
27
|
+
def Thespeedx(max, countries=[], protocol="http"):
|
21
28
|
results = []
|
22
|
-
count =0
|
23
|
-
raw = get(
|
29
|
+
count = 0
|
30
|
+
raw = get(
|
31
|
+
"https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt"
|
32
|
+
).text
|
24
33
|
for line in raw.splitlines():
|
25
34
|
if count == max:
|
26
35
|
break
|
27
|
-
proxy = [line,
|
36
|
+
proxy = [line, "http"]
|
28
37
|
if checkProxy(proxy):
|
29
38
|
results.append(proxy)
|
30
|
-
print(proxy,True)
|
31
|
-
count +=1
|
39
|
+
print(proxy, True)
|
40
|
+
count += 1
|
32
41
|
else:
|
33
42
|
continue
|
34
43
|
return results
|
35
|
-
|
36
|
-
|
37
|
-
|
44
|
+
|
45
|
+
|
46
|
+
def ProxyScrape(max, countries=[], protocol="http"):
|
47
|
+
baseUrl = "https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&protocol=http&proxy_format=ipport&format=json"
|
38
48
|
results = []
|
39
49
|
count = 0
|
40
50
|
if len(countries) == 0:
|
41
|
-
apiUrl = baseUrl +
|
51
|
+
apiUrl = baseUrl + "&country=all"
|
42
52
|
else:
|
43
|
-
apiUrl = baseUrl +
|
53
|
+
apiUrl = baseUrl + "&country=" + ",".join([i.upper() for i in countries])
|
44
54
|
raw = get(apiUrl).json()
|
45
|
-
for ipRaw in raw[
|
55
|
+
for ipRaw in raw["proxies"]:
|
46
56
|
if count == max:
|
47
57
|
break
|
48
|
-
proxy = [ipRaw[
|
58
|
+
proxy = [ipRaw["proxy"], "http"]
|
49
59
|
if checkProxy(proxy):
|
50
60
|
results.append(proxy)
|
51
61
|
count += 1
|
52
62
|
else:
|
53
|
-
print(proxy,False)
|
63
|
+
print(proxy, False)
|
54
64
|
continue
|
55
|
-
return results
|
65
|
+
return results
|
66
|
+
|
56
67
|
|
57
|
-
Providers = [
|
68
|
+
Providers = [
|
69
|
+
{"provider": Monosans, "countryFilter": True, "protocols": ["http"]},
|
70
|
+
{"provider": Thespeedx, "countryFilter": False, "protocols": ["http"]},
|
71
|
+
{"provider": ProxyScrape, "countryFilter": True, "protocols": ["http"]},
|
72
|
+
]
|
@@ -3,9 +3,9 @@ swiftshadow/cache.py,sha256=tNj07m0Ii_r0wLu9NKTYxOyS8uYeC7BbgFdMnuLqK7Y,411
|
|
3
3
|
swiftshadow/classes.py,sha256=YlXuV5QobEwvIMQDt2sjT173Q-EQbGk6bz5nfyn0Cds,5249
|
4
4
|
swiftshadow/constants.py,sha256=FRhoYg8WNaLy8RLDD4BsANlXlY2tctBCdy7sCnkaVY0,6303
|
5
5
|
swiftshadow/helpers.py,sha256=RGC-Tq9vWqiddu_KEKYWc_URO-ISm3PXuMBqB_cl7XQ,533
|
6
|
-
swiftshadow/providers.py,sha256=
|
7
|
-
swiftshadow-1.2.
|
8
|
-
swiftshadow-1.2.
|
9
|
-
swiftshadow-1.2.
|
10
|
-
swiftshadow-1.2.
|
11
|
-
swiftshadow-1.2.
|
6
|
+
swiftshadow/providers.py,sha256=PEZl7qCEkfaBBxrAp8exImz9LYW2lgHufsyzexY89ZU,2164
|
7
|
+
swiftshadow-1.2.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
8
|
+
swiftshadow-1.2.1.dist-info/METADATA,sha256=QqlLxlFY5zdXMZ6VPS-QuidMFrbGonnohw6LkiOdjKc,2793
|
9
|
+
swiftshadow-1.2.1.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
10
|
+
swiftshadow-1.2.1.dist-info/top_level.txt,sha256=GClzVDF5vWSzqHOwgG2ycQAAJXRxd-QOdP1h3YrHOuM,12
|
11
|
+
swiftshadow-1.2.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|