示例#1
0
文件: service.py 项目: newzf/v2rayT
 def get_vmesslinks(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.outbound)['vmess'], key)
     vmesslinks = [{
         'remarks': x['remarks'],
         'link': node2vmesslink(x)
     } for x in d]
     return vmesslinks, Dealdata.praseindex(key)
示例#2
0
文件: service.py 项目: newzf/v2rayT
 def get_router(self, key, mode):
     if mode == 1:
         r = data(self.router)['direct']['ip']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
     elif mode == 2:
         r = data(self.router)['direct']['domain']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
     elif mode == 3:
         r = data(self.router)['proxy']['ip']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
     elif mode == 4:
         r = data(self.router)['proxy']['domain']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
     elif mode == 5:
         r = data(self.router)['block']['ip']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
     elif mode == 6:
         r = data(self.router)['block']['domain']
         d, _ = Dealdata.cut_data(r, key)
         return d, Dealdata.praseindex(key)
示例#3
0
文件: config.py 项目: newzf/v2rayT
 def update_node_by_sub(self, subkey='all', proxy_port=None):
     sublist = self.data['sub']
     selectdata, _ = Dealdata.cut_data(sublist, subkey)
     subids = []
     newnodes = []
     for sub in selectdata:
         vmessobjs = vmess.sublink2vmessobjs(sub['url'], proxy_port)
         if vmessobjs != None:
             subids.append(sub['id'])
             for obj in vmessobjs:
                 newnodes.append(vmess.vemssobj2node(obj, sub['id']))
     for node in self.data['vmess']:
         if node['subid'] not in subids:
             newnodes.append(node)
     self.data['vmess'] = newnodes
示例#4
0
文件: service.py 项目: newzf/v2rayT
 def get_router_proxy_ip(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.router)['proxy']['ip'], key)
     return d, Dealdata.praseindex(key)
示例#5
0
文件: service.py 项目: newzf/v2rayT
 def get_dns(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.dns), key)
     return d, Dealdata.praseindex(key)
示例#6
0
文件: service.py 项目: newzf/v2rayT
 def get_sub(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.outbound)['sub'], key)
     return d, Dealdata.praseindex(key)
示例#7
0
文件: service.py 项目: newzf/v2rayT
 def get_node(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.outbound)['vmess'], key)
     return d, Dealdata.praseindex(key)
示例#8
0
文件: config.py 项目: newzf/v2rayT
 def del_node(self, key):
     olddata = self.data['vmess']
     _, newdata = Dealdata.cut_data(olddata, key)
     self.data['vmess'] = newdata
     return len(olddata) - len(newdata)
示例#9
0
文件: config.py 项目: newzf/v2rayT
 def del_block_ip(self, key):
     r = self.data['block']['ip']
     _, new_data = Dealdata.cut_data(r, key)
     self.data['block']['ip'] = new_data
     return len(r) - len(new_data)
示例#10
0
文件: config.py 项目: newzf/v2rayT
 def del_direct_ip(self, key):
     r = self.data['direct']['ip']
     _, new_data = Dealdata.cut_data(r, key)
     self.data['direct']['indexs'] = new_data
     return len(r) - len(new_data)
示例#11
0
文件: config.py 项目: newzf/v2rayT
 def del_direct_domain(self, key):
     r = self.data['direct']['domain']
     _, new_data = Dealdata.cut_data(r, key)
     self.data['direct']['domain'] = new_data
     return len(r) - len(new_data)
示例#12
0
文件: config.py 项目: newzf/v2rayT
 def del_proxy_ip(self, key):
     r = self.data['proxy']['ip']
     _, new_data = Dealdata.cut_data(r, key)
     self.data['proxy']['ip'] = new_data
     return len(r) - len(new_data)
示例#13
0
文件: config.py 项目: newzf/v2rayT
 def del_proxy_domain(self, key):
     r = self.data['proxy']['domain']
     _, new_data = Dealdata.cut_data(r, key)
     self.data['proxy']['domain'] = new_data
     return new_data, len(r) - len(new_data)
示例#14
0
文件: config.py 项目: newzf/v2rayT
 def del_DNS(self, key):
     _, newdata = Dealdata.cut_data(self.data, key)
     l = len(self.data) - len(newdata)
     self.data = newdata
     return l
示例#15
0
文件: config.py 项目: newzf/v2rayT
 def del_sub(self, key):
     olddata = self.data['sub']
     _, newdata = Dealdata.cut_data(olddata, key)
     self.data['sub'] = newdata
     return len(olddata) - len(newdata)
示例#16
0
文件: service.py 项目: newzf/v2rayT
 def get_router_direct_ip(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.router)['direct']['ip'], key)
     return d, Dealdata.praseindex(key)
示例#17
0
文件: service.py 项目: newzf/v2rayT
 def get_router_block_domain(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.router)['block']['domain'], key)
     return d, Dealdata.praseindex(key)
示例#18
0
文件: service.py 项目: newzf/v2rayT
 def get_router_block_ip(self, key='all'):
     d, _ = Dealdata.cut_data(data(self.router)['block']['ip'], key)
     return d, Dealdata.praseindex(key)[:len(d)]