forked from pepsik-kiev/HTTPAceProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacedefconfig.py
60 lines (55 loc) · 2.13 KB
/
acedefconfig.py
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
'''
AceProxy default configuration script
DO NOT EDIT THIS FILE!
Copy this file to aceconfig.py and change only needed options.
'''
import logging, colorer
import platform
from aceclient.acemessages import AceConst
# Loggin level for selected modules
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("chardet").setLevel(logging.WARNING)
class AceDefConfig(object):
acespawn = False
acecmd = 'acestreamengine --client-console --live-buffer 25 --vod-buffer 10 --vod-drop-max-age 120'
acekey = 'n51LvQoTlJzNGaFxseRK-uvnvX-sD4Vm5Axwmc4UcoD-jruxmKsuJaH0eVgE'
ace = { 'aceHostIP': '127.0.0.1', 'aceAPIport': '62062', 'aceHTTPport': '6878' }
aceage = AceConst.AGE_18_24
acesex = AceConst.SEX_MALE
acestartuptimeout = 10
aceconntimeout = 5
aceresulttimeout = 5
httphost = ''
httpport = 8000
aceproxyuser = ''
firewall = False
firewallblacklistmode = False
firewallnetranges = (
'127.0.0.1',
'192.168.0.0/16',
)
maxconns = 10
acestreamtype = {'output_format': 'http'}
# Example for hls-steam request from AceEngine
#acestreamtype = {'output_format': 'hls', 'transcode_audio': 0, 'transcode_mp3': 0, 'transcode_ac3': 0, 'preferred_audio_language': 'rus'}
transcodecmd = {}
#transcodecmd['default'] = 'ffmpeg -i - -c:a copy -c:v copy -f mpegts -'.split()
videoseekback = 0
videotimeout = 30
fakeuas = ('Mozilla/5.0 IMC plugin Macintosh', )
loglevel = logging.DEBUG
logfmt = '%(filename)-20s [LINE:%(lineno)-4s]# %(levelname)-8s [%(asctime)s] %(message)s'
logdatefmt='%d.%m %H:%M:%S'
logfile = None
@staticmethod
def isFakeRequest(path, params, headers):
useragent = headers.get('User-Agent')
if not useragent:
return False
elif useragent in AceConfig.fakeuas:
return True
elif useragent == 'Lavf/55.33.100' and not 'Range' in headers:
return True
elif useragent == 'GStreamer souphttpsrc (compatible; LG NetCast.TV-2013) libsoup/2.34.2' and headers.get('icy-metadata') != '1':
return True
osplatform = platform.system()