Compare commits

...

11 Commits

Author SHA1 Message Date
zu1k
5329a7b545 fix’ 2020-08-14 08:18:56 +08:00
zu1k
180c5b7943 ?? 2020-08-14 08:16:57 +08:00
zu1k
0d30186ea4 fix config file parse err 2020-08-14 08:14:21 +08:00
zu1k
956910881e Merge branch 'master' of github.com:zu1k/proxypool 2020-08-14 08:11:14 +08:00
zu1k
d885b747fa add ss another link support 2020-08-14 08:11:07 +08:00
zu1k
14b8577186 add tg sslist 2020-08-14 07:43:03 +08:00
zu1k
3653819e28 add github link 2020-08-13 21:16:25 +08:00
zu1k
055e1f3db0 update readme 2020-08-13 08:57:42 +08:00
zu1k
15b4ce563c update readme 2020-08-13 08:54:02 +08:00
zu1k
abb65edfb2 add readme 2020-08-13 08:50:09 +08:00
zu1k
cc61798fdf add tgchannel 2020-08-13 08:33:32 +08:00
9 changed files with 129 additions and 23 deletions

76
README.md Normal file
View File

@@ -0,0 +1,76 @@
<h1 align="center">
<br>proxypool<br>
</h1>
<h5 align="center">自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供clash配置</h5>
<p align="center">
<a href="https://github.com/zu1k/proxypool/actions">
<img src="https://img.shields.io/github/workflow/status/zu1k/proxypool/Go?style=flat-square" alt="Github Actions">
</a>
<a href="https://goreportcard.com/report/github.com/zu1k/proxypool">
<img src="https://goreportcard.com/badge/github.com/zu1k/proxypool?style=flat-square">
</a>
<a href="https://github.com/zu1k/proxypool/releases">
<img src="https://img.shields.io/github/release/zu1k/proxypool/all.svg?style=flat-square">
</a>
</p>
## 支持
- 支持ss、ssr、vmess节点链接与订阅
- 任意 Telegram 频道抓取
- 机场订阅地址抓取解析
- 公开互联网页面模糊抓取
- 翻墙党论坛新节点信息
- 其他节点分享网站
- 定时抓取更新
- 使用配置文件提供抓取源
## 安装
### 从源码编译
需要安装Golang
```sh
$ go get -u -v github.com/zu1k/proxypool
```
### 下载预编译程序
从这里下载预编译好的程序 [release](https://github.com/zu1k/proxypool/releases)
### 使用docker
```sh
docker pull docker.pkg.github.com/zu1k/proxypool/proxypool:latest
```
## 使用
### 共享抓取配置文件
每一次抓取前会自动从github下载最新的抓取配置文件
直接运行 `proxypool` 程序即可
### 自定义抓取配置文件
```shell
proxypool -c source.yaml
```
### 帮助更新配置文件
可以在 https://github.com/zu1k/proxypool/issues/3 进行留言
### 用户使用
目前公开版本: https://proxy.tgbot.co/clash
直接在clash添加配置文件即可使用 https://proxy.tgbot.co/clash/config
## 截图
![测速](docs/run.png)

View File

@@ -5,10 +5,12 @@ import (
"io/ioutil"
"log"
"math/rand"
"os"
"strconv"
"sync"
"github.com/zu1k/proxypool/config"
"gopkg.in/yaml.v2"
"github.com/zu1k/proxypool/app/cache"
"github.com/zu1k/proxypool/provider"
"github.com/zu1k/proxypool/proxy"
@@ -76,12 +78,10 @@ func FetchNewConfigFileThenInit() {
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
err = yaml.Unmarshal(body, &config.SourceConfig)
if err != nil {
return
}
err = ioutil.WriteFile("source.yaml", body, os.ModePerm)
if err != nil {
return
}
InitConfigAndGetters("source.yaml")
InitGetters(config.SourceConfig.Sources)
}

BIN
docs/run.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

@@ -1,3 +1,6 @@
# 所有节点均从公开互联网上抓取使用clash自动检查可用性即可
# 抓取程序已开源: https://github.com/zu1k/proxypool
# port of HTTP
port: 7890

View File

@@ -73,9 +73,12 @@
<div class='section friendly'>
<h1><strong>免费Clash节点</strong></h1>
<div class='article'>
<p>所有节点均从公开互联网上爬取每10分钟自动更新</p>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a></p>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供clash配置每10分钟更新</p>
<br>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a> <a href="clash://install-config?url=https://proxy.tgbot.co/clash/config">一键导入</a></p>
<p>Clash proxy-provider<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>

View File

@@ -22,14 +22,14 @@ type TGChannelGetter struct {
func NewTGChannelGetter(options tool.Options) Getter {
num, found := options["num"]
if !found || int(num.(float64)) <= 0 {
if !found || num.(int) <= 0 {
num = 200
}
url, found := options["channel"]
if found {
return &TGChannelGetter{
c: colly.NewCollector(),
NumNeeded: int(num.(float64)),
NumNeeded: num.(int),
Url: "https://t.me/s/" + url.(string),
}
}

View File

@@ -22,14 +22,14 @@ type WebFanqiangdang struct {
func NewWebFanqiangdangGetter(options tool.Options) Getter {
num, found := options["num"]
if !found || int(num.(float64)) <= 0 {
if !found || num.(int) <= 0 {
num = 200
}
url, found := options["url"]
if found {
return &WebFanqiangdang{
c: colly.NewCollector(),
NumNeeded: int(num.(float64)),
NumNeeded: num.(int),
Url: url.(string),
}
}

View File

@@ -59,20 +59,35 @@ func ParseSSLink(link string) (*Shadowsocks, error) {
return nil, ErrorNotSSLink
}
cipher := ""
password := ""
if uri.User.String() == "" {
// base64的情况
infos, err := tool.Base64DecodeString(uri.Hostname())
if err != nil {
return nil, err
}
uri, err = url.Parse("ss://" + infos)
if err != nil {
return nil, err
}
cipher = uri.User.Username()
password, _ = uri.User.Password()
} else {
cipherInfoString, err := tool.Base64DecodeString(uri.User.Username())
if err != nil {
return nil, ErrorPasswordParseFail
}
cipherInfo := strings.SplitN(cipherInfoString, ":", 2)
if len(cipherInfo) < 2 {
return nil, ErrorPasswordParseFail
}
cipher = strings.ToLower(cipherInfo[0])
password = cipherInfo[1]
}
server := uri.Hostname()
port, _ := strconv.Atoi(uri.Port())
cipherInfoString, err := tool.Base64DecodeString(uri.User.Username())
if err != nil {
return nil, ErrorPasswordParseFail
}
cipherInfo := strings.SplitN(cipherInfoString, ":", 2)
if len(cipherInfo) < 2 {
return nil, ErrorPasswordParseFail
}
cipher := strings.ToLower(cipherInfo[0])
password := cipherInfo[1]
moreInfos := uri.Query()
pluginString := moreInfos.Get("plugin")
plugin := ""

View File

@@ -202,6 +202,10 @@ sources:
options:
channel: ssrList
num: 200
- type: tgchannel
options:
channel: ssList
num: 200
- type: tgchannel
options:
@@ -248,6 +252,11 @@ sources:
channel: fanqiang666
num: 200
- type: tgchannel
options:
channel: jiedianfenxiang
num: 200
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0