一键生成前3后2指定城市手机号vcf文件

叮!

必要 python

相关 numpy requests

请先

  • pip install numpy
  • pip install request

手机用户可以使用termux来搭建环境

https://b23.tv/N99jbE4

使用numpy是为了提升效率 事实上我个人感觉确实也有不错的效果

但是由于array跟list的转换 会导致我的代码可能看起来很怪 不过加了注释我觉得大家应该也能看懂

效果预览

20220522160237226-473x1024-1

20220522160248599-473x1024-1

代码如下

#导入模块
import numpy
import re
import requests
import time


#添加参数
print('叮!请完善相关参数.模式1代表将所有号码写入一个vcf一次性导入
seed0 = input('模式(1/2)')
seed1 = input('头三位:')
seed2 = input('城市(拼音):')
seed3 = input('尾2位:')


#计时
S = time.perf_counter()


#获取号段
modify = seed1 + '/' + seed2 + '.htm'
url = 'https://m.jihaoba.com/haoduan/' + modify
headers = {'User-Agent' : 'Mozilla/5.0 (Linux; U; Android 10; zh-H
seedling = requests.get(url=url,headers=headers).text
ex = '(\d{7})号段'
Mature = re.findall(ex,seedling,re.S)
matrix0 = numpy.array(Mature)
matrix = matrix0.astype(int)


#运算
matrix2 = matrix * 100
list0 = matrix2.tolist()
listK = []
for i in list0:
segment = numpy.arange(i,i+100,dtype=numpy.int64)
fruit = segment * 100 + 12
listK.append(fruit.tolist())


#数据处理
if int(seed0)==2:
for x in range(len(listK)):
for n in listK[x]:
s = 'BEGIN:VCARD\n'+'N;CHARSET=UTF-8:'+str(n)+'\n'+'FN
with open('/path/'+str(x)+'.vcf'
f.write(s)
else:
for x in range(len(listK)):
for n in listK[x]:
s = 'BEGIN:VCARD\n'+'N;CHARSET=UTF-8:'+str(n)+'\n'+'FN
with open('/path/'+'number.vcf',
f.write(s)


#计时
E = time.perf_counter()
dur = E-S


#输出成果
print('叮!共生成号码:'+'\n'+str(len(listK)*100))
print('叮!耗时:'+'\n'+str(dur))

 

 
 

请在open函数后 path/替换成你想让手机号生成的文件夹位置

为防止被检测 又添加了一个分割vcf的模式

生成耗时在0.5s左右(手机) 电脑上还会更快

以上

© 版权声明
THE END
喜欢就支持一下吧
点赞8赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容