MCPcopy Create free account
hub / github.com/chasingboy/Xtools / select_web_info

Function select_web_info

lib/format_tools_result.py:33–57  ·  view source on GitHub ↗
(text:str)

Source from the content-addressed store, hash-verified

31
32
33def select_web_info(text:str) ->str:
34 web_list = re.findall(
35 r'WebTitle:?\s*(http.*?)\s+code:(\d+)\s+len:(.*?)\s+title:(.*?)\n', text+'\n'
36 )
37
38 if web_list == []:
39 return 'Web Code|Title 等信息为空'
40
41 finger_list = re.findall(r'InfoScan:?\s*(http.*?)\s+\[(.*?)]', text)
42
43 webinfo = []
44 for line in web_list:
45 finger = 'Null'
46 for x in finger_list:
47 if line[0] == x[0]:
48 finger = x[1]
49 break
50
51 webinfo.append(
52 '[{code}] {url} [{length}] [{title}] [Finger: {finger}]'.format(
53 url=line[0],code=line[1],length=line[2],title=line[3],finger=finger)
54 )
55
56 webinfo = '\n'.join(sorted(webinfo)).replace(' 跳转url: ','] [Redirect-> ')
57 return header + webinfo
58
59
60def select_ip_exp(text:str) -> str:

Callers 1

classify_fscan_resultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected