通过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授权。