获取磁链热度TOP20
兼容环境
Windows/Linux/MacOs
1 安装
pip 安装
$ pip install hot-magnet
源码安装
$ git clone https://github.com/landybird/hot-magnet.git
$ cd hot-magnet
$ pip install -r requirements.txt
$ python setup.py install
2 使用 (命令行模式)
usage: hot-magnet [-h] [-o OUTPUT] [-s SORT] [-c COUNT] [-v]
[KEYWORD [KEYWORD ...]]
获取磁链的工具(默认为热度最高的TOP20)
positional arguments:
KEYWORD 磁链关键字, 必填项
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
导出至文件 支持csv 和 json格式 output file path, supports csv and json format.
-s SORT, --sort SORT 0: hot, 1:new 0 按热度(默认) 1 按时间
-c COUNT, --count COUNT
指定返回的磁链数目 默认20条
-v, --version 查看当前版本 version information.
示例
(1) 根据关键字搜索
(hot-magnet) λ hot-magnet 无名之辈
=========collecting Data=============
磁链: magnet:?xt=urn:btih:AB8E72974F4374E218770B1DC9EAA8287A81E6CA
名称: 无名之辈HD国语中字.mp4
大小: 1.07GB
日期: 2018-12-3
热度: 一般
磁链: magnet:?xt=urn:btih:FBAE30FB853DDDF6944CA7380E064F96B9C46825
名称: 无名之辈 HC 720P高清国语中字
大小: 1.65GB
日期: 2018-12-14
热度: 一般
...
磁链: magnet:?xt=urn:btih:AE2B6E55B8D00430FA8117E768DA4F0938331C8E
名称: 无名之辈HDTC高清版本.mp4
大小: 2.92GB
日期: 2018-12-4
热度: 一般
磁链: magnet:?xt=urn:btih:248DF944C119A841C2B2544E547AE096417A0DFA
名称: 无名之辈BD国语中字.mp4
大小: 1.14GB
日期: 2018-12-7
热度: 一般
磁链: magnet:?xt=urn:btih:ED423A662E458179B4864CBDBBF0D71CDDACFC6E
名称: [zilu1.com]无名之辈HC1080P高清国语中字
大小: 3.47GB
日期: 2018-12-7
热度: 一般
磁链: magnet:?xt=urn:btih:D3E5DA7DECD75250FD8A7CEBD0A96DDA3FE453E7
名称: 无名之辈.2018.TC720P.国语中字.mp4
大小: 1.04GB
日期: 2018-11-28
热度: 一般
===================完成============================
(2) 排序(0 热度 1 时间)
$ hot-magnet 无名之辈 -s 1 -c 10 # 按时间排序, 10条记录
磁链: magnet:?xt=urn:btih:AE2B6E55B8D00430FA8117E768DA4F0938331C8E
名称: 无名之辈HDTC高清版本.mp4
大小: 2.92GB
日期: 2018-12-4
热度: 一般
....
磁链: magnet:?xt=urn:btih:FBAE30FB853DDDF6944CA7380E064F96B9C46825
名称: 无名之辈 HC 720P高清国语中字
大小: 1.65GB
日期: 2018-12-14
热度: 一般
(3) 保存json或者csv文件
(hot-magnet) λ hot-magnet 无名之辈 -s 1 -c 10 -o a.json
=========collecting Data=============
Save a.json successfully!
[
{
"magnet": "magnet:?xt=urn:btih:ED423A662E458179B4864CBDBBF0D71CDDACFC6E",
"magnet_name": "[zilu1.com]\u65e0\u540d\u4e4b\u8f88HC1080P\u9ad8\u6e05\u56fd\u8bed\u4e2d\u5b57",
"magnet_size": "3.47GB",
"magnet_date": "2018-12-7",
"magnet_rank": "\u4e00\u822c"
},
...,
{
"magnet": "magnet:?xt=urn:btih:248DF944C119A841C2B2544E547AE096417A0DFA",
"magnet_name": "\u65e0\u540d\u4e4b\u8f88BD\u56fd\u8bed\u4e2d\u5b57.mp4",
"magnet_size": "1.14GB",
"magnet_date": "2018-12-7",
"magnet_rank": "\u4e00\u822c"}
]
3 使用 (模块独立使用模式)
from handler.magnet_handler import cilimaoHandler
handler = cilimaoHandler()
# vars(handler)
# {'HEADERS': {'X-Requested-With': 'XMLHttpRequest',
'User-Agent': 'Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36'},
'session': <requests_html.HTMLSession at 0xfdd004b0>,
'magnet_list': [],
'page': 10}
magnet_list = handler.run(base_url, keyword, count, sort)
结果:
[{'magnet': 'magnet:?xt=urn:btih:5D1F70028C762D5D796BAC4D13539D1532327E11',
'magnet_name': '无名之辈.2018.TC.720P.X264.ACC-BTshoufa[国语中字]',
'magnet_size': '1.87GB',
'magnet_date': '2018-12-6',
'magnet_rank': '一般'},
...,
{'magnet': 'magnet:?xt=urn:btih:9DE730AFE471C5EB61F81EC67E5334E5F7D818E4',
'magnet_name': '[91xinpian.com]无名之辈HC1080P高清国语中字.mkv',
'magnet_size': '4.88GB',
'magnet_date': '2018-12-5',
'magnet_rank': '一般'},
{'magnet': 'magnet:?xt=urn:btih:05FF97BE07BE163EA267229EC0E196204648B93C',
'magnet_name': '无名之辈.HD.1080P.国语中字',
'magnet_size': '2.43GB',
'magnet_date': '2018-12-24',
'magnet_rank': '一般'}]
License
MIT ©landybird
Metadata
Release files for hot-magnet 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hot-magnet-0.0.6.tar.gz | 6.4 kB | Without provenance | Details for hot-magnet-0.0.6.tar.gz |
Release files / hot-magnet-0.0.6.tar.gz
| Download URL | hot-magnet-0.0.6.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
875bdd4c6f5976b4cf455b466aa9648c3368be9bb05377cbb57e5a258de13668
|
|
BLAKE2b-256 checksum How to use checksums |
2ed33e38c0ca0087ea3518d058fc746f3f8c36b2baa2294e01ca40edfdcd752e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
|
Security for hot-magnet 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.