-
Notifications
You must be signed in to change notification settings - Fork 2
/
main0.py
72 lines (53 loc) · 1.92 KB
/
main0.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import requests
import json
import time
import re
import logging
import traceback
import os
import random
import datetime
import utils
# import base64
def main(event, context):
# 初始化日志文件
utils.initLog('log.txt')
utils.clearLog()
savePoint(
'https://eu-proxypool.herokuapp.com/clash/proxies?nc=CN&speed=30', 'eu-proxypool')
savePoint(
'https://free886.herokuapp.com/clash/proxies?nc=CN', 'free886')
savePoint(
'http://guobang.herokuapp.com/clash/proxies?nc=CN&speed=30', 'guobang')
savePoint(
'https://hellopool.herokuapp.com/clash/proxies?nc=CN&speed=50', 'hellopool')
savePoint(
'https://free.jingfu.cf/clash/proxies?nc=CN&speed=20', 'jingfu')
# savePoint(
# 'https://fq.lonxin.net/clash/proxies?nc+CN&type=trojan', 'lonxin')
savePoint(
'https://origamiboy.herokuapp.com/clash/proxies?nc=CN&speed=10', 'origamiboy')
savePoint(
'https://sspool.herokuapp.com/clash/proxies?nc=CN&speed=50', 'sspool')
savePoint(
'https://us-proxypool.herokuapp.com/clash/proxies?nc=CN&speed=20', 'us-proxypool')
# savePoint(
# 'http://clash.3wking.com:12580/clash/proxies?nc=CN', '3wking')
# savePoint(
# 'https://proxy.cloudkingzst.xyz/clash/proxies?c=US&type=ss', 'cloudkingzst')
# savePoint(
# 'https://ednovas.design/clash/proxies?nc=CN&speed=40', 'ednovas')
# 获取文章地址
def savePoint(url, name):
resp = requests.get(url)
dirs = './subscribe'
day = time.strftime('%Y.%m.%d', time.localtime(time.time()))
if 'proxies' in resp.text:
if not os.path.exists(dirs):
os.makedirs(dirs)
with open(dirs + '/' + name, 'w', encoding='utf-8') as f:
f.write(resp.text.replace('"name":"','"name":"'+ day+'_'))
print(name+'生成成功')
# 主函数入口
if __name__ == '__main__':
main("", "")