-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.example.jsonc
162 lines (162 loc) · 5.57 KB
/
config.example.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// example config for the app.
// only full string comments are supported,
// do not use /* comment */ and comment after keys.
// delete string to set key to the DEFAULT value.
{
// web server listen host.
// DEFAULT "0.0.0.0"
"host": "127.0.0.1",
// web server listen port.
// DEFAULT 8080
"port": 8080,
// used if video height not set in request.
// DEFAULT 720
"default-video-height": 360,
// restrict maximum video height.
// DEFAULT 720
"max-video-height": 1080,
// sites (hosts) list.
// if not empty, only the specified sites will work,
// others will be forbidden.
// see sub-config part for a detailed explanation.
// DEFAULT []
"sites": [],
// logger config
"log": {
// log level
// debug/info/warning/error/nothing
// DEFAULT "info"
"level": "info",
// log destination
// stdout/file/both
// DEFAULT "stdout"
"output": "stdout",
// filename if writing to file
// DEFAULT "log.txt"
"filename": "log.txt",
// set output to json format
// DEFAULT false
"json": false
},
// default restreamer config.
// restreamer takes https stream and restream it as http.
"streamer": {
// show errors in headers (insecure).
// streaming errors will be sent as Error-Header-xx header.
// DEFAULT false
"error-headers": false,
// do not strictly check video headers.
// if true, streamer will ignore incorrect "Content-Length" and "Content-Type" header.
// DEFAULT false
"ignore-missing-headers": false,
// do not check video server certificate (insecure)
// DEFAULT false
"ignore-ssl-errors": false,
// video file that will be shown on video stream errors
// DEFAULT "corrupted.mp4"
"error-video": "corrupted.mp4",
// audio file that will be played on audio stream errors
// downloaded here youtu.be/_b8KPiT1PxI (suggest your options)
// DEFAULT "failed.m4a"
"error-audio": "failed.m4a",
// how to set streamer's user-agent
// request - set from user's request (old default)
// extractor - set from extractor on app start (default)
// config - set from config
// DEFAULT "extractor"
"set-user-agent": "extractor",
// custom user agent used if "set-user-agent" set to "config"
// DEFAULT "Mozilla"
"user-agent": "Mozilla",
// proxy for restreamer
// empty - no proxy
// "env" - read proxy from environment variables (e.g. HTTP_PROXY="http://127.0.0.1:3128")
// proxy url - e.g. "socks5://127.0.0.1:9999"
// DEFAULT "env"
"proxy": "env",
// min TLS version: "TLS 1.3", "TLS 1.2", etc.
// DEFAULT "TLS 1.2"
"min-tls-version": "TLS 1.2"
},
// default media extractor config
"extractor": {
// file path
// "direct" - do not use extractor, just pass url to streamer
// DEFAULT "yt-dlp"
"path": "yt-dlp",
// arguments for extractor
// args separator is ",,", not space
// {{.HEIGHT}} will be replaced with requested height (360/480/720/...)
// {{.URL}} will be replace with requested url
// also you can use {{.FORMAT}} - requested format (now - only mp4 or m4a)
// DEFAULT "-f,,(mp4)[height<={{.HEIGHT}}],,-g,,{{.URL}}",
"mp4": "-f,,(mp4)[height<={{.HEIGHT}}],,-g,,{{.URL}}",
// same for m4a
// DEFAULT "-f,,(m4a),,-g,,{{.URL}}",
"m4a": "-f,,(m4a),,-g,,{{.URL}}",
// args for getting user-agent
// DEFAULT "--dump-user-agent"
"get-user-agent": "--dump-user-agent",
// add "https://" to links passed to extractor
// DEFAULT true
"force-https": true,
// custom options list to extractor, like proxy, etc.
// same rules as mp4/m4a
// HEIGHT/URL/.. templates also can be used
// DEFAULT []
"custom-options": [
// "--option1,,value1",
// "--option2",
// "value2",
// "--option3",
// "very long value 3",
// "--option4,,very long value 4"
]
},
// default links cache config
"cache": {
// links expire time
// time units are "s", "m", "h", e.g. "1h10m10s", "10h", "1s"
// "0s" will disable cache
// DEFAULT "3h"
"expire-time": "3h"
},
// per site configs for streamer, extractor and cache.
// absent options will be set from default part.
// only exact matching domains will be affected.
// e.g. "site.com/video" matching "site.com"
// but "www.site.com/video" is not
// DEFAULT []
"sub-config": [
{
// sub config name. displayed in logs
// cannot be empty
"name": "some site",
// sites list
"sites": [
"site.com",
"a.site.com"
],
"extractor": {
"path": "my-extractor",
"mp4": "{{.URL}}"
}
},
{
"name": "my stream",
"sites": [
"my.streamer.example"
],
"default-video-height": 1080,
"max-video-height": 1080,
"extractor": {
"path": "direct"
},
"streamer": {
"error-headers": true,
"ignore-missing-headers": true,
"ignore-ssl-errors": true
}
}
]
}