可怕的潜艇API
horrible-downloader的Python项目详细描述
糟糕的下载程序
drear downloader是围绕HorribleSubsapi的python包装器。它带有一组强大的额外功能,允许用户自动下载新的剧集和成批的现有节目。该模块跟踪下载的文件,并允许您从离开的位置继续。
安装
> pip install horrible-downloader
依赖关系
可怕的下载程序使用WebTorrent-CLI下载它的磁铁。
依赖项是随安装脚本自动下载的,但对于那些希望手动安装的用户,只需运行npm install webtorrent-cli -g
。
注意:webtorrent是nodejs应用程序,这意味着您必须安装node。
文档
用法
python内部api的使用示例:
fromHorribleDownloaderimportParser,ConfigManagerp=Parser()config=ConfigManager()download=[]forshow,last_watchedinconfig.subscriptions:episodes=p.get_episodes(show)new=filter(lambdas:s["episode"]>last_watched,episodes)download.extend(new)
使用解析器
为了与api进行简单的交互,我们必须首先使用HorribleDownloader.Parser()
启动解析器对象。
解析器将允许我们从horriblesubs获取数据。以下是方法和属性:
- 显示-列出所有可用的显示。相当于https://horriblesubs.info/shows/。
- 当前显示-列出所有当前正在播放的显示。相当于https://horriblesubs.info/current-season/。
- get_集(show:str,limit=1000)-返回指定节目的集列表。默认情况下会返回前1000集(当然,大多数节目甚至不会到达第100集)。
- {STR 1 } $GETHAL批次(show:STR)< /强> -返回显示的批(如果存在)。
插曲对象
当提到一个插曲时,它的实际表示是以下结构的对象:
{"title":"the title of the show","episode":"episode number",# represented with a float."480":{# all of the files are in 480p resolution"Magnet""link to magnet","Torrent":"link to the .torrent file","XDCC":"XDCC query",# https://xdcc.horriblesubs.info/"Uploaded.net":"uploaded.net link to .mkv","FileUpload":"fileupload link to .mkv","Uplod":"uplod link to .mkv"},"720":{# exactly the same as the 480, but with 720p resolution"Magnet""link to magnet","Torrent":"link to the .torrent file","XDCC":"XDCC query","Uploaded.net":"uploaded.net link to .mkv","FileUpload":"fileupload link to .mkv","Uplod":"uplod link to .mkv"},"1080":{# 1080p resolution"Magnet""link to magnet","Torrent":"link to the .torrent file","XDCC":"XDCC query","Uploaded.net":"uploaded.net link to .mkv","FileUpload":"fileupload link to .mkv","Uplod":"uplod link to .mkv"}}
可怕的潜艇cli
一个强大的工具,管理和下载动画的自动方式。要运行它,只需调用horrible-downloader
。
cli很简单,但很有效。它允许您根据指定的订阅(see Configuration)下载当前正在播放的动画,并下载所需动画的所有片段。
专长:
- 从命令行使用horriblesubs。
- 最小配置
- 支持下载恢复--继续你离开的地方!
- 允许智能事件规范分析。
标志和选项:
cli支持手动下载具有各种选项的不同动画。 标志和选项的完整列表:
$ horrible-downloader --help
usage: horrible-downloader [-h] [-d DOWNLOAD] [-o OUTPUT] [-e EPISODES] [-l]
[-r RESOLUTION] [---subscribe SUBSCRIBE] [--batch]
[-q]
horrible script for downloading anime
optional arguments:
-h, --help show this help message and exit
-l, --list display list of available shows
-q, --quiet set quiet mode on
-d DOWNLOAD, --download DOWNLOAD download a specific anime
-o OUTPUT, --output OUTPUT directory to which it will download the files
-e EPISODES, --episodes EPISODES manually specify episodes to download
-r RESOLUTION, --resolution RESOLUTION specify resolution quality, defaults to config file
--subscribe SHOW [-e EPISODE] add a show to the config file.
--batch search for batches as well as regular files
集和分辨率格式化:
这两个标志有一个特殊的语法,允许更好的规范接口。
当使用sceptions标志时,您可以使用以下内容:
character | usage | example |
---|---|---|
, | allows to specify more than one episode or option. | 1,6 |
- | specify a range of episodes, including start and end. | 4-10 |
> | bigger than, must be last in order. | 7> |
< | smaller than, must be first in order. | <10 |
= | equals, in conjunction with < or >, includes the episode number. | 11>= |
标记语法很简单,只要用逗号(,)设置资源即可。
$ horrible-downloader -r 720,1080
示例用法:
将“一个打孔人”的第1、2、4、5、6集下载到~/Videos/Anime
文件夹的命令:
$ horrible-downloader -d "one punch man" -e 1,2,4-6 -o ~/Videos/Anime
配置
调用脚本后,将在用户的配置目录中生成配置文件:
~/.config/horrible-downloader/conf.ini
。
默认情况下,配置文件包含所有当前播放的动画。若要订阅动画,只需取消对其的注释并指定当前正在播放的剧集。
示例配置文件:
[settings]
resolution = 1080
download_dir = ~/Videos/Anime
[subscriptions]
one punch man = 11
lupin iii part v = 8
jojo's bizzare adventure - golden wind = 0