標籤:

好像發現了一個不錯的小工具

作為一個學編程的,找資源這種事,肯定不能像普通老百姓一樣打開百度盲目查找啦。此時你就需要大喊一聲 Python 大法好。 近日無意中看到了一個不錯的網站,心想著就把它利用起來吧,就寫了一個磁力資源獲取器命令行工具。

開發環境

Windows10 + Python3

安裝

pip 安裝

$ pip install torrent-clin

源碼安裝

$ git clone https://github.com/chenjiandongx/torrent-cli.gitn $ cd torrent-clin $ pip install -r requirements.txtn $ python setup.py installn

用法

C:Userschenjiandongx>torrent-clinusage: torrent-cli [-h] [-k KEYWORD] [-n NUM] [-s SORT_BY] [-o OUTPUT] [-p]n [-v]nnMagnets-Getter CLI Tools.nnoptional arguments:n -h, --help show this help message and exitn -k KEYWORD, --keyword KEYWORDn magnet keyword.n -n NUM, --num NUM magnet number.(default 20)n -s SORT_BY, --sort-by SORT_BYn 0: Sort by date,1: Sort by size.(default 0)n -o OUTPUT, --output OUTPUTn output file path, supports csv and json format.n -p, --pretty-oneline show magnets info with one line.n -v, --version version information.n

簡單示範

C:Userschenjiandongx>torrent-cli -k 戰狼2nCrawling data for you.....n磁鏈: magnet:?xt=urn:btih:7ccaddac5d1cce7057b5381b49e1522f6c39e047n名稱: 戰狼2.Wolf.Warriors.2.2017.1080p.WEB-DL.X264.AAC-國語中字-RARBTn大小: 2.85 GBn日期: 2017-11-17nn磁鏈: magnet:?xt=urn:btih:b441bedeb5d64785ce6333564b739354d7775843n名稱: 【百度搜:愛諾影視】戰狼2.2017.HD1080P.國語中字n大小: 2.1 GBn日期: 2017-11-17nn磁鏈: magnet:?xt=urn:btih:621c1325452840ba221740b0c6d305a625ecbc81n名稱: 戰狼2.新戰狼.2017.HD2160P.X264.AAC.國語中字n大小: 5.43 GBn日期: 2017-11-15nn磁鏈: magnet:?xt=urn:btih:a8e41331091160c1660404ea37cdababa8616c21n名稱: 戰狼2.Wolf.Warriors.2.2017.1080p.WEB-DL.X264.AAC-bbs.homefei.men大小: 3.5 GBn日期: 2017-11-12nn磁鏈: magnet:?xt=urn:btih:1647c411b8481738d29661b96629c7493f62ed12n名稱: 戰狼2.新戰狼.2017.HD1080P.X264.AAC.國語中字n大小: 2.61 GBn日期: 2017-11-12n......n

單行顯示並按大小排序

C:Userschenjiandongx>torrent-cli -k 戰狼2 -p -s 1nCrawling data for you.....nmagnet:?xt=urn:btih:b6401277ba77620727f7d6fe1345501555f7ca28 7.75 GB 2017-11-09nmagnet:?xt=urn:btih:8cdba300f43884ef7958c75343f3b10dd0009881 7.49 GB 2017-11-09nmagnet:?xt=urn:btih:7e364fe1ef493761aa7c2c4231f5d8dc34df90fe 5.44 GB 2017-11-06nmagnet:?xt=urn:btih:fad291b30048f367c4324cbef6fa6ce127ae6940 5.44 GB 2017-11-08nmagnet:?xt=urn:btih:de42bc281cf39f0f489b64f06c2440466d545c83 5.44 GB 2017-11-11nmagnet:?xt=urn:btih:621c1325452840ba221740b0c6d305a625ecbc81 5.43 GB 2017-11-15nmagnet:?xt=urn:btih:bf2f95270fb94bf98dd23e0546c463c7343fbfca 3.56 GB 2017-11-10nmagnet:?xt=urn:btih:a8e41331091160c1660404ea37cdababa8616c21 3.5 GB 2017-11-12nmagnet:?xt=urn:btih:f26ce21764f946c92da5aa89d6db067d751c0d3f 2.76 GB 2017-11-07nmagnet:?xt=urn:btih:244d7f5b281b0c3731f345f4c46259954d3bddf4 2.72 GB 2017-11-09nmagnet:?xt=urn:btih:6bb32d1fd3f44293657e7f23f163c8af21c27d52 2.69 GB 2017-11-06nmagnet:?xt=urn:btih:c60e1f9436118b36ce8d3bfdf16504b71d18d4f9 2.69 GB 2017-11-09nmagnet:?xt=urn:btih:1647c411b8481738d29661b96629c7493f62ed12 2.61 GB 2017-11-12nmagnet:?xt=urn:btih:770ad4f9882ba6245bdf7d7aa97d2dd8afa691b5 2.55 GB 2017-11-10nmagnet:?xt=urn:btih:5e6bce50844bfb6616f409595186913b17585085 2.32 GB 2017-11-07nmagnet:?xt=urn:btih:34f0c102d57a9ae77a93a22d27770452649e7aaa 2.32 GB 2017-11-09nmagnet:?xt=urn:btih:2fb2595d41c7570b1a50634b2e466a149c0a2f7d 2.32 GB 2017-11-09nmagnet:?xt=urn:btih:9aabc55040066ce78d27ca36d8c15ae56ccf5b0b 2.32 GB 2017-11-10nmagnet:?xt=urn:btih:afbda9a99b38f4fb974931fac6b9817126ce25f0 2.32 GB 2017-11-11nmagnet:?xt=urn:btih:b2489aed91b9a154bcb31147897d8183ca1707bd 720.82 MB 2017-11-06n

或者可以保存為 csv 或者 json 文件

C:Userschenjiandongx>torrent-cli -k 戰狼2 -o movie.csv n

項目地址:chenjiandongx/torrent-cli

先 star 後上車!

2017.11.19 更新

——————————————————————————————————————

項目好像上了 Python Trending ???


推薦閱讀:

反反爬蟲利器!教你怎麼用代理,撥號換IP……
使用webhook結合python腳本實現自動化部署

TAG:Python |