-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_v2ray.py
More file actions
32 lines (25 loc) · 757 Bytes
/
get_v2ray.py
File metadata and controls
32 lines (25 loc) · 757 Bytes
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
from sources import *
from dotenv import load_dotenv
load_dotenv()
import sys
import glob
v2ray_sources = {
"global1": Global1V2Ray()
}
def main():
args = sys.argv[1:]
if len(args) <= 1:
for clazz in v2ray_sources.values():
clazz.update()
else:
for arg in args:
lowered_arg = arg.lower()
if lowered_arg in v2ray_sources:
v2ray_sources[lowered_arg].update()
f_raw = open("files/v2ray_raw.txt", "w", encoding="utf-8")
for file_path in glob.glob("files/raw/*.txt"):
with open(file_path, "r", encoding="utf-8") as f:
f_raw.write(f.read())
f_raw.close()
if __name__ == "__main__":
main()