使用Autodl-irssi在IRC自动下载种子的方法
autodl-irssi是一个通过你的announce设置过滤器从IRC渠道自动下载种子的方法。注意:以下所有工作都必须通过命令行来完成。
安装
——————————————————一、irssi
1、通过SSH登录到你的服务器(Seedbox)。2、用这个命令开始irssi
irssi
3、创建一个新的隐藏窗口。/window new hidden
4.窗口名称“autodl”。/window name autodl
5.新窗口移动至位置2。/window move 2
6.保存布局。/layout save
7.保存所有设置。/save
8.退出irssi。/exit
二、autodl-irssi
-
mkdir -p ~/.irssi/scripts/autorun
-
cd ~/.irssi/scripts
-
wget -O autodl-irssi.zip http://sourceforge.net/projects/autodl-irssi/files/autodl-irssi-v1.31.zip/download
-
unzip -o autodl-irssi.zip
-
rm autodl-irssi.zip
-
cp autodl-irssi.pl autorun/
-
mkdir -p ~/.autodl
-
touch ~/.autodl/autodl.cfg
nano ~/.autodl/autodl.cfg
一旦你配置文件autodl.cfg启动irssi,该脚本将自动运行。建议你在后台运行-irssi,这样你就可以关闭终端,irssi会继续运行。screen -S autodl irssi
这个命令将创建名为“autodl”的进程,它会运行“irssi”。然后使用这个命令退出进程窗口:
Ctrl+A, d
重新连接到irssi对话查看它运行情的命令是:screen -r autodl
配置
——————————————————所有的过滤器和其它选项都是从这里读取:~/.autodl/autodl.cfg.如果你使用非ASCII字符,一定要把编码(或字符编码)设置成UTF-8格式再保存。每当你做了任何修改的时候,autodl-irssi运行时都会重新读取。
选项
rTorrent- [options]
- max-saved-releases = 1000
- save-download-history = true
- download-duplicates = false
- upload-type = rtorrent
- rt-dir = ~/files
- update-check = auto
- unique-torrent-names = false
touch ~/.autodl/autodl2.cfg
去你的RPC socket位置编辑新配置文件:nano ~/.autodl/autodl2.cfg
在文件里输入下面的信息:[options]
rt-address = ~/.config/rtorrent/socket
保存并继续编辑第一配置文件。Other clients
- [options]
- max-saved-releases = 1000
- save-download-history = true
- download-duplicates = false
- upload-type = watchdir
- upload-watch-dir = ~/watch
- update-check = auto
- unique-torrent-names = false
header的选项
下面这些选项可以改善autodl-irssi的性能,请把这些选项放在[options]的header.名称: update-check
类型: string
默认: ask
举例: update-check = auto
描述: autodl-irssi可以自动更新。有效值是ask、auto和disabled。当有新版本可用的时候,如果你选择ask,它会给你发送一条消息,使用auto,则会自动更新。而使用disabled则表示不进行任何更改。
名称: max-saved-releases
类型: Integer greater than or equal to 0.
默认: 1000
举例: max-saved-releases = 200
描述: max-saved-releases可以让autodl-irssi记住已经下载的文件,使用它之后如果再有相同的文件被更新,它会忽略它,而不会再次下载。
名称: save-download-history
类型: Boolean
默认: true
举例: save-download-history = true
描述: 设置为false 可以禁止写入已下载的最后的数值N(=max-saved-releases)到~/.autodl/DownloadHistory.txt.
名称: download-duplicates
类型: Boolean
默认: false
举例: download-duplicates = true
描述: 默认情况下,它是false,所以不会重复下载,但是如果你想再次下载重新发布的相同版本,就要设置为true。
名称: unique-torrent-names
类型: Boolean
默认: false
举例: unique-torrent-names = true
描述: 如果选择true,将会使用网页上的标题作为文件名;如果选择false,将会使用种子的名字作为文件名。
名称: download-retry-time-seconds仅适用rTorrent:
类型: Integer
默认: 300
举例: download-retry-time-seconds = 120
描述: 如果下载失败, autodl-irssi将会尝试再次下载,如果还不能下载,在download-retry-time-seconds秒后它会放弃,并报告一个错误。
rt-dir 是下载目录。Torrent种子数据将被保存在这里。可以使用宏命令。
rt-commands 当加载种子文件的时候可以用来执行一些rtorrent命令。仅适用于高级用户。
rt-label 用来设定一个ruTorrent标签。
rt-ratio-group 用户来设定一个ruTorrent ratio组.有效的名字为:rat0, rat1, ..., rat7.
rt-channel 用来设定一个ruTorrent通道。有效的名字是thr0,thr1,……,thr9。
rt-priority 设置种子优先级。有效参数是0, dont-download, 1, low, 2, normal, 3, high.如果你把它设置为dont-download(0),种子torrent会加载的,但不会自动开始下载。
rt-ignore-scheduler:设置它为true可以禁用ruTorrent调式程序。
rt-dont-add-name: 如果你不想种子名称被添加到路径可以设置为true。
剧集/电影模板
(注意,显示过滤器选项中通配符不是必需的!)- [filter TV SHOW MOVIE FILTER TEMPLATE]
- shows = The Simpsons, Other show, 3rd Show, Some movie, Movie #2
- max-size = 2GB
- #seasons = 3-8
- #episodes = 0-99
- resolutions = SD, 720p
- sources = HDTV, DVDRip, BluRay
- encoders = xvid, x264
- #years = 2008-2012, 1950
- #match-sites =
音乐模板
- [filter MUSIC FILTER TEMPLATE]
- match-sites = what, waffles
- min-size = 30MB
- max-size = 1GB
- years = 1950-1969, 2000, 2009-2099
- #shows = ArtistOrGroup #1, ArtistOrGroup #2, etc
- #albums = Album #1, Album #2, etc
- formats = MP3, FLAC
- bitrates = v0 (vbr), lossless
- media = CD
- #tags = hip hop, tag #2, tag #3
- #tags-any = true
- #except-tags = hip hop, tag #2, tag #3
- #except-tags-any = false
- #scene =
- #log =
- #cue =
随机下载
- [filter RANDOM SCENE RELEASE FILTER TEMPLATE]
- match-releases = the?simpsons*, american?dad*, blah*
- except-releases = *-LOL, *-crapgroup, crap.release*
- #match-sites =
- #except-sites =
- #min-size = 10MB
- max-size = 500MB
- #max-pretime = 3 secs
- #match-uploaders =
- #except-uploaders =
某个分类的所有资源
- [filter CATEGORY FILTER TEMPLATE]
- match-categories = *MP3*, *XVID*
- #except-categories = *XXX*
- #match-releases =
- #except-releases =
- #match-sites =
- #except-sites =
- #min-size =
- max-size = 10GB
[tracker] header
下载种子前你的trackers会进行验证,可以使用Tracker header来设置所要求的选项让它正常工作。Tracker header看起来像
[tracker TYPE]
,TYPE是一个Tracker类型。你可以在~/.irssi/scripts/AutodlIrssi/trackers/*.tracker
文件中找到完全相同的类型。用文本编辑器打开一个文件,定位到type=”XYZ”这一行,在引号中使用像XYZ这样的变量值,例如: [tracker XYZ]
.要注意大小写,XYZ和xyz意义是不同的。有些trackers需要一个Passkey,还有的是authkey,或者cookie,等等吧。你需要快速找出其中的tracker,添加 [tracker TYPE](它下面没有选项)到autodl.cfg,然后等待1-2秒(如果有必要启动irssi)。它会提示缺失的选项,比如:
ERROR: /home/YOURNAME/.autodl/autodl.cfg: line 123: TRACKER-TYPE: Missing option(s): passkey, uid
。这是说你忘记加入passkey = XXX 和uid = YYY。在Trackers header下面添加上就可以了。一些常见的tracker选项和如何获取它们: cookie: 去你的tracker的主页,在地址栏键入
javascript:document.innerHTML=document.cookie
然后按回车键,你应该就可以看到你的cookie。如果你看到的是PHPSESSID = XXXXX
, 那么你就需要使用火狐浏览器手动获取cookie:编辑-> ->隐私偏好->标签->显示Cookies.它通常就是这样的:uid=XXX; pass=YYY
。每个KEY对应一个键值对,要用分号分开。
passkey: 国内的PT站点都是使用它,相信你可以轻松的找到。
authkey:和Passkey一样,在它出现在gazelle的PT站点,你可以在种子下载链接中找到它。
torrent_pass: 同样是gazelle的PT站点上的,在种子下载链接中寻找。
uid:只要不是白痴,都应该知道这是什么东西了,一般把鼠标悬停在你的用户名,浏览器下方就会网址提示,上面会显示你的uid。- [tracker TYPE]
- #enabled =
- #force-ssl =
- #upload-delay-secs =
- #cookie =
- #passkey =
- #etc …
HTTPS为加密下载,一般建议留空使用默认值。 upload-delay-secs也是可选的,意思是autodl-irssi在上传/下载之前等待的秒数。默认是0,表示不等待,这个选项并不需要99.999%的时间。
那么现在你的Tracker已经保存配置文件autodl.cfg里了。
注意:你要花一些时间自己努力填写这些。我尝试有礼貌的提供尽可能多的有关Trackers的信息给大家,但是这依然不够。请确保把所有<>的信息填写覆盖成你自己的。比如:
把
替换成mxl1983413
当然这里应该是你的真实用户名。再比如:把
替找成irc.freenode.net
下面是一些国外有名的PT站点的配置文件模板:What.CD
- [tracker what]
- authkey =
- torrent_pass =
- force-ssl = true
- #upload-delay-secs =
- enabled = true
- [server]
- nick =|bot
- ident-password =
- ident-email =
- port =
- ssl = true
- [channel]
- name = #
- invite-command =
- [tracker btn]
- authkey =
- torrent_pass =
- force-ssl = true
- #upload-delay-secs =
- enabled = true
- [server]
- nick =|bot
- ident-password =
- ident-email =
- port =
- ssl = true
- [channel]
- name = #
注意:这个有些麻烦,你需要访问他们的support channel,请求他们允许你在自己的虚拟机上使用IRC自动下载,等他们授权后你才可以正常订阅。
- [tracker scc]
- authkey =
- force-ssl = true
- #upload-delay-secs =
- enabled = true
- [server]
- nick = Username-bot
- ident-password =
- ident-email =
- port =
- ssl = true
- [channel]
- name = #
- invite-http-data = announce=yes
- invite-http-header = Cookie: uid=; pass=
- invite-http-url = https:///irc
Values
—————————————–All lines starting with the # character are ignored (they’re comments). Use it to disable some options.
The file contains several headers of the form [headername] and header options immediately below the header. The options are of the form option-name = option-value. If you leave out the value or option-name, then the default value will be used.
There are a few different option types:
Comma separated list. eg. value1, value2, value3.
List of numbers. eg. 1980-1999, 2010, 2012
String. Any number of random characters.
Integer. Any integer.
Boolean. false, off, no, or 0 all mean “false”. Anything else means “true”.
Size. eg. 120 MB or 4.5GB
All option values are case-insensitive so eg. The Simpsons is the same thing as the siMPSonS.
The comma separated list type supports wildcards, where the * character means 0 or more characters, and the ? character means exactly one character. Google wildcards for more information. Example, simpsons will match any text with the word simpsons in it. It means First 0 or more characters, then “simpsons”, then 0 or more characters. Note that simpsons* is not the same thing, it means First “simpsons” then 0 or more characters, so simpsons* will match anything that begins with the word “simpsons” followed by any text.
The filter header
Create one [filter] header per filter. You can optionally name the filter like [filter MY FILTER NAME]. All filter options are optional! If you don’t use any filter options, then everything will be downloaded because your filter doesn’t filter out anything.
Name: enabled
Type: Boolean
Default: true
Example: enabled = false
Description: Use it to disable a filter. All filters are enabled by default.
Name: match-releases
Type: Comma separated list
Example: match-releases = The?Simpsons*, American?Dad*
Description: It’s compared against the torrent name, eg. Some.release.720p.HDTV-GROUP. If the filter should only match TV-shows or movies, it’s easier to use the shows filter option since it doesn’t require wildcards.
Name: except-releases
Description: The exact opposite of match-releases. If a release matches this option, then it’s NOT downloaded.
Name: match-categories
Type: Comma separated list
Example: match-categories = MP3, TV/XVID
Description: It’s compared against the torrent category.
Name: except-categories
Description: The exact opposite of except-categories. If a release matches this option, then it’s NOT downloaded.
Name: match-sites
Type: Comma separated list
Example: match-sites = tracker1, tracker2, tracker3
Description: It’s compared against the tracker. Use the full tracker name, eg. MyTracker or use one of the tracker types found in ~/.irssi/scripts/AutodlIrssi/trackers/*.tracker. Open one of the files and locate the type=”XYZ” line. Use the value inside the quotes, eg. XYZ.
Name: except-sites
Description: The exact opposite of match-sites. If a release matches this option, then it’s NOT downloaded.
Name: min-size
Type: Size
Example: min-size = 200MB
Default: 0
Description: Used to filter out too small torrents.
Name: max-size
Type: Size
Example: max-size = 2.5GB
Default: any size is allowed
Description: Used to filter out too big torrents. I recommend everyone to always use this option so you don’t accidentally download a 100GB torrent! Set it to a reasonable value, eg. for TV-shows, set it to about twice the size of a normal episode (just in case it’s a double-episode). This will automatically filter out season packs!
Name: shows
Type: Comma separated list
Example: shows = The Simpsons, American Dad
Description: This is for TV-shows, movies and artists/groups (what.cd/waffles only). autodl-irssi will automatically extract the TV-show/movie name from a scene release name. Example, The.Simpsons.S35E24.720p.HDTV-BLAH will match a shows option set to the simpsons. You don’t need wildcards at all, though it’s possible to use wildcards. It’s recommended to use shows instead of match-releases if all you want is for the filter to match TV-shows or movies. what.cd and waffles: this will match against the artist/group.
Name: seasons
Type: List of numbers
Example: seasons = 1, 3, 5-10
Description: This is for TV-shows only. Unless the release matches one of the seasons, it’s not downloaded.
Name: episodes
Type: List of numbers
Example: episodes = 1, 3, 5-10
Description: This is for TV-shows only. Unless the release matches one of the episodes, it’s not downloaded.
Name: resolutions
Type: Comma separated list
Example: resolutions = SD, 720p, 1080p
Description: This is for TV-shows and movies only. Unless the release matches one of the resolutions, it’s not downloaded. Valid resolutions are one or more of the following: SD, 480i, 480p, 576p, 720p, 810p, 1080i, 1080p.
Name: sources
Type: Comma separated list
Example: sources = HDTV, DVDRip, BluRay
Description: This is for TV-shows and movies only. Unless the release matches one of the sources, it’s not downloaded. Valid sources are one or more of the following: DSR, PDTV, HDTV, HR.PDTV, HR.HDTV, DVDRip, DVDScr, BDr, BD5, BD9, BDRip, BRRip, DVDR, MDVDR, HDDVD, HDDVDRip, BluRay, WEB-DL, TVRip, CAM, R5, TELESYNC, TS, TELECINE, TC. TELESYNC and TS are synonyms (you don’t need both). Same for TELECINE and TC.
Name: encoders
Type: Comma separated list
Example: encoders = x264, xvid
Description: If you don’t want windows WMV files, this option could be useful. Valid encoders are: XviD, DivX, x264, h.264 (or h264), mpeg2 (or mpeg-2), VC-1 (or VC1), WMV.
Name: years
Type: List of numbers
Example: years = 1999, 2005-2010
Description: Not all releases have a year in the torrent name, but if it does, you can use it to filter out too old or too new releases.
Name: albums
Type: Comma separated list
Example: albums = Some album, Some other album, yet another one
Description: what.cd/waffles only.
Name: formats
Type: Comma separated list
Example: formats = MP3, FLAC
Description: what.cd/waffles only. List the formats you want. Valid formats are: MP3, FLAC, Ogg, AAC, AC3, DTS.
Name: bitrates
Type: Comma separated list
Example: bitrates = 192, V0 (vbr), lossless
Description: what.cd/waffles only. List the bitrates you want. Some example values: 192, 320, APS (VBR), V2 (VBR), V1 (VBR), APX (VBR), V0 (VBR), q8.x (VBR), Lossless, 24bit Lossless, Other.
Name: media
Type: Comma separated list
Example: media = CD, WEB
Description: what.cd/waffles only. List the media you want. Valid media are: CD, DVD, Vinyl, Soundboard, SACD, DAT, Cassette, WEB, Other.
Name: tags
Type: Comma separated list
Example: tags = hip hop, rock
Description: what.cd/waffles only. Unless at least one of your tags matches the release’s tags, it’s not downloaded. See also except-tags and tags-any.
Name: except-tags
Type: Comma separated list
Example: except-tags = hip hop, rock
Description: what.cd/waffles only. Same as tags except if it matches any/all of these, it’s not downloaded. See also tags and except-tags-any.
Name: tags-any
Type: Boolean
Default: true
Example: tags-any = false
Description: what.cd/waffles only. Decides how to match the tags option, ie., if any or all of the tags must match.
Name: except-tags-any
Type: Boolean
Default: true
Example: except-tags-any = true
Description: what.cd/waffles only. Decides how to match the except-tags option, ie., if any or all of the tags must match.
Name: scene
Type: Boolean
Example: scene = true
Description: what.cd/waffles, and a few others. Some sites mark a release as scene or non-scene. Set it to true if you want only scene releases, false if you only want non-scene releases, or don’t use this option if you don’t care.
Name: log
Type: Boolean
Example: log = true
Description: what.cd/waffles. Set it to true if you only want releases with a log file, false if you don’t want releases with log files, or don’t use this option if you don’t care.
Name: cue
Type: Boolean
Example: cue = true
Description: what.cd. Set it to true if you only want releases with a cue file, false if you don’t want releases with cue files, or don’t use this option if you don’t care.
Name: match-uploaders
Type: Comma separated list
Example: match-uploaders = uploader1, uploader2
Description: Use it to only download from certain uploaders.
Name: except-uploaders
Description: The exact opposite of match-uploaders. If a release matches this option, then it’s NOT downloaded.
Name: max-pretime
Type: time-since string
Example: max-pretime = 2 mins 3 secs
Description: Some sites announce the pretime of the release. Use this to filter out old releases.
Name: max-downloads
Type: Integer
Example: max-downloads = 15
Description: Download no more than this number of torrents per week/month (see max-downloads-per). Remove the filter option or set it to a negative number to disable it.
Name: max-downloads-per
Type: String
Example: max-downloads-per = week
Description: Valid values are day, week, and month. See max-downloads.