Enhancements

Fix potential crash related to the new file reader.
Fix loading local subscriptions requires token when API mode is disabled.
Add support for parsing Clash Proxy Provider.
Update READMEs.
This commit is contained in:
Tindy X committed 2020-02-22 02:49:41 +08:00
1 parent 0527f1ddd4
commit e3726192dd
5 files changed
+104 -42

No files matched your search

+86 -19
View File
@@ -16,32 +16,45 @@ Utility to convert between various proxy subscription formats.
- [Quick Usage](#quick-usage)
- [Access Interface](#access-interface)
- [Description](#description)
- [Quick Conversion](#quick-conversion)
- [Advanced Usage](#advanced-usage)
- [Read Before Continue](#read-before-continue)
- [Advanced Details](#advanced-details)
- [Profiles](#profiles)
- [Configuration File](#configuration-file)
- [External Configuration File](#external-configuration-file)
- [Auto Upload](#auto-upload)
## Supported Types
| Type | As Source | As Target | Target Name |
| ------------ | :---------: | :-----------: | ----------- |
| Clash | ✔ | ✔ | clash |
| ClashR | ✔ | ✔ | clashr |
| Quantumult | ✔ | ✔ | quan |
| Quantumult X | ✔ | ✔ | quanx |
| SS (SIP002) | ✔ | ✔ | ss |
| SS Android | ✔ | ✔ | sssub |
| SSD | ✔ | ✔ | ssd |
| SSR | ✔ | ✔ | ssr |
| Surfboard | ✔ | ✔ | surfboard |
| Surge 2 | ✔ | ✔ | surge&ver=2 |
| Surge 3 | ✔ | ✔ | surge&ver=3 |
| Surge 4 | ✔ | ✔ | surge&ver=4 |
| V2Ray | ✔ | ✔ | v2ray |
| Type | As Source | As Target | Target Name |
| ------------ | :--------: | :----------: | ----------- |
| Clash | ✓ | ✓ | clash |
| ClashR | ✓ | ✓ | clashr |
| Quantumult | ✓ | ✓ | quan |
| Quantumult X | ✓ | ✓ | quanx |
| Loon | ✓ | ✓ | loon |
| SS (SIP002) | ✓ | ✓ | ss |
| SS Android | ✓ | ✓ | sssub |
| SSD | ✓ | ✓ | ssd |
| SSR | ✓ | ✓ | ssr |
| Surfboard | ✓ | ✓ | surfboard |
| Surge 2 | ✓ | ✓ | surge&ver=2 |
| Surge 3 | ✓ | ✓ | surge&ver=3 |
| Surge 4 | ✓ | ✓ | surge&ver=4 |
| V2Ray | ✓ | ✓ | v2ray |
| Telegram-liked HTTP/Socks 5 links | ✓ | × | Only as source |
Notice:
1. Shadowrocket users should use `ss`, `ssr` or `v2ray` as target.
2. You can add `&remark=` to Telegram-liked HTTP/Socks 5 links to set a remark for this node. For example:
- tg://http?server=1.2.3.4&port=233&user=user&pass=pass&remark=Example
- https://t.me/http?server=1.2.3.4&port=233&user=user&pass=pass&remark=Example
**Notice**:Shadowrocket users should use `ss`, `ssr` or `v2ray` as target.
---
@@ -51,7 +64,7 @@ Utility to convert between various proxy subscription formats.
### Access Interface
```TXT
```txt
http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&config=%CONFIG%
```
@@ -67,7 +80,7 @@ If you need to merge two or more subscription, you should connect them with '|'
Example:
```TXT
```txt
You have 2 subscriptions and you want to merge them and generate a Clash subscription:
1. https://dler.cloud/subscribe/ABCDE?clash=vmess
2. https://rich.cloud/subscribe/ABCDE?clash=vmess
@@ -84,6 +97,16 @@ http://127.0.0.1:25500/sub?target=clash&url=https%3A%2F%2Fdler.cloud%2Fsubscribe
Finally subscribe this link in Clash and you are done!
```
### Quick Conversion
When the Surge configuration file has already meet your requirements, but you also need a same Clash configuration with the same groups and rules, you can use the following method:
```txt
http://127.0.0.1:25500/surge2clash?link=url_to_Surge_subscription
```
Here `url_to_Surge_subscription` **does not need to be URLEncoded** and no other configuration is needed.
---
## Advanced Usage
@@ -128,10 +151,11 @@ http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&emoji=%EMOJI%····
| sort | No | true / false | Sort nodes in alphabetical order. Default is `false`. |
| include | No | See `include_remarks` | Exclude nodes which remarks match the following patterns. Supports regular expression. Process with [URLEncode](https://www.urlencoder.org/) first. **WILL OVERRIDE THE SAME SETTING IN `pref.ini`** |
| exclude | No | See `exclude_remarks` | Only include nodes which remarks match the following patterns. Supports regular expression. Process with [URLEncode](https://www.urlencoder.org/) first. **WILL OVERRIDE THE SAME SETTING IN `pref.ini`** |
| filename | No | MySS | Set the file name while downloading. Can be used as a profile name in Clash for Windows. |
Example:
```TXT
```txt
You have the following subscription: `https://dler.cloud/subscribe/ABCDE?clash=vmess`, and you want to convert it to Surge 4 subscription, set UDP and TFO to enabled,
add Emoji to node remarks and filter out unused nodes named "剩余流量:1024G" and "官网地址:dler.cloud".
@@ -148,6 +172,49 @@ http://127.0.0.1:25500/sub?surge&ver=4&tfo=true&udp=true&emoji=true&exclude=%28%
Finally subscribe this link in Surge and you are done!
```
### Profiles
> After preparing all the arguments for the subscription link, it may be too long and hard to remember. Now you can consider setting up a profile.
For now **only local profiles are allowed.**
#### Interface for Profiles
```txt
http://127.0.0.1:25500/getprofile?name=%NAME%&token=%TOKEN%
```
#### Description
| Argument | Needed | Example | Explanation |
| -------- | :----: | :--------------- | :------------------------ |
| name | Yes | profiles/formyairport.ini | The path to the profile. (relative to the `pref` configuration) |
| token | Yes | passwd | The access token for authorization. (Please check `api_access_token` in the `[common] section` in `pref` configuration. |
Notice that arguments in the profile **does not require URLEncode**.
Create a new text file **only in the same directory or a sub-directory** of the `pref` configuration (a sub-directory named `profiles` is recommended) and name it, for example `formyairport.ini`, then fill the arguments to the file according to the [example profile](https://github.com/tindy2013/subconverter/blob/master/base/profiles/example_profile.ini), then you are good to go.
<details>
<summary>Example:</summary>
Using the same example in [Advanced Usage](#advanced-usage), the content of `formyairport.ini` should be:
```txt
[Profile]
url=https://dler.cloud/subscribe/ABCDE?clash=vmess
target=surge
surge_ver=4
tfo=true
udp=true
emoji=true
exclude=(流量|官网)
```
After saving it to the `profile` directory, you can access `http://127.0.0.1:25500/getprofile?name=profiles/formyairport.ini&token=passwd` to read this profile.
</details>
### Configuration File
> Check comments inside [pref.ini](https://github.com/tindy2013/subconverter/blob/master/base/pref.ini) for more information.