mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2026-01-24 22:06:13 +03:00
Add tg voice
This commit is contained in:
22
convert.py
22
convert.py
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3.10
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import tldextract
|
import tldextract
|
||||||
import urllib.request
|
import urllib.request
|
||||||
@@ -332,6 +332,18 @@ def generate_srs_combined(input_subnets_file, input_domains_file, output_json_di
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
elif input_subnets_file == "Subnets/IPv4/telegram.lst" and input_domains_file == "voice_messengers":
|
||||||
|
data = {
|
||||||
|
"version": 3,
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"network": ["udp"],
|
||||||
|
"ip_cidr": subnets,
|
||||||
|
"port": [1400],
|
||||||
|
"port_range": ["596:599"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
data = {
|
data = {
|
||||||
"version": 3,
|
"version": 3,
|
||||||
@@ -343,7 +355,10 @@ def generate_srs_combined(input_subnets_file, input_domains_file, output_json_di
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = os.path.splitext(os.path.basename(input_subnets_file))[0]
|
if input_domains_file == "voice_messengers":
|
||||||
|
filename = "voice_messengers"
|
||||||
|
else:
|
||||||
|
filename = os.path.splitext(os.path.basename(input_subnets_file))[0]
|
||||||
output_file_path = os.path.join(output_json_directory, f"{filename}.json")
|
output_file_path = os.path.join(output_json_directory, f"{filename}.json")
|
||||||
|
|
||||||
with open(output_file_path, 'w', encoding='utf-8') as output_file:
|
with open(output_file_path, 'w', encoding='utf-8') as output_file:
|
||||||
@@ -490,6 +505,9 @@ if __name__ == '__main__':
|
|||||||
generate_srs_combined(CloudfrontSubnets, "Services/cloudfront.lst")
|
generate_srs_combined(CloudfrontSubnets, "Services/cloudfront.lst")
|
||||||
generate_srs_combined(RobloxSubnets, "Services/roblox.lst")
|
generate_srs_combined(RobloxSubnets, "Services/roblox.lst")
|
||||||
|
|
||||||
|
# Sing-box voice for messengers
|
||||||
|
generate_srs_combined(TelegramSubnets, "voice_messengers")
|
||||||
|
|
||||||
# Xray domains
|
# Xray domains
|
||||||
prepare_dat_domains(russia_inside, 'russia-inside', directories)
|
prepare_dat_domains(russia_inside, 'russia-inside', directories)
|
||||||
prepare_dat_domains(russia_outside, 'russia-outside')
|
prepare_dat_domains(russia_outside, 'russia-outside')
|
||||||
|
|||||||
Reference in New Issue
Block a user