-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Plugins that crash now have fails reported and logged as info -Added plugin geonode.py -Removed proxy test method
- Loading branch information
1 parent
29cf641
commit b5b58b0
Showing
4 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import requests | ||
from src.utils import Proxy, Plugin | ||
from typing import Iterator | ||
|
||
|
||
anon_dict = {"transparent": 0, "anonymous": 1, "elite": 2} | ||
|
||
|
||
class GeoNode(Plugin): | ||
plugin_name = "Geonode" | ||
plugin_url = "https://geonode.com/free-proxy-list" | ||
|
||
def find(self) -> Iterator[Proxy]: | ||
page = 1 | ||
while True: | ||
resource = f"https://proxylist.geonode.com/api/proxy-list?limit=15&page={page}&sort_by=lastChecked&sort_type=desc" | ||
response = requests.get(resource) | ||
|
||
if response.status_code != 200: | ||
self.report_fail() | ||
return | ||
|
||
response_json = response.json() | ||
|
||
if len(response_json["data"]) == 0: | ||
return | ||
|
||
for proxy_json in response_json["data"]: | ||
yield Proxy( | ||
ip=proxy_json["ip"], | ||
anon_level=anon_dict[proxy_json["anonymityLevel"]], | ||
port=int(proxy_json["port"]), | ||
protocol=proxy_json["protocols"][0] | ||
) | ||
|
||
page += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters