爬取百度网盘资源报user is not authorized, hitcode:119
生活随笔
收集整理的這篇文章主要介紹了
爬取百度网盘资源报user is not authorized, hitcode:119
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
爬取百度網盤資源報user is not authorized, hitcode:119
一、總結
一句話總結:
可能是百度網盤禁止非客戶端環境下載大文件,所以將請求頭改為客戶端:'User-Agent': 'netdisk;8.2.0;android-android;4.4.4'
不知道什么時候開始,百度網盤禁止非客戶端環境下載大文件。
所以爬取內容時,將User-Agent修改
本來你請求頭中的User-Agent是這么寫的
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36現在修改為
'User-Agent': 'netdisk;8.2.0;android-android;4.4.4'再試試說不定就可以了。
?
?
?
二、爬取百度網盤資源報user is not authorized, hitcode:119
轉自或參考:爬取百度網盤資源報user is not authorized, hitcode:119
https://blog.csdn.net/wuhaibin12/article/details/85007379
對于小于100M的文件,在抓包得到下載連接后可以直接開始爬取內容。
對于大于100M的文件,爬取時會得到user is not authorized, hitcode:119的返回值。
不知道什么時候開始,百度網盤禁止非客戶端環境下載大文件。
所以爬取內容時,將User-Agent修改
本來你請求頭中的User-Agent是這么寫的
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36現在修改為
'User-Agent': 'netdisk;8.2.0;android-android;4.4.4'再試試說不定就可以了。
轉載于:https://www.cnblogs.com/Renyi-Fan/p/11609275.html
總結
以上是生活随笔為你收集整理的爬取百度网盘资源报user is not authorized, hitcode:119的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 石川es6课程---12、Promise
- 下一篇: 【WC2016】论战捆竹竿