MCPcopy Index your code
hub / github.com/Izumiko/iwaradl

github.com/Izumiko/iwaradl @v1.5.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.4 ↗ · + Follow
121 symbols 328 edges 19 files 37 documented · 31% updated 35d agov1.5.4 · 2026-04-23★ 33
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

iwara 下载工具

English, 中文说明

iwara.tv下载器支持功能:
- 多URL下载
- URL列表文件
- 断点续传
- 自定义下载目录
- 代理支持

使用方法:
  iwaradl [参数] [URL...]
  iwaradl [命令]

可用命令:
  completion  为指定shell生成自动补全脚本
  genlist     生成过滤后的视频URL列表
  help        查看命令帮助
  serve       启动守护进程模式
  version     打印版本号

参数说明:
  -u  --email string              登录邮箱
  -p  --password string           登录密码
      --api-token string          daemon HTTP API 鉴权 token
      --auth-token string         授权令牌
  -c, --config string             配置文件路径(默认为"config.yaml")
      --debug                     启用调试日志
  -h, --help                      显示帮助信息
  -l, --list-file string          URL列表文件路径
      --filename-template string  输出文件名模板
      --max-retry int             最大重试次数(默认自动调整)
      --proxy-url string          代理服务器地址
  -r, --resume                    恢复未完成的任务
      --root-dir string           视频存储根目录
      --thread-num int            并发下载线程数(默认自动调整)
      --use-sub-dir               使用用户名作为子目录
      --update-nfo                更新指定根目录下的nfo文件(--root-dir必须指定)
      --update-delay              nfo文件更新间隔时间,单位秒(默认: 1)

使用"iwaradl [命令] --help"查看具体命令帮助信息。

生成视频列表(genlist

genlist 会从 Iwara 拉取视频列表分页,按日期/点赞/播放/时长进行过滤,并将最终视频 URL 写入文本文件。

示例:

iwaradl genlist --sort date --page-limit 3 --date-limit 14 --output videolist.txt
iwaradl genlist --rating all --filter-like0 200 --filter-like-inc 20 --filter-duration 120

主要参数:

  • --sortdatetrendingpopularityviewslikes
  • --page-limit:抓取页数,必须 > 0
  • --date-limit:仅保留最近 N 天视频,必须 > 0
  • --ratingallgeneralecchi
  • --filter-like0:基础最小点赞数,必须 >= 0
  • --filter-like-inc:每增加 1 天额外要求的点赞数,必须 >= 0
  • --filter-views:最小播放数,必须 >= 0
  • --filter-duration:最小时长(秒),必须 > 0
  • --output:输出文件路径,不能为空

守护进程模式

启动 daemon:

iwaradl serve --bind 127.0.0.1 --port 23456 --config config.yaml

daemon 模式必须提供 --api-token,或设置环境变量 IWARADL_API_TOKEN--bind 默认值为 127.0.0.1

API 接口:

  • POST /api/tasks 提交下载任务
  • GET /api/tasks 查看全部任务
  • GET /api/tasks/{vid} 查看单个任务
  • DELETE /api/tasks/{vid} 删除单个待处理任务(仅 pending 可删除)

详见 API 文档

提交任务示例:

curl -X POST http://127.0.0.1:23456/api/tasks \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "urls":["https://www.iwara.tv/video/xxxx"],
    "options":{
      "download_dir":"daily",
      "proxy_url":"http://127.0.0.1:7890",
      "max_retry":2,
      "filename_template":"{{title}}-{{video_id}}-{{quality}}"
    }
  }'

options.download_dir 同时支持相对路径和绝对路径。相对路径会自动拼接 rootDir 到前面。 options.download_dir 也支持同一套模板变量,例如 iwara/{{author_nickname}}

文件名模板变量:

  • {{now}}(YYYY-MM-DD)
  • {{publish_time}}(YYYY-MM-DD)
  • {{title}}
  • {{video_id}}
  • {{author}}
  • {{author_nickname}}
  • {{quality}}

config.yaml

rootDir: "D:\\MMD" # 存放视频的目录;mac/Linux下填完整路径,如/home/user/MMD
useSubDir: false # 是否根据作者创建子目录
email:  "" # 登录邮箱
password: "" # 登录密码
authorization: "" # 登录时用到的token,不含开头的"Bearer "
apiToken: "" # daemon HTTP API 鉴权 token
proxyUrl: "http://127.0.0.1:11081" # 代理地址
filenameTemplate: "{{title}}-{{video_id}}" # 输出文件名模板
threadNum: 4 # 同时进行的任务数
maxRetry: 3 # 最大尝试下载次数

token获取方式如下:打开iwara网页的浏览器控制台,执行localStorage.getItem("token"),返回值即为token。

视频网址可以是一个视频的页面,也可以是用户页面(将下载该用户所有投稿视频)。

视频网址列表文件是一个纯文本文件,每行一个网址。

使用时,命令行URL或者列表文件至少提供一个。

未完成的任务列表存放在rootDir/jobs.list,可以使用 -r 来继续。已完成的任务记录存放在rootDir/history.list中。

命令行参数的优先级高于配置文件中的值。

Core symbols most depended-on inside this repo

Shape

Function 98
Struct 22
TypeAlias 1

Languages

Go100%

Modules by API surface

server/tasks.go19 symbols
api/iwara.go19 symbols
downloader/util.go10 symbols
downloader/path.go10 symbols
api/types.go10 symbols
downloader/download.go9 symbols
server/handler.go8 symbols
util/terminal.go7 symbols
api/iwara_test.go7 symbols
config/config.go4 symbols
cmd/genList.go4 symbols
server/auth.go3 symbols

For agents

$ claude mcp add iwaradl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page