zoukankan      html  css  js  c++  java
  • 爬取百度网盘资源报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'

    再试试说不定就可以了。

     
     
  • 相关阅读:
    2016.6.26考试
    爆搜。。。。。。。
    9.18目标
    9.17水题总结
    9.16测试
    9.10考试
    jzoj P1163 生日派对灯
    9.04考试总结
    8/8刷题记录
    a[i++]
  • 原文地址:https://www.cnblogs.com/Renyi-Fan/p/11609275.html
Copyright © 2011-2022 走看看