python获取飞讯免费ss账号

ss账号除了ss-link比较便宜,其他的都比较贵,贵的对于大众网友来说,有点离谱了。看到飞讯有免费的ss,但是手动拷贝太麻烦,索性用最近学的python写的小程序,直接生成配置

#coding=utf-8
import sys, urllib,codecs
from lxml import etree
url = "http://www.feixunvpn.com/page/testss.html"
sslist =[]
iplist=[]
for i in range(30):
    wp = urllib.urlopen(url)
    content = wp.read()
    tree=etree.HTML(content)
    ip=tree.xpath("//div[@class='testvpnitem']")[0][2].text
    port=tree.xpath("//div[@class='testvpnitem']/text()")[2].strip()[-4:]
    passwd=tree.xpath("//div[@class='testvpnitem']/text()")[3].strip()[-6:]
    ss=[ip,str(port),str(passwd)]
    if(ss[0] not in iplist):
        iplist.append(ss[0])
        sslist.append(ss)
print("获得"+str(len(sslist))+"个ss测试账号")
conf='{\n"configs" : [\n'
for ss in sslist:
    conf=conf +'{\n"server" : "'+ss[0]+'",\n"server_port" : '+ss[1]+',\n"password" : "'+ss[2]+'",' \
            '\n"method" : "aes-256-cfb",\n"remarks" : ""}'
conf=conf+'],\n"strategy" : "com.shadowsocks.strategy.ha",\n"index" : -1,\n"global" : false,\n' \
          '"enabled" : true,\n"shareOverLan" : false,\n"isDefault" : false,\n"localPort" : 1081,' \
          '\n"pacUrl" : null,\n"useOnlinePac" : false,\n"availabilityStatistics" : false}'
print conf
ssf = open("gui-config.json","w")
ssf.write(conf)
ssf.close()
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

bwlab

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值