Skip to main content

BaiduPan searcher

Project description

SouBaiduPan-master

百度网盘搜索工具

实现功能:搜索百度网盘资源,自动抓取链接和密码,并可以在浏览器中批量打开。

使用方法介绍:

参考notebook

  1. 安装SouBaiduPan

    pip install SouBaiduPan
    
  2. SouBaiduPan导入searcher,并创建搜索器对象。初始化时,需要设定的参数包括:搜索关键词最大搜索页数。其中搜索关键词建议在后面加上"网盘",可以提高成功率;最大搜索页数建议选择20以内,设置太大的话可能会触发百度的验证码机制,导致无法继续爬取。

    from SouBaiduPan import searcher
    
    keywords = "月球陨落 网盘"
    
    S = searcher.BaiduPanSearcher(keywords=keywords, max_page_nums=20)
    
  3. 设置浏览器cookie。以Chrome浏览器为例,首先需要先在浏览器内打开百度,然后在空白处右键->检查,在调出来的界面的上方,点击Network标签,然后刷新网页,此时会刷新出很多请求信息,拉到最上面,找到www.baidu.com的请求,单击点一下,右边会跳出一个边栏,确保在边栏上方选择的是Headers标签(默认就是,所以不要动就行),然后找到Cookie对应的一长串的神秘代码,复制下来就行了。然后像下面这样进行设置:

    S.set_cookie('请在这里输入你的cookie')
    
  4. 执行下方代码,即可开始搜索。如果需要在浏览器中自动打开搜索到的网盘链接,请务必下载Chrome浏览器自动化测试驱动,方法请参考: https://zhuanlan.zhihu.com/p/373688337

    一些参数解释:

    show: 打印搜索到的链接,建议勾选。

    show_origin_url: 是否显示所有度盘链接的原链接。但如果提取码没识别到,则一定会显示。

    open_in_Chrome: 自动在Chrome浏览器中打开所有链接。请务必先安装驱动程序。

    save_json_path: 保存为json文件的路径。建议用搜索词命名,文件后缀为.json

    S.get_dupan_urls(
        show=True, 
        open_in_Chrome=True, 
        save_json_path=f"./{keywords}.json"
    )
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SouBaiduPan-0.1.4.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

SouBaiduPan-0.1.4-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file SouBaiduPan-0.1.4.tar.gz.

File metadata

  • Download URL: SouBaiduPan-0.1.4.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.8

File hashes

Hashes for SouBaiduPan-0.1.4.tar.gz
Algorithm Hash digest
SHA256 eb74935f7ee3c959e12492f82f831bfffb0dc1bc5036760a3cfa2f3eaf4a3344
MD5 71fa5bf28e332721e308fddbdcc48314
BLAKE2b-256 443c9cc939a432bbdbff81059096884e0eb6e30d26380a437b728c59ce5628c5

See more details on using hashes here.

File details

Details for the file SouBaiduPan-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for SouBaiduPan-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9faf2582bfbb593bf8ff47c51cafd28b49e9d27fc4c377a5eb241ea89e602941
MD5 c7b9638740a53b859e8c952ebf4561ef
BLAKE2b-256 665c9e3a38339db424423b1bf09963ef71d1f8b248a9b7f96186b08807f85b7b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page