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.3.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

SouBaiduPan-0.1.3-py2.py3-none-any.whl (7.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: SouBaiduPan-0.1.3.tar.gz
  • Upload date:
  • Size: 13.0 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.3.tar.gz
Algorithm Hash digest
SHA256 75435c97be819bc4a1479df1d0e84e9e5ed15236c71dd689fabf7e39311cb0e8
MD5 a46d829d8d43d2d33504f90010dde56e
BLAKE2b-256 0ab9cdbd122e404d1f501f45ea3ee2bcaecd7e342e1aa5c9b27635ebc6a8b97d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for SouBaiduPan-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 687e44c780ee76bc2e634fb0d731ac9a8a570403aad4bfb3ef5c0362a7fba45c
MD5 ea719dc86161faf8cf95c7246488220e
BLAKE2b-256 515ab7d6958ba105c7395acad93f7c03f5bdcd00ea6e6a8be96c83b311148b3f

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