├── .gitattributes ├── .gitignore ├── HideRun.vbs ├── aria2.conf ├── aria2.log ├── aria2.session ├── aria2rpc.py ├── del.bat ├── del_bt.bat ├── dht.dat ├── readme.md ├── rm.sh ├── rm_bt.sh ├── run.pyw └── start.bat /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /HideRun.vbs: -------------------------------------------------------------------------------- 1 | CreateObject("WScript.Shell").Run "aria2c.exe --conf-path=aria2.conf",0 -------------------------------------------------------------------------------- /aria2.conf: -------------------------------------------------------------------------------- 1 | # 更详细配置介绍请访问 https://aria2.github.io/manual/en/html/ 2 | # 配置中下载管理器为 Flashgot 配合 py 脚本,其他下载管理器不一定能调用参数 3 | 4 | # 全局代理 5 | #all-proxy = http://127.0.0.1:1080/pac?auth= 6 | # 代理请求方式,可用值 get, tunnel ,HTTPS 下载时一直使用 tunnel 7 | #proxy-method = tunnel 8 | # 不代理的主机名,域名和IP 9 | #no-proxy = 10 | 11 | # rpc 12 | # 用户名 13 | #rpc-user = user 14 | # 密码 15 | #rpc-passwd = passwd 16 | # token 验证 17 | # 值可以为:我就是叫紫妈怎么了?有本事突然从我背后出现,把我的脸按在键盘上3sw4yde5uf6tgyhujikpo 18 | rpc-secret = 3sw4yde5uf6tgyhujikpo 19 | # 允许rpc ,默认 false 20 | enable-rpc = true 21 | # 允许所有来源, web 界面跨域权限需要,默认 false 22 | rpc-allow-origin-all = true 23 | # 外部访问,默认 false, false 时只监听本地端口 24 | rpc-listen-all = true 25 | # https 加密,启用之后要设置公钥,私钥的文件路径 26 | #rpc-secure = true 27 | # 加密设置公钥 28 | #rpc-certificate = example.crt 29 | # 加密设置私钥 30 | #rpc-private-key = example.key 31 | # rpc 端口,默认 6800 32 | #rpc-listen-port = 6800 33 | 34 | 35 | # 下载 36 | # 关闭 ipv6 ,默认 false 37 | #disable-ipv6 = true 38 | # 最大同时下载数, 默认 5 39 | #max-concurrent-downloads = 3 40 | # 断点续传,只在 HTTP(S) 和 FTP 中生效 41 | continue = true 42 | # HTTP 返回 503 时重试下载的秒数,0 为不重试下载,默认为 0 43 | retry-wait = 10 44 | # 最大重试次数,0 为无限制,默认为 5 45 | max-tries = 0 46 | #服务器返回文件找不到最大重试次数, 0 为一直重试,默认为 0 47 | max-file-not-found = 10 48 | # 同服务器最大连接数,默认 1(好像不能使用过大的值,窝用20无法打开aria2) 49 | max-connection-per-server = 16 50 | # 最小文件分段大小, 默认 20M 51 | # 如果文件大小 < (min-split-size * split)则不分段 52 | min-split-size = 2M 53 | # 单文件最大线程数, 默认 5 54 | split = 8 55 | # 使用服务器文件时间,默认 false 56 | remote-time = true 57 | # 使用 UTF-8 编码,默认 false 58 | content-disposition-default-utf8 = true 59 | 60 | # 如果相同的文件已存在重命名文件,默认 true 61 | #auto-file-renaming = 62 | # 总是重命名文件,默认 true 63 | #always-resume = 64 | # 最大能重命名几个文件,和 always-resume 有关 65 | # 下载多个度盘打包文件的时候会重命名为 pack.zip, pack.1.zip... 这样,默认 0 66 | #max-resume-failure-tries = 5 67 | 68 | 69 | # referer ,这里由下载管理器调用 70 | #如果为 * ,下载 URI 也可以是 referer ,这在开启 parameterized-uri 时很有用 71 | #referer = 72 | # 参数化 URI , balabala 不懂,默认 false 73 | #Enable parameterized URI support. You can specify set of parts: http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with step counter: http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, -Z option is required. Default: false 74 | #parameterized-uri = true 75 | 76 | # 全局下载速度限制 77 | # 0 为不受限制,默认为 0 ,大小为 bytes/sec ,也可以使用 K 或 M ,下同 78 | #max-overall-download-limit = 0 79 | # 单文件下载速度限制 80 | #max-download-limit = 0 81 | # 全局上传速度限制 82 | #max-overall-upload-limit = 100K 83 | # 单文件上传速度限制 84 | #max-upload-limit = 0 85 | # 断开速度过慢的连接,在 BT 中不生效 86 | #lowest-speed-limit = 0 87 | 88 | # 文件保存路径,这里由下载管理器调用,默认为 Aria2 所在文件夹 89 | #dir = 90 | # 文件缓存,缓存到内存里,大小使用 K 或 M ,为 0 时关闭,默认 16M 91 | #disk-cache = 64M 92 | # 将文件映射到内存,如果文件没有预分配不能工作,默认 false 93 | # mmap 需要系统和内核支持 94 | #enable-mmap = true 95 | # 映射内存文件大小最大限制 96 | # 文件大小由一次下载中的全部文件决定,如果总大小大于设定值则禁用mmap 97 | # 默认9223372036854775807 (单位有点迷) 98 | #max-mmap-limit = 1280M 99 | # 文件预分配 100 | # 可用值 none, prealloc, trunc, falloc ,默认 prealloc 101 | # 当使用新型文件系统,如 ext4, btrfs, xfs 或者 NTFS 文件系统时,推荐使用 falloc ,这种方式会在瞬间完成大文件(数 GB )的空间分配 102 | # 不要在传统文件系统,如 ext3, FAT32 上使用 falloc ,因为这和使用 prealloc 所需的时间大同 103 | # falloc 和 trunc 需要文件系统和内核支持 104 | # 警告:使用 trunc 灰常快,但它其实是在文件系统中设置文件长度元数据,并不是分配磁盘空间,所以无法避免磁盘碎片化 105 | # 简单来说开启文件预分配后,如果支持使用 falloc 就使用 falloc ,不支持就用 prealloc ,固态硬盘可以使用 trunc 106 | # 开启后使用 32 位 aria2 下载大于 4G 的文件, aria2 会被系统杀掉 (骚年你还在用 32 位系统?) 107 | # 使用 falloc 时,如果有警告[WARN] Gaining privilege SeManageVolumePrivilege failed. ,需要使用管理员权限打开 108 | file-allocation = falloc 109 | # 大小小于这个值的文件不进行文件预分配,默认 5M 110 | no-file-allocation-limit = 4096K 111 | # 证书校验,默认 true 112 | #check-certificate = false 113 | # 证书效验文件 114 | #ca-certificate = 115 | 116 | 117 | # 任务记录 118 | input-file = aria2.session 119 | # 保存错误/未完成的任务记录 120 | # 会在 dir 下生成同名 .aria2 文件,当 force-save = true 时不删除, force-save = false 时删除 121 | save-session = aria2.session 122 | # 每隔几秒保存,默认 0 , 0 为 aria2 退出时保存,不管设置为多少 aria2 退出时都会保存 session 123 | save-session-interval = 60 124 | # 即使任务被移除或完成了也保存 session (使用 save-session 值) ,对 BT 有用,默认 false 125 | # 会检查 session ,打开后如果按照本配置打开 aria2 下载下来的文件如果没有删除元数据会再给你下载下来 126 | # 简单来说: false 不保存完成记录,true 保存完成记录 127 | #force-save = true 128 | 129 | #强迫症专用, force-save = true 时删除 dir 下同名.aria2 130 | # .bat windows 用, .sh linux 用,需要在 bat/sh 里自己修改 dir 131 | #on-download-complete = del.bat 132 | #on-bt-download-complete = del_bt.bat 133 | #on-download-complete = rm.sh 134 | #on-bt-download-complete = rm_bt.sh 135 | 136 | # 日志 137 | # 级别,可用值 debug, info, notice, warn, error ,默认 debug 138 | log-level = warn 139 | # 位置 140 | log = aria2.log 141 | 142 | # 轮询事件 143 | # 可用值 epoll, kqueue, port, poll, select ,默认值与系统有关 144 | # epoll, kqueue, port and poll 需要系统支持 145 | # epoll 支持最新的 Linux , kqueue 支持最新的 BSD 系(包括 MAC OS X), port 支持 Open Solaris 146 | #event-poll = 147 | 148 | 149 | # BitTorrent 150 | # 启用本地节点查找,默认 false,如果种子设置为 private , aria2 不会使用此选项 151 | bt-enable-lpd = true 152 | # 当值为 true| mem 时,如果下载的文件是一个种子(以.torrent结尾)时, 就自动下载 153 | # 当值为 mem 时,种子不会写入磁盘,但会一直在内存中 154 | # 当值为 false 时不自动下载 155 | # 默认 true 156 | #follow-torrent = flase 157 | # 监听端口,默认6881-6999 158 | # , 为分隔不同端口, - 为两个值中的所有端口,如:'6881-6889,6999', '6881,6885' 159 | #listen-port = ... 160 | 161 | # 强制加密,开启相当于 bt-require-crypto = true 和 bt-min-crypto-level = arc4 ,默认 false 162 | bt-force-encryption = true 163 | # 要求加密,默认 false 164 | #bt-require-crypto = true 165 | # 最低加密级别,可用值 plain, arc4 ,默认 plain 166 | #bt-min-crypto-level = arc4 167 | 168 | # 最大打开文件数量,默认 100 169 | #bt-max-open-files = 100 170 | # 单种子最大连接数,默认 55 ,0 为不限制 171 | #bt-max-peers = 55 172 | # 如果单种子的速度低于此值, aria2 会暂时增加种子的连接数量来增加下载速度,默认 50K 173 | #bt-request-peer-speed-limit = 50K 174 | 175 | #添加额外的 tracker 176 | #bt-tracker = [,...] 177 | #要排除的 tracker,可以使用值 '*' (不要引号),当使用 * 时会移除所有通告的的 tracker 178 | #bt-exclude-tracker = [,...] 179 | # tracker 重连超时时间(单位为秒),默认 60 180 | #bt-tracker-connect-timeout = 60 181 | #tracker 超时时间(单位为秒),默认 60 182 | #bt-tracker-timeout = 60 183 | 184 | # DHT 185 | # 打开 ipv4 DHT, 默认 true 186 | # 当种子文件设置了 private ,即使为 true ,aria2也不会从 DHT 中下载, ipv6 也一样 187 | #enable-dht = true 188 | # 打开 ipv6 DHT,默认 true 189 | #enable-dht6 = true 190 | # BT 和 DHT 使用的外部 IP ,可能会发送到BitTorrent tracker 191 | # 对于DHT,此选项应该被设置成要报告的本地节点,这对于在 private 网络中使用 DHT 很重要 192 | # For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network 193 | #bt-external-ip = 194 | # DHT和 UDP tracker监听端口,默认 6881-6999 195 | #dht-listen-port = ... 196 | # 启用种子交换,默认 true ,如果种子设置为 private ,即使为 true 也不会启用这个特性 197 | #enable-peer-exchange = true 198 | # 做种流量比例, 0.0 时一直做种,默认 1.0 199 | #seed-ratio = 0.0 200 | 201 | # 改变 IPv4 DHT 路由表保存路径,默认 $HOME/.aria2/dht.dat 202 | dht-file-path = dht.dat 203 | # 改变 IPv6 DHT 路由表保存路径,默认 $HOME/.aria2/dht6.dat 204 | dht-file-path6 = dht6.dat 205 | 206 | # 修改 UA,默认 aria2/$VERSION 207 | # 只在 HTTP(S) 中有效 208 | #user-agent = 209 | # peer-id,默认 A2-$MAJOR-$MINOR-$PATCH- ,比如在 aria2 version 1.18.8 里为 A2-1-18-8- 210 | # 在 BT 中只有前20个字符长度生效,超出的将被丢弃,不足则随机填充至20个字符 211 | #peer-id-prefix = 212 | 213 | # 保存元数据至 .torrent 文件,默认 false 214 | #bt-save-metadata = true 215 | # 从以前的种子下载不用验证散列,默认 false 216 | # Seed previously downloaded files without verifying piece hashes 217 | #bt-seed-unverified = true 218 | # 种子哈希效验,开启时使用 check-integrity 选项和文件完成散列检查后才会继续,如果你想要下到损坏的文件那就关了吧。默认 true 219 | # If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to false. This option has effect only on BitTorrent download. Default: true 220 | #bt-hash-check-seed = true 221 | # 通过验证散列或整个文件的哈希值来检查文件完整性,只在 BT 中生效,HTTP(S)/FTP 使用 checksum 选项,默认 false 222 | #check-integrity = false 223 | -------------------------------------------------------------------------------- /aria2.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilyvia/aria2-conf/8a06957b074cbdef642e9d18ab38b9dfe2b6ab8d/aria2.log -------------------------------------------------------------------------------- /aria2.session: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilyvia/aria2-conf/8a06957b074cbdef642e9d18ab38b9dfe2b6ab8d/aria2.session -------------------------------------------------------------------------------- /aria2rpc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | import urllib2 5 | import json 6 | from argparse import ArgumentParser 7 | from collections import defaultdict 8 | 9 | parser = ArgumentParser() 10 | parser.add_argument('-U', '--user-agent', help='user-agent', type=str, 11 | default='', metavar='USER-AGENT', dest='user_agent') 12 | parser.add_argument('-c', '--cookie', help='use cookies', type=str, 13 | default='', metavar='COOKIES', dest='cookies') 14 | parser.add_argument('-o', '--output', help='output name', type=str, 15 | default='', metavar='NAME', dest='output') 16 | parser.add_argument('-d', '--dir', help='dest dir (server side)', type=str, 17 | default='', metavar='DIR', dest='dir') 18 | parser.add_argument('-R', '--rpc', 19 | help='aria2 rpc (http://localhost:6800/jsonroc)', 20 | type=str, default='http://127.0.0.1:6800/jsonrpc', 21 | metavar='URL', dest='rpc') 22 | parser.add_argument('-s', '--secret', dest='secret', default='', 23 | metavar='TOKEN', help='token') 24 | parser.add_argument('-u', '--user', dest='user', default='', 25 | metavar='USER', help='user name (deprecated)') 26 | parser.add_argument('-p', '--passwd', dest='pw', default='', 27 | metavar='PASSWD', help='password (deprecated)') 28 | parser.add_argument('-r', '--referer', help='referer', default='', type=str, 29 | metavar='URL', dest='referer') 30 | parser.add_argument('-H', '--host', dest='host', default='') 31 | parser.add_argument('URIs', nargs='+', help='URIs', type=str, 32 | default='', metavar='URI') 33 | opts = parser.parse_args() 34 | 35 | jsondict = {'jsonrpc':'2.0', 36 | 'id':'aria2rpc', 37 | 'method':'aria2.addUri'} 38 | 39 | jsondict['params'] = [] 40 | if opts.secret: 41 | jsondict['params'].append('token:{0}'.format(opts.secret)) 42 | jsondict['params'].append(opts.URIs) 43 | 44 | aria2optsDefault = {} 45 | 46 | aria2opts = defaultdict(lambda: []) 47 | aria2opts.update(aria2optsDefault) 48 | 49 | if opts.user_agent: 50 | aria2opts['user-agent'] = opts.user_agent 51 | if opts.output: 52 | aria2opts['out'] = opts.output 53 | if opts.dir: 54 | aria2opts['dir'] = opts.dir 55 | if opts.referer: 56 | aria2opts['referer'] = opts.referer 57 | if opts.cookies: 58 | aria2opts['header'].append('Cookie: {0}'.format(opts.cookies)) 59 | if opts.host: 60 | aria2opts['header'].append('Host: {0}'.format(opts.host)) 61 | if opts.secret: 62 | aria2opts['rpc-secret'] = opts.secret 63 | 64 | if not opts.secret and opts.user and opts.passwd: 65 | aria2opts['rpc-user'] = opts.user 66 | aria2opts['rpc-passwd'] = opts.pw 67 | 68 | jsondict['params'].append(aria2opts) 69 | 70 | jsonreq = json.dumps(jsondict) 71 | 72 | print urllib2.urlopen(opts.rpc, jsonreq).read() 73 | -------------------------------------------------------------------------------- /del.bat: -------------------------------------------------------------------------------- 1 | del %USERNAME%\Downloads\*.aria2 -------------------------------------------------------------------------------- /del_bt.bat: -------------------------------------------------------------------------------- 1 | del USERNAME%\Downloads\BitTorrent\*.aria2 -------------------------------------------------------------------------------- /dht.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lilyvia/aria2-conf/8a06957b074cbdef642e9d18ab38b9dfe2b6ab8d/dht.dat -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 根据 [Aria2 Manual](https://aria2.github.io/manual/en/html/) 汉化大部分的配置文件 2 | 3 | [汉化的配置文件](https://github.com/lilyvya/aria2-conf/blob/master/aria2.conf) 4 | **请勿直接使用此配置文件,至少需要更改** `rpc-secret=` **的值** 5 | 6 | Windows 要运行还需要 [Aria2c.exe](https://github.com/aria2/aria2/releases) ,建议和 [webui-aria2](https://github.com/ziahamza/webui-aria2) 搭配使用,或者 [AriaNg](https://github.com/mayswind/AriaNg) , [yaaw](https://github.com/binux/yaaw) 7 | 8 | 9 | ### Chrome 扩展 10 | [Linkle](https://chrome.google.com/webstore/detail/linkle/okcgleaeeoddghoiabpapmnkckncbjba?hl=zh-CN) 11 | [Aria2c Integration](https://chrome.google.com/webstore/detail/aria2c-integration/cnkefpcjiolhnmhfpjbjpidgncnajlmf?hl=zh-CN) 12 | [Aria2 for Chrome](https://chrome.google.com/webstore/detail/aria2-for-chrome/mpkodccbngfoacfalldjimigbofkhgjn)(使用这个扩展不需要 webui-aria2 或 AriaNg ) 13 | 14 | ## Windows 的启动方式和 Firefox FlashGot 调用 15 | 16 | ### Windows 17 | Windows CMD 启动双击 start.bat ,后台运行双击 HideRun.vbs 18 | 19 | 若要自启动又需要管理员权限使用任务计划程序 20 | 21 | 1. 打开任务计划程序:控制面板→管理工具→任务计划程序 22 | 2. 创建任务 23 | 3. 常规 24 | 3.1. 更改用户或组,使用 SYSTEM 账户 25 | 3.2. 如果使用 falloc 的文件预分配方式,又有 26 | 27 | >[WARN] Gaining privilege SeManageVolumePrivilege failed. 28 | 29 | 的出现,则使用最高权限运行打上勾 30 | 31 | 4. 触发器 32 | 4.1. 新建 33 | 4.2. 开始任务选择登录时 34 | 4.3. 可以按需选择延迟任务时间 35 | 4.4. 已启用务必确认勾选 36 | 5. 操作 37 | 5.1. 新建 38 | 5.2. 程序或脚本选择 `aria2c.exe` 39 | 5.3. 添加参数 `--conf=aria2.conf` 40 | 5.4. 起始于 `PATH` (aria2c.exe所在目录) 41 | 6. 条件 42 | 6.1. 勾全部取消,包括黑掉的( Windows 蜜汁 BUG ,黑掉的有时候也会生效) 43 | 7. 设置 44 | 7.1. 仅勾选允许按需运行任务 45 | 7.2. 如果此任务已经运行,以下规则适用:请勿启动新实例 46 | 47 | ### Firefox 57 以前 FlashGot 的调用方式 48 | 需要 [Python2](https://www.python.org/downloads/windows/) 环境 49 | 以 Windows 为例 50 | 51 | * 新增一个下载管理 52 | * 如果你的系统环境不对: 53 | * 可执行路径:`PATH\Python2\pythonw.exe` 54 | * 参数模板:`PATH\Aria2\run.pyw --secret --dir PATH [--cookie COOKIE] [--referer REFERER] [--user-agent UA] [URL]` 55 | * 如果系统环境正确: 56 | * 可执行路径:`PATH\Aria2\run.pyw` 57 | * 参数模板: `--secret --dir PATH [--cookie COOKIE] [--referer REFERER] [--user-agent UA] [URL]` 58 | * 参数模板 `--secret ` 里的 `` 替换为 `aria2.conf` 里的 `rpc-secret=` 后面的值 59 | * 如果需要局域网或互联网使用,在参数模板里加上`--rpc http://127.0.0.1:6800/jsonrpc` ,127.0.0.1:6800 替换为你需要的 IP/域名和端口 60 | * 如果文件名不正确可以加上 `[--output FNAME]` ,加上之后可能会导致文件无法下载 61 | * 如果百度账号在百度云限速黑名单里则去掉 `[--cookie COOKIE]` 62 | 63 | Firefox Quantum (57以后的版本)参照 Chome -------------------------------------------------------------------------------- /rm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -f ${HOME}/Downloads/*.aria2 4 | -------------------------------------------------------------------------------- /rm_bt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -f ${HOME}/Downloads/BitTorrent/*.aria2 4 | -------------------------------------------------------------------------------- /run.pyw: -------------------------------------------------------------------------------- 1 | import aria2rpc 2 | -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | aria2c.exe --conf=aria2.conf --------------------------------------------------------------------------------