-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
1 deletion.
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
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,34 @@ | ||
from src.app.ip_get import IPGet, SiteResponse | ||
from src.lib.structs import SiteData, SiteResponseData | ||
|
||
key = 'github_proxy_list' | ||
|
||
|
||
@IPGet.config(key) | ||
def config(): | ||
site = SiteData() | ||
site.name = 'Github proxy list' | ||
site.pages = ['https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt'] | ||
return site | ||
|
||
|
||
@IPGet.parse(key) | ||
def parse(resp: SiteResponse): | ||
import re | ||
ips = re.findall(r'(?:\d{1,3}\.){3}\d{1,3}:\d+', resp.text) | ||
for ip in ips: | ||
try: | ||
item = ip.split(':') | ||
res = SiteResponseData() | ||
res.ip = item[0] | ||
res.port = item[1] | ||
yield res | ||
except Exception: | ||
continue | ||
|
||
|
||
if __name__ == '__main__': | ||
from src.lib.func import run_until_complete | ||
|
||
runner = IPGet.test_crawl(key) | ||
run_until_complete(runner) |
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,34 @@ | ||
from src.app.ip_get import IPGet, SiteResponse | ||
from src.lib.structs import SiteData, SiteResponseData | ||
|
||
key = 'proxy_daily' | ||
|
||
|
||
@IPGet.config(key) | ||
def config(): | ||
site = SiteData() | ||
site.name = 'Proxy daily' | ||
site.pages = ['https://proxy-daily.com/'] | ||
return site | ||
|
||
|
||
@IPGet.parse(key) | ||
def parse(resp: SiteResponse): | ||
import re | ||
ips = re.findall(r'(?:\d{1,3}\.){3}\d{1,3}:\d+', resp.text) | ||
for ip in ips: | ||
try: | ||
item = ip.split(':') | ||
res = SiteResponseData() | ||
res.ip = item[0] | ||
res.port = item[1] | ||
yield res | ||
except Exception: | ||
continue | ||
|
||
|
||
if __name__ == '__main__': | ||
from src.lib.func import run_until_complete | ||
|
||
runner = IPGet.test_crawl(key) | ||
run_until_complete(runner) |
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,34 @@ | ||
from src.app.ip_get import IPGet, SiteResponse | ||
from src.lib.structs import SiteData, SiteResponseData | ||
|
||
key = 'spysme' | ||
|
||
|
||
@IPGet.config(key) | ||
def config(): | ||
site = SiteData() | ||
site.name = 'Spys.me' | ||
site.pages = ['http://spys.me/proxy.txt'] | ||
return site | ||
|
||
|
||
@IPGet.parse(key) | ||
def parse(resp: SiteResponse): | ||
import re | ||
ips = re.findall(r'(?:\d{1,3}\.){3}\d{1,3}:\d+', resp.text) | ||
for ip in ips: | ||
try: | ||
item = ip.split(':') | ||
res = SiteResponseData() | ||
res.ip = item[0] | ||
res.port = item[1] | ||
yield res | ||
except Exception: | ||
continue | ||
|
||
|
||
if __name__ == '__main__': | ||
from src.lib.func import run_until_complete | ||
|
||
runner = IPGet.test_crawl(key) | ||
run_until_complete(runner) |