chore: update readme and config comment

pull/254/head
zijiren 4 months ago
parent 6f49476290
commit b30f694cf2

@ -46,18 +46,20 @@ SyncTV 的同步观影功能确保所有观看视频的人都在同一点上。
- [x] 代理
- [x] 视频代理
- [x] 直播代理
- [x] 代理缓存
- [x] 解析
- [x] 视频解析
- [x] Alist
- [x] Bilibili
- [x] Emby
- [ ] 直播解析
- [x] 直播解析
- [x] 哔哩哔哩
---
# 演示站点
https://demo.synctv.wiki
[https://demo.synctv.wiki](https://demo.synctv.wiki)
---
@ -105,7 +107,7 @@ synctv server --data-dir ./
# 文档
https://docs.synctv.wiki
[https://docs.synctv.wiki](https://docs.synctv.wiki)
# 特别赞助商

@ -46,18 +46,20 @@ SyncTV's synchronized viewing feature ensures that everyone watching the video i
- [x] Proxy
- [x] Videos proxy
- [x] Live proxy
- [x] Proxy cache
- [x] Parse
- [x] Parse video
- [x] Alist
- [x] Bilibili
- [x] Emby
- [ ] Parse live
- [x] Parse live
- [x] Bilibili
---
# Demo
<https://demo.synctv.wiki>
[https://demo.synctv.wiki](https://demo.synctv.wiki)
---
@ -105,7 +107,7 @@ synctv server --data-dir ./
# Documentation
<https://docs.synctv.wiki>
[https://docs.synctv.wiki](https://docs.synctv.wiki)
# Special sponsors

@ -3,8 +3,8 @@ package conf
type ServerConfig struct {
Http HttpServerConfig `yaml:"http"`
Rtmp RtmpServerConfig `yaml:"rtmp"`
ProxyCachePath string `yaml:"proxy_cache_path" env:"SERVER_PROXY_CACHE_PATH"`
ProxyCacheSize string `yaml:"proxy_cache_size" env:"SERVER_PROXY_CACHE_SIZE"`
ProxyCachePath string `yaml:"proxy_cache_path" env:"SERVER_PROXY_CACHE_PATH" hc:"proxy cache path storage path, empty means use memory cache"`
ProxyCacheSize string `yaml:"proxy_cache_size" env:"SERVER_PROXY_CACHE_SIZE" hc:"proxy cache max size, example: 1MB 1GB, default 1GB"`
}
type HttpServerConfig struct {

@ -25,10 +25,14 @@ var (
fileCache Cache
)
const (
defaultCacheSize = 1024 * 1024 * 1024 // 1GB
)
// MB GB KB
func parseProxyCacheSize(sizeStr string) (int64, error) {
if sizeStr == "" {
return 0, nil
return defaultCacheSize, nil
}
sizeStr = strings.ToLower(sizeStr)
sizeStr = strings.TrimSpace(sizeStr)
@ -61,7 +65,7 @@ func getCache() Cache {
log.Fatalf("parse proxy cache size error: %v", err)
}
if size == 0 {
size = 1024 * 1024 * 1024
size = defaultCacheSize
}
if conf.Conf.Server.ProxyCachePath == "" {
log.Infof("proxy cache path is empty, use memory cache, size: %d", size)

Loading…
Cancel
Save