# coding:utf-8
#author:halfopen
#下载acfun表情图片
#
# url ="http://static.acfun.mm111.net/dotnet/20130418/umeditor/dialogs/emotion/images/**/**.gif"
from urllib.request import urlopen, urlretrieve
import sys
import os
# 设置 cookie
type = ["brd","ac", "ac2","td", "tsj", "ais", "td"]
part_url = "http://cdn.aixifan.com/dotnet/20130418/umeditor/dialogs/emotion/images/"
for j in type:
isExists=os.path.exists(j)
if not isExists:
os.mkdir(str(j))
def update(num1, num2):
for j in type:
for i in range(num1, num2):
url = part_url+j+ "/%02d"%i +".gif"
print(url)
try:
#f = request
f = urlopen(url)
with open(j+"/%02d"%i+".png", "wb") as code:
code.write(f.read())
except Exception as err:
#print(err+"超出图片范围")
break
update(1,100)
下载acfun表情图片
最新推荐文章于 2021-12-16 16:22:43 发布