mirror of
https://github.com/Toperlock/sing-box-geosite.git
synced 2025-08-03 07:17:36 +08:00
filter AND
logical rules
This commit is contained in:
parent
4ea9fc04df
commit
78eeac3618
9
main.py
9
main.py
@ -13,8 +13,13 @@ def read_yaml_from_url(url):
|
|||||||
return yaml_data
|
return yaml_data
|
||||||
|
|
||||||
def read_list_from_url(url):
|
def read_list_from_url(url):
|
||||||
df = pd.read_csv(url, header=None, names=['pattern', 'address', 'other'], on_bad_lines='warn')
|
df = pd.read_csv(url, header=None, names=['pattern', 'address', 'other', 'other2', 'other3'])
|
||||||
return df
|
filtered_rows = []
|
||||||
|
for index, row in df.iterrows():
|
||||||
|
if 'AND' not in row['pattern']:
|
||||||
|
filtered_rows.append(row)
|
||||||
|
df_filtered = pd.DataFrame(filtered_rows, columns=['pattern', 'address', 'other', 'other2', 'other3'])
|
||||||
|
return df_filtered
|
||||||
|
|
||||||
def is_ipv4_or_ipv6(address):
|
def is_ipv4_or_ipv6(address):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user