Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

问题始于一个链接
https://i1.pixiv.net/img-zip-...
这个链接在浏览器打开,会直接下载一个不完整的zip文件

clipboard.png

clipboard.png

但是,使用下载器下载却是完整文件

clipboard.png

而当我尝试使用python下载的时候

from urllib import request
import sys
request.urlretrieve('https://i1.pixiv.net/img-zip-ugoira/img/2017/04/05/00/24/41/62259492_ugoira600x600.zip', '123.zip')

clipboard.png
403报错

想问一下,为什么浏览器,下载器,以及python下载的结果会不一样?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
313 views
Welcome To Ask or Share your Answers For Others

1 Answer

下载 pixiv 的文件或者图片都需要设置好 referer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...