Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🥄 A package for building specific Proxy Pool for different Sites.

License

NotificationsYou must be signed in to change notification settings

Jiramew/spoon

Repository files navigation

Spoon is a library for building Distributed Proxy Pool for each different sites as you assign.
Only running on python 3.

Install

Simply run:pip install spoonproxy or clone the repo and set it into your PYTHONPATH.

Run

Spoon-server

Please make sure the Redis is running. Default configuration is "host:localhost, port:6379". You can also modify the Redis connection.
Likeexample.py inspoon_server/example,
You can assign many different proxy providers.

fromspoon_server.proxy.fetcherimportFetcherfromspoon_server.main.proxy_pipeimportProxyPipefromspoon_server.proxy.kuai_providerimportKuaiProviderfromspoon_server.proxy.xici_providerimportXiciProviderfromspoon_server.database.redis_configimportRedisConfigfromspoon_server.main.checkerimportCheckerBaidudefmain_run():redis=RedisConfig("127.0.0.1",21009)p1=ProxyPipe(url_prefix="https://www.baidu.com",fetcher=Fetcher(use_default=False),database=redis,checker=CheckerBaidu()).set_fetcher([KuaiProvider()]).add_fetcher([XiciProvider()])p1.start()if__name__=='__main__':main_run()

Also, with different checker, you can validate the result precisely.

classCheckerBaidu(Checker):defchecker_func(self,html=None):ifisinstance(html,bytes):html=html.decode('utf-8')ifre.search(r".*百度一下,你就知道.*",html):returnTrueelse:returnFalse

Also, as the code shows inspoon_server/example/example_multi.py, by using multiprocess, you can get many queues to fetching & validating the proxies.
You can also assign different Providers for different url.
The default proxy providers are shown below, you can write your own providers.

namedescription
WebProviderGet proxy from http api
FileProviderGet proxy from file
GouProviderhttp://www.goubanjia.com
KuaiProviderhttp://www.kuaidaili.com
SixProviderhttp://m.66ip.cn
UsProviderhttps://www.us-proxy.org
WuyouProviderhttp://www.data5u.com
XiciProviderhttp://www.xicidaili.com
IP181Providerhttp://www.ip181.com
XunProviderhttp://www.xdaili.cn
PlpProviderhttps://list.proxylistplus.com
IP3366Providerhttp://www.ip3366.net
BusyProviderhttps://proxy.coderbusy.com
NianProviderhttp://www.nianshao.me
PdbProviderhttp://proxydb.net
ZdayeProviderhttp://ip.zdaye.com
YaoProviderhttp://www.httpsdaili.com/
FeilongProviderhttp://www.feilongip.com/
IP31Providerhttps://31f.cn/http-proxy/
XiaohexiaProviderhttp://www.xiaohexia.cn/
CoolProviderhttps://www.cool-proxy.net/
NNtimeProviderhttp://nntime.com/
ListendeProviderhttps://www.proxy-listen.de/
IhuanProviderhttps://ip.ihuan.me/
IphaiProviderhttp://www.iphai.com/
MimvpProvider(@NeedCaptcha)https://proxy.mimvp.com/
GPProvider(@NeedProxy if you're in China)http://www.gatherproxy.com
FPLProvider(@NeedProxy if you're in China)https://free-proxy-list.net
SSLProvider(@NeedProxy if you're in China)https://www.sslproxies.org
NordProvider(@NeedProxy if you're in China)https://nordvpn.com
PremProvider(@NeedProxy if you're in China)https://premproxy.com
YouProvider(@Deprecated)http://www.youdaili.net

Spoon-web

A Simple django web api demo. You could use any web server and write your own api.
Gently runpython manager.py runserver **.**.**.**:*****
The simple apis include:

namedescription
http://127.0.0.1:21010/api/v1/get_keysGet all keys from redis
http://127.0.0.1:21010/api/v1/fetchone_from?target=www.google.com&filter=65Get one useful proxy.
target: the specific url
filter: successful-revalidate times
http://127.0.0.1:21010/api/v1/fetchall_from?target=www.google.com&filter=65Get all useful proxies.
http://127.0.0.1:21010/api/v1/fetch_hundred_recent?target=www.baidu.com&filter=5Get recently joined full-scored proxies.
target: the specific url
filter: time in seconds
http://127.0.0.1:21010/api/v1/fetch_stale?num=100Get recently proxies without check.
num: the specific number of proxies you want
http://127.0.0.1:21010/api/v1/fetch_recent?target=www.baidu.comGet recently proxies that successfully validated.
target: the specific url

About

🥄 A package for building specific Proxy Pool for different Sites.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp