Корректная обработка ошибок при неправильном имени канала.
[vpproxy.git] / vpconfig.py
1 '''
2 VPProxy configuration script
3 Edit this file.
4 '''
5
6 import logging
7
8 class VPConfig():
9
10     # Message level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
11     debug = logging.INFO
12     # HTTP Server host
13     httphost = '0.0.0.0'
14     # HTTP Server port
15     httpport = 8001
16     # If started as root, drop privileges to this user.
17     # Leave empty to disable.
18     vpproxyuser = 'vpproxy'
19     # Enable firewall
20     firewall = False
21     # Firewall mode. True for blackilst, False for whitelist
22     firewallblacklistmode = False
23     # Network ranges. Please don't forget about comma in the end
24     # of every range, especially if there is only one.
25     firewallnetranges = (
26         '127.0.0.1',
27         '192.168.0.0/16',
28         '10.8.0.0/16',
29         )
30     # Maximum concurrent connections (video clients)
31     maxconns = 20
32     # Logging to a file
33     loggingtoafile = True
34     # Path for logs, default is current directory. For example '/tmp/'
35     logpath = '/var/log/vpproxy/'
36     #
37     # ----------------------------------------------------
38     # VLC configuration
39     # ----------------------------------------------------
40     #
41     # VLC cmd line (use `--file-logging --logfile=filepath` to write log)
42     vlccmd = "vlc -I telnet --clock-jitter 0 --network-caching 500 --sout-mux-caching 2000 --telnet-password admin --telnet-port 4212"
43     # VLC spawn timeout
44     # Adjust this if you get error 'Cannot spawn VLC!'
45     vlcspawntimeout = 15
46     # VLC host
47     vlchost = '127.0.0.1'
48     # VLC telnet interface port
49     vlcport = 4212
50     # VLC streaming port (you shouldn't set it in VLC itself)
51     vlcoutport = 8099
52     # VLC telnet interface password
53     vlcpass = 'admin'
54     # Pre-access (HTTP) VLC parameters
55     # You can add transcode options here
56     # Something like #transcode{acodec=mpga,ab=128,channels=2,samplerate=44100}
57     vlcpreaccess = ''
58     # VLC muxer. You probably want one of these streamable muxers:
59     # ts, asf, flv, ogg, mkv
60     # You can use ffmpeg muxers too, if your VLC is built with it
61     # ffmpeg{mux=NAME} (i.e. ffmpeg{mux=mpegts})
62     # VLC's ts muxer sometimes can work badly, but that's the best choice for
63     # now.
64     vlcmux = 'ts'
65     # Force ffmpeg INPUT demuxer in VLC. Sometimes can help.
66     vlcforceffmpeg = False
67     # Delay before closing connection when client disconnects
68     # In seconds.
69     videodestroydelay = 5
70     # Pre-buffering timeout. In seconds.
71     videotimeout = 30
72     #
73     # Some video players (mostly STBs and Smart TVs) can generate dummy requests
74     # to detect MIME-type or something before playing.
75     # We send them 200 OK and do nothing.
76     # We add their User-Agents here
77     fakeuas = ('Mozilla/5.0 IMC plugin Macintosh', )
78     #
79     # Some video players have very short timeout and can disconnect from the proxy
80     # before the headers sent.
81     # We send them 200 OK and MPEG MIME-type right after connection has been initiated
82     fakeheaderuas = ('HLS Client/2.0 (compatible; LG NetCast.TV-2012)',
83                      'Mozilla/5.0 (DirectFB; Linux armv7l) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+ LG Browser/5.00.00(+mouse+3D+SCREEN+TUNER; LGE; 42LM670T-ZA; 04.41.03; 0x00000001;); LG NetCast.TV-2012 0',
84                      )