Sign inSign up

kukudebai/subs-check

By kukudebai

Updated over 1 year ago

Subscription conversion merge

Image
Developer tools
0

518

kukudebai/subs-check repository overview

Subscription Merge & Convert Check Tool

Compared to the original project, this version fixes some logic, simplifies certain aspects, adds new features, saves memory, and requires no configuration for one-click startup.

Features

  • Check node availability and remove unavailable nodes
    • Added keep-success-proxies parameter to persistently save successfully tested nodes, preventing loss of available nodes due to upstream link updates. This feature is disabled by default
  • Check platform unlock status Temporarily commented out as I find it unnecessary
    • openai
    • youtube
    • netflix
    • disney
  • Merge multiple subscriptions
  • Convert subscriptions to clash/mihomo/base64 format
  • Remove duplicate nodes
  • Node renaming
  • Node speed test (single thread)
  • Save by unlock status
  • Support external result fetching (default listening on :8199)
  • Support 100+ notification channels for test results

Characteristics

  • Multi-platform support
  • Multi-threading support
  • Low resource usage

TODO

  • Support multiple subscription formats
  • Support more save methods
    • Local
    • Cloudflare r2
    • Gist
    • WebDAV
    • HTTP server
    • Others
  • Known issue: vmess nodes are lost when converting from clash format to base64. Too complicated to fix, so I'll leave it.
  • May still have memory leak issues on certain platforms/environments during long-term operation

Deployment/Usage

If subscription pulling is slow, you can use the common HTTP_PROXY HTTPS_PROXY environment variables to speed up; these variables won't affect node testing speed

Proxy with username/password is also supported, format: HTTP proxy: http://username:password@host:port SOCKS5 proxy: socks5://username:password@host:port SOCKS5h proxy: socks5h://username:password@host:port

export HTTP_PROXY=http://username:[email protected]:7890
export HTTPS_PROXY=http://username:[email protected]:7890
# SOCKS5 proxy
export HTTP_PROXY=socks5://username:[email protected]:7890
export HTTPS_PROXY=socks5://username:[email protected]:7890
# SOCKS5h proxy
export HTTP_PROXY=socks5h://username:[email protected]:7890
export HTTPS_PROXY=socks5h://username:[email protected]:7890

To accelerate GitHub links, you can use public "GitHub proxy" services or self-host using the worker.js mentioned in the Self-hosted Speed Test URL section below. Usage for self-hosted acceleration:

# Note: Only works for GitHub links. Protocol header is optional. Supports releases, archives and files
https://custom-domain/raw/https://raw.githubusercontent.com/mfuu/v2ray/master/clash.yaml
https://custom-domain/raw/link

# This is the fixed prefix after deployment ----> https://custom-domain/raw/ <---- that's the /raw/

Since upstream subscription links may be from crawlers, locally available nodes often get refreshed. You can use the keep-success-proxies parameter to persistently save successfully tested nodes. This parameter is disabled by default. Data will be temporarily stored in memory, so don't enable this if you have many available nodes (as it may use some memory). You can achieve the same effect by adding the generated link to subscription links

Edit Configuration File (Optional)

The program includes some subscription addresses by default, no changes needed to use. The program will generate a default configuration file in the current directory on first run, then you can use it directly.

Self-hosted Speed Test URL (Optional)

Try to avoid using Speedtest or Cloudflare download links, as many nodes block speed test websites

  1. Deploy worker.js to Cloudflare Workers
  2. Bind a custom domain (to avoid being blocked by nodes)
  3. Configure speed-test-url to your worker's custom domain address
# 100MB
speed-test-url: https://custom-domain/speedtest?bytes=104857600
# 1GB
speed-test-url: https://custom-domain/speedtest?bytes=1073741824
Docker Run
docker run -d --name subs-check -p 8199:8199 -v ./config:/app/config  -v ./output:/app/output --restart always kukudebai/subs-check:latest
# If you want to use proxy, add environment variables like
docker run -d --name subs-check -p 8199:8199  -e HTTP_PROXY=http://192.168.1.1:7890 -e HTTPS_PROXY=http://192.168.1.1:7890 -v ./config:/app/config  -v ./output:/app/output --restart always kukudebai/subs-check:latest
Docker-compose
services:
  mihomo-check:
    image: kukudebai/subs-check:latest
    container_name: subs-check
    volumes:
      - ./config:/app/config
      - ./output:/app/output
    ports:
      - "8199:8199"
    environment:
      - TZ=Asia/Shanghai
      # Whether to use proxy
      # - HTTP_PROXY=http://192.168.1.1:7890
      # - HTTPS_PROXY=http://192.168.1.1:7890
    restart: always
    tty: true
    network_mode: bridge
Run from Source
go run main.go -f /path/to/config.yaml
Run Binary

Download appropriate version from releases and extract Run directly, it will generate configuration file in current directory

Notification Channel Configuration (Optional)

Currently, this project uses Apprise for notifications, supporting 100+ notification channels. However, since apprise is written in Python, and Cloudflare's recently released Python workers still have issues deploying apprise, we provide two deployment methods below (though there are actually more):

Vercel Serverless Deployment
  1. Click here to deploy Apprise on your Vercel account
  2. After deployment, you'll get a link like https://testapprise-beck8s-projects.vercel.app/, append /notify to get the Apprise API server link: https://testapprise-beck8s-projects.vercel.app/notify
  3. Please add a custom domain to your Vercel project, as Vercel is almost inaccessible in mainland China
Docker Deployment
docker run --name apprise -p 8000:8000 --restart always -d caronc/apprise:latest
# If you deploy docker in mainland China and want to send to overseas platforms, add HTTP_PROXY HTTPS_PROXY environment variables
docker run --name apprise \
   -p 8000:8000 \
   -e HTTP_PROXY=http://192.168.1.1:7890 \
   -e HTTPS_PROXY=http://192.168.1.1:7890 \
   --restart always \
   -d caronc/apprise:latest

Then write notification URLs according to Apprise wiki, which has detailed documentation for setting up each notification channel. For example, for Telegram, your URL would be tgram://botToken/chatId. I've included some examples in the default configuration for reference.

# Fill in the deployed apprise API server address
# https://notify.xxxx.us.kg/notify
apprise-api-server: ""
# Fill in notification targets
# Supports 100+ notification channels, see https://github.com/caronc/apprise for detailed formats
recipient-url: 
  # Telegram format: tgram://<bot_token>/<chat_id>
  # - tgram://xxxxxx/-1002149239223
  # DingTalk format: dingtalk://<secret>@<dd_token>/<chat_id>
  # - dingtalk://xxxxxx@xxxxxxx/123123

Save Method Configuration

Note: When choosing save method, remember to change save-method configuration If you deployed worker.js above, you can use it directly, no need to deploy again

External Service Configuration

Choose whether to convert subscription based on client type

  • http://127.0.0.1:8199/all.yaml returns nodes in YAML format
  • http://127.0.0.1:8199/all.txt returns nodes in base64 format

You can directly put base64 format subscription into V2rayN or Mihomo Party's sub-store subset nodeinfo

Subscription Usage

Recommended to run directly in TUN mode

Windows bare-core running application written by original author: minihomo

  • Download base.yaml
  • Replace corresponding links with your own

For example:

proxy-providers:
  ProviderALL:
    url: https:// #Replace this with your link
    type: http
    interval: 600
    proxy: DIRECT
    health-check:
      enable: true
      url: http://www.google.com/generate_204
      interval: 60
    path: ./proxy_provider/ALL.yaml

Disclaimer

This tool is for learning and research purposes only. Users should bear their own risks and comply with relevant laws and regulations.

Tag summary

Content type

Image

Digest

sha256:ac4967939

Size

12.8 MB

Last updated

over 1 year ago

docker pull kukudebai/subs-check