# SauceNAO
[![Build Status](https://travis-ci.org/DaRealFreak/saucenao.svg?branch=master)](https://travis-ci.org/DaRealFreak/saucenao)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/DaRealFreak/saucenao/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/DaRealFreak/saucenao/?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/DaRealFreak/saucenao/badge.svg?branch=master)](https://coveralls.io/github/DaRealFreak/saucenao?branch=master)
unofficial python module to make working with [SauceNAO](https://www.saucenao.com) in projects easier
### Installing
This script runs with [Python 3](https://www.python.org).
There is a currently working [Python 2 branch](https://github.com/DaRealFreak/saucenao/tree/Python-2.x), but I'm not going to update it anymore.
Download this repository and run the setup.py to install all necessary dependencies
### Dependencies
Required:
* [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup) - html parser
* [requests](https://github.com/requests/requests) - http library
Optional:
* [Pillow](https://python-pillow.org) - Python Imaging Library, used to generate images for unittests
* [python-dotenv](https://github.com/theskumar/python-dotenv) - .env file loader used for unittests
* [requests-mock](https://pypi.python.org/pypi/requests-mock) - requests mock responses used for unittests
### Usage
You can run SauceNAO either as module:
```
import logging
from saucenao import SauceNao
saucenao = SauceNao(directory='directory', databases=999, minimum_similarity=65, combine_api_types=False, api_key='',
exclude_categories='', move_to_categories=False, use_author_as_category=False,
output_type=SauceNao.API_HTML_TYPE, start_file='', log_level=logging.ERROR,
title_minimum_similarity=90)
```
or as application:
```
python usage.py --dir [--databases] [--minimum-similarity] [--combine-api-types] [--api-key] [--exclude-categories] [--move-to-categories] [--use-author-as-category] [--output-type] [--start-file] [--log-level] [--filter-creation-date] [--filter-modified-date] [--title-minimum-similarity]
```
you can also use it to get the gathered information for your own script:
```
filtered_results = saucenao.check_file(file_name='test.jpg')
```
or get a generator object for a bulk of files using the worker class, all parameters work here too:
```
from saucenao import Worker
results = Worker(directory='directory', files=('test.jpg', 'test2.jpg')).run()
```
## Running the tests
In the tests folder you can run each unittest individually.
The test cases should be self-explanatory.
## Development
Want to contribute? Great!
I'm always glad hearing about bugs or pull requests.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details
## Thanks
A big thanks to [SauceNAO](https://www.saucenao.com) who are indexing all the images and compare them.
This script would be completely useless without them.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共30个文件
py:21个
txt:4个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:SauceNAO-1.0.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
SauceNAO-1.0.2.tar.gz (30个子文件)
SauceNAO-1.0.2
PKG-INFO 4KB
saucenao
http.py 2KB
saucenao.py 11KB
__init__.py 4KB
worker.py 5KB
files
filehandler.py 2KB
constraint.py 802B
__init__.py 229B
filter.py 5KB
__version__.py 293B
exceptions.py 213B
tests
custom
test_saucenao_limit.py 6KB
__init__.py 0B
test_version.py 698B
test_init.py 1KB
__init__.py 0B
test_http.py 3KB
files
test_filter.py 8KB
test_filehandler.py 2KB
__init__.py 266B
test_constraint.py 3KB
SauceNAO.egg-info
PKG-INFO 4KB
requires.txt 62B
SOURCES.txt 693B
top_level.txt 15B
dependency_links.txt 1B
zip-safe 2B
setup.cfg 42B
setup.py 948B
README.md 3KB
共 30 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功