An enhancement overlay for RSSHub
Modules
- Load Balance
- Machine Translate
- Image Proxy
Workflow
- Request RSSHub endpoint (through JSON format) till one success, or 503
- (Optional) Send to machine translate and cache results
- (Optional) Apply image proxy rules
- Re-construct feed to target format
Configuration
Configuration is combined of 4 parts: system, rsshub, translate and image_proxy. An example can be referred from config.yml.example
.
system
part defines the basic info of this application, every field is required.
rsshub
part defines all RSSHub instance and their corresponding preferences (preferred platforms and whether it can work as a fallback instance).
Different RSSHub has different configuration options, so offload different requests to different instances effectively should be helpful.
Or if just one single RSSHub instance is provided, skip platforms
field and set fallback
to true
to handle all incoming requests.
translate
defines the service provider and other request details. We are using subdomain to identify target language to provide a smooth experience for end users,
which is configured by host_base
: in example configuration, our translate-enabled domain is *.rsl.localhost
.
For example, if we request zh.rsl.locahost
, then zh
will be select as target language.
Different translate provider has different settings, for libretranslate
we are using YAML format. Please refer to different provider settings.
image_proxy
provides a simple image proxy service to bypass image protect mechanisms. To provide more flexibility, we don't pre-define any built-in rules here,
please add your own rules for different platforms.
Only system
and rsshub
parts are required, if you don't want translate
or image_proxy
function, simply delete them.
Tech spec
Load Balance
Based on random numbers.
Maybe add redis based load-balance in the future.
Translate
Supported Translate Providers
Add more provider
- Copy
modules/translate/providers/libretranslate
directory and rename to your target provider
- Update relative codes (settings, initializer, translate func)
- Update
modules/translate/providers/new.go
func, add your provider
Image Proxy
Currently only Origin
and Referer
can be specified.
Maybe add more options in the future.
Follows RSSHub format query, currently 3 formats:
rss
: RSS 2.0 (default / fallback)
atom
: Atom
json
: JSON Feed