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 CHANGED
@@ -1,57 +1,72 @@
1
1
  from requests import get
2
2
  from swiftshadow.helpers import checkProxy
3
3
 
4
- def Monosans(max, countries=[],protocol="http"):
5
- raw = get('https://raw.githubusercontent.com/monosans/proxy-list/main/proxies.json').json()
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['protocol'] == protocol:
12
- if len(countries) != 0 and proxy['geolocation']['country']['iso_code'] not in countries:
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['host']}:{proxy['port']}',proxy['protocol']]
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
- def Thespeedx(max,countries=[],protocol='http'):
26
+
27
+ def Thespeedx(max, countries=[], protocol="http"):
21
28
  results = []
22
- count =0
23
- raw = get('https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt').text
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,'http']
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
- def ProxyScrape(max,countries=[],protocol='http'):
37
- baseUrl = 'https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&protocol=http&proxy_format=ipport&format=json'
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 + '&country=all'
51
+ apiUrl = baseUrl + "&country=all"
42
52
  else:
43
- apiUrl = baseUrl + '&country=' + ','.join([i.upper() for i in countries])
53
+ apiUrl = baseUrl + "&country=" + ",".join([i.upper() for i in countries])
44
54
  raw = get(apiUrl).json()
45
- for ipRaw in raw['proxies']:
55
+ for ipRaw in raw["proxies"]:
46
56
  if count == max:
47
57
  break
48
- proxy = [ipRaw['proxy'],'http']
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 = [{'provider':Monosans,'countryFilter':True,'protocols':['http']},{'provider':Thespeedx,'countryFilter':False,'protocols':['http']},{'provider':ProxyScrape,'countryFilter':True,'protocols':['http']}]
68
+ Providers = [
69
+ {"provider": Monosans, "countryFilter": True, "protocols": ["http"]},
70
+ {"provider": Thespeedx, "countryFilter": False, "protocols": ["http"]},
71
+ {"provider": ProxyScrape, "countryFilter": True, "protocols": ["http"]},
72
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: swiftshadow
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Free IP Proxy rotator for python
5
5
  Home-page: https://github.com/sachin-sankar/swiftshadow
6
6
  Author: Sachin Sankar
@@ -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=qUYUxUuSifwuWWs3KxW2al_T5ee9Lr7MRaTddIR9lyw,2060
7
- swiftshadow-1.2.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
8
- swiftshadow-1.2.0.dist-info/METADATA,sha256=RRq0DPKJlgD1gboURK0gtCJ_Fq04P08hinNvz988BjY,2793
9
- swiftshadow-1.2.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
10
- swiftshadow-1.2.0.dist-info/top_level.txt,sha256=GClzVDF5vWSzqHOwgG2ycQAAJXRxd-QOdP1h3YrHOuM,12
11
- swiftshadow-1.2.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (71.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5