swiftshadow 1.2.0__tar.gz → 1.2.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -19,7 +19,7 @@ setup(
19
19
  description="Free IP Proxy rotator for python",
20
20
  long_description=long_description,
21
21
  long_description_content_type="text/markdown",
22
- version="1.2.0",
22
+ version="1.2.1",
23
23
  packages=find_packages(where=".", exclude=["tests"]),
24
24
  install_requires=["requests"],
25
25
  classifiers=[
@@ -0,0 +1,72 @@
1
+ from requests import get
2
+ from swiftshadow.helpers import checkProxy
3
+
4
+
5
+ def Monosans(max, countries=[], protocol="http"):
6
+ raw = get(
7
+ "https://raw.githubusercontent.com/monosans/proxy-list/main/proxies.json"
8
+ ).json()
9
+ results = []
10
+ count = 0
11
+ for proxy in raw:
12
+ if count == max:
13
+ return results
14
+ if proxy["protocol"] == protocol:
15
+ if (
16
+ len(countries) != 0
17
+ and proxy["geolocation"]["country"]["iso_code"] not in countries
18
+ ):
19
+ continue
20
+ proxy = [f'{proxy["host"]}:{proxy["port"]}', proxy["protocol"]]
21
+ if checkProxy(proxy):
22
+ results.append(proxy)
23
+ count += 1
24
+ return results
25
+
26
+
27
+ def Thespeedx(max, countries=[], protocol="http"):
28
+ results = []
29
+ count = 0
30
+ raw = get(
31
+ "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt"
32
+ ).text
33
+ for line in raw.splitlines():
34
+ if count == max:
35
+ break
36
+ proxy = [line, "http"]
37
+ if checkProxy(proxy):
38
+ results.append(proxy)
39
+ print(proxy, True)
40
+ count += 1
41
+ else:
42
+ continue
43
+ return results
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"
48
+ results = []
49
+ count = 0
50
+ if len(countries) == 0:
51
+ apiUrl = baseUrl + "&country=all"
52
+ else:
53
+ apiUrl = baseUrl + "&country=" + ",".join([i.upper() for i in countries])
54
+ raw = get(apiUrl).json()
55
+ for ipRaw in raw["proxies"]:
56
+ if count == max:
57
+ break
58
+ proxy = [ipRaw["proxy"], "http"]
59
+ if checkProxy(proxy):
60
+ results.append(proxy)
61
+ count += 1
62
+ else:
63
+ print(proxy, False)
64
+ continue
65
+ return results
66
+
67
+
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
@@ -1,57 +0,0 @@
1
- from requests import get
2
- from swiftshadow.helpers import checkProxy
3
-
4
- def Monosans(max, countries=[],protocol="http"):
5
- raw = get('https://raw.githubusercontent.com/monosans/proxy-list/main/proxies.json').json()
6
- results = []
7
- count = 0
8
- for proxy in raw:
9
- if count == max:
10
- return results
11
- if proxy['protocol'] == protocol:
12
- if len(countries) != 0 and proxy['geolocation']['country']['iso_code'] not in countries:
13
- continue
14
- proxy = [f'{proxy['host']}:{proxy['port']}',proxy['protocol']]
15
- if checkProxy(proxy):
16
- results.append(proxy)
17
- count += 1
18
- return results
19
-
20
- def Thespeedx(max,countries=[],protocol='http'):
21
- results = []
22
- count =0
23
- raw = get('https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt').text
24
- for line in raw.splitlines():
25
- if count == max:
26
- break
27
- proxy = [line,'http']
28
- if checkProxy(proxy):
29
- results.append(proxy)
30
- print(proxy,True)
31
- count +=1
32
- else:
33
- continue
34
- 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'
38
- results = []
39
- count = 0
40
- if len(countries) == 0:
41
- apiUrl = baseUrl + '&country=all'
42
- else:
43
- apiUrl = baseUrl + '&country=' + ','.join([i.upper() for i in countries])
44
- raw = get(apiUrl).json()
45
- for ipRaw in raw['proxies']:
46
- if count == max:
47
- break
48
- proxy = [ipRaw['proxy'],'http']
49
- if checkProxy(proxy):
50
- results.append(proxy)
51
- count += 1
52
- else:
53
- print(proxy,False)
54
- continue
55
- return results
56
-
57
- Providers = [{'provider':Monosans,'countryFilter':True,'protocols':['http']},{'provider':Thespeedx,'countryFilter':False,'protocols':['http']},{'provider':ProxyScrape,'countryFilter':True,'protocols':['http']}]
File without changes
File without changes
File without changes