新浪外链速度快,又免费,很多人在用,但是图片管的比较严,稍微暴露点就会被检测到导致失效,所以写了一个检测失效图片的脚本
python代码:
import requests
#新浪随机壁纸有效判断
d = 0
aa = ''
with open('./a.txt', 'r') as w:
b = w.readlines()
for line in b:
c = 'https://tva3.sinaimg.cn/large/' + line.strip()+ '.jpg'
a = requests.get(c).url
print(a)
if(a == 'https://tva3.sinaimg.cn/images/default_d_h_large.gif#101'):
d = d + 1
aa += line
print('一共'+str(d)+'条无效链接')
print(aa)
txt文件填外链的名字就好了,不要全链接,例如https://tva3.sinaimg.cn/large/9bd9b167gy1g4c8tqul23j21hc0u0b29.jpg
填写红色部分就可以了
txt文本格式:
9bd9b167gy1g4c8tjkcrjj21hc0u0b29
9bd9b167gy1g4c8tqul23j21hc0u0b29
9bd9b167gy1g4c8tcfekhj21hc0u0e81
9bd9b167gy1g4c8tms2rij21hc0u0hdt
9bd9b167gy1g4dq1wyi6oj20u01hcwkc
9bd9b167gy1g4c8tdso90j21hc0u0kjl
9bd9b167gy1g4c8t8537yj21hc0u0kjl
9bd9b167gy1g4c8tl3wjyj21hc0u0npd
9bd9b167gy1g4c8thewgej21hc0u0qv5
9bd9b167gy1g4c8tv2mxbj21hc0u0qv5
9bd9b167gy1g4c8tuf5p5j21hc0u0u0x
9bd9b167gy1g4c8ttor92j21hc0u01ky
评论