通过doi从scihub下载pdf。

scidownl的Python项目详细描述


scidownl

通过doi从scihub下载pdf。

  • 使用方便。
  • 容易处理验证码。
  • 易于更新scihub最新域。

安装

$ pip3 install -U scidownl

用法

命令行

$ scidownl -h
usage: Command line tool to download pdf via DOI from Scihub.
       [-h][-c CHOOSE][-D DOI][-o OUTPUT][-u][-l]

optional arguments:
  -h, --help            show this help message and exit
  -c CHOOSE, --choose CHOOSE
                        choose scihub url by index
  -D DOI, --DOI DOI     the DOI number of the paper
  -o OUTPUT, --output OUTPUT
                        directory to download the pdf
  -u, --update          update available Scihub links
  -l, --list            list current saved sichub urls

示例

# Update available links of Scihub
$ scidownl -u
[INFO] Updating links ...
[INFO] https://sci-hub.ren
[INFO] http://sci-hub.ren
[INFO] http://sci-hub.red
[INFO] http://sci-hub.se
[INFO] https://sci-hub.se
[INFO] http://sci-hub.tw

# Choose scihub url by the index.
$ scidownl -c 5
Current scihub url: http://sci-hub.tw

# List available links of Scihub. You can see the current scihub url is pointing to the 5th scihub url.
$ scidownl -l
  [0] https://sci-hub.ren
  [1] http://sci-hub.ren
  [2] http://sci-hub.red
  [3] http://sci-hub.se
  [4] https://sci-hub.se
* [5] http://sci-hub.tw

# Download to the current directory
$ scidownl -D 10.1021/ol9910114
$ scidownl -D 10.1021/ol9910114 -o .

# Download to the specified directory, ie. '-o paper' for downloading to paper directory.
$ scidownl -D 10.1021/ol9910114 -o paper

# if 'PermessionError' shows, just use sudo. ie:
$ sudo scidownl -u

模块

如果有doi列表,建议在python脚本中使用scidownl下载所有论文。

通过doi下载单张纸。

fromscidownl.scihubimport*DOI="10.1021/ol9910114"out='paper'sci=SciHub(DOI,out).download(choose_scihub_url_index=3)

只需使用for循环即可下载doi列表。

fromscidownl.scihubimport*DOIs=[...]out='paper'fordoiinDOIS:SciHub(doi,out).download(choose_scihub_url_index=3)

更新可用的scihub链接。

fromscidownl.update_linkimport*# Use crawling method to update available Scihub links.update_link(mod='c')# Use brute force search method to update available Scihub links.update_link(mod='b')

释放

  • v0.1.0:首次发布。
  • 第0.2.0版:
    • 优化了下载速度。
    • 优化了验证码处理。
  • V0.2.1版本:
    • 应用流下载。
    • 已添加下载进度的显示。
    • 修复了无效scihub链接的错误。
  • 第5.2.2节:
    • 添加新的源网站。
    • 在命令行工具中添加-l/--list参数。
  • V0.2.3版本:
    • 修复空文件名和错误scidhub url的错误。
    • 修复更新scihub url的暴力方法中的错误。
  • V0.2.4版本:
    • 修理2.
    • 修正错误:文件名太长。
  • 第5.2.5节:
    • 重建代码。
    • 修复“无内容长度”错误。
    • 添加用于手动选择所用scihub url的-c/--choose参数。

许可证

版权所有(c)2019 Tishacy。

根据MIT License授权。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
有没有一种方法可以将不同的java web应用程序组合到一个web应用程序(war)中而不相互影响?   java一次屏蔽两位   java如何在多个类上初始化元素?   java在后台服务中处理通知或使用GCM(或其他推送通知服务)   java从const方法调用JNI函数   javascript如何使用函数/方法返回?   Java优化:声明类变量与使用临时变量   java字符算术基数8 vs基数10   Java流收集要存储的对象列表   swing我正在用Java中的keyListener制作一个精灵移动器   在Gradle构建脚本中使用Scala(或java)方法   java Android Mediaplayer下一步按钮不起作用   Java Sound API在播放音频文件后将其锁定   java将变量从外部类传递到内部类的最佳方法   使用play framework的博客web应用程序出现java逻辑错误   java我们可以在Spring批处理中处理大型zip文件吗?   java如何检查JTable的选定行的特定列中的值是否已经在JList中?