爬取百度網盤資源報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'

再試試說不定就可以了。

 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM