Tuesday, December 17, 2013

使用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
  1. mkdir -p ~/.irssi/scripts/autorun
  1. cd ~/.irssi/scripts
  1. wget -O autodl-irssi.zip http://sourceforge.net/projects/autodl-irssi/files/autodl-irssi-v1.31.zip/download
  1. unzip -o autodl-irssi.zip
  1. rm autodl-irssi.zip
  1. cp autodl-irssi.pl autorun/
  1. mkdir -p ~/.autodl
  1. touch ~/.autodl/autodl.cfg
配置文件已创建,位于~/.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
  1. [options]
  2. max-saved-releases = 1000
  3. save-download-history = true
  4. download-duplicates = false
  5. upload-type = rtorrent
  6. rt-dir = ~/files
  7. update-check = auto
  8. unique-torrent-names = false
rTorrent用户同时需要去创建第二个配置文件:
touch ~/.autodl/autodl2.cfg
去你的RPC socket位置编辑新配置文件:
nano ~/.autodl/autodl2.cfg
在文件里输入下面的信息:
[options]
rt-address = ~/.config/rtorrent/socket
保存并继续编辑第一配置文件。
Other clients
  1. [options]
  2. max-saved-releases = 1000
  3. save-download-history = true
  4. download-duplicates = false
  5. upload-type = watchdir
  6. upload-watch-dir = ~/watch
  7. update-check = auto
  8. 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
类型: Integer
默认: 300
举例: download-retry-time-seconds = 120
描述: 如果下载失败, autodl-irssi将会尝试再次下载,如果还不能下载,在download-retry-time-seconds秒后它会放弃,并报告一个错误。
仅适用rTorrent: 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。

剧集/电影模板
(注意,显示过滤器选项中通配符不是必需的!)
  1. [filter TV SHOW MOVIE FILTER TEMPLATE]
  2. shows = The Simpsons, Other show, 3rd Show, Some movie, Movie #2
  3. max-size = 2GB
  4. #seasons = 3-8
  5. #episodes = 0-99
  6. resolutions = SD, 720p
  7. sources = HDTV, DVDRip, BluRay
  8. encoders = xvid, x264
  9. #years = 2008-2012, 1950
  10. #match-sites =
音乐模板
  1. [filter MUSIC FILTER TEMPLATE]
  2. match-sites = what, waffles
  3. min-size = 30MB
  4. max-size = 1GB
  5. years = 1950-1969, 2000, 2009-2099
  6. #shows = ArtistOrGroup #1, ArtistOrGroup #2, etc
  7. #albums = Album #1, Album #2, etc
  8. formats = MP3, FLAC
  9. bitrates = v0 (vbr), lossless
  10. media = CD
  11. #tags = hip hop, tag #2, tag #3
  12. #tags-any = true
  13. #except-tags = hip hop, tag #2, tag #3
  14. #except-tags-any = false
  15. #scene =
  16. #log =
  17. #cue =
随机下载
  1. [filter RANDOM SCENE RELEASE FILTER TEMPLATE]
  2. match-releases = the?simpsons*, american?dad*, blah*
  3. except-releases = *-LOL, *-crapgroup, crap.release*
  4. #match-sites =
  5. #except-sites =
  6. #min-size = 10MB
  7. max-size = 500MB
  8. #max-pretime = 3 secs
  9. #match-uploaders =
  10. #except-uploaders =
某个分类的所有资源
  1. [filter CATEGORY FILTER TEMPLATE]
  2. match-categories = *MP3*, *XVID*
  3. #except-categories = *XXX*
  4. #match-releases =
  5. #except-releases =
  6. #match-sites =
  7. #except-sites =
  8. #min-size =
  9. 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。
  1. [tracker TYPE]
  2. #enabled =
  3. #force-ssl =
  4. #upload-delay-secs =
  5. #cookie =
  6. #passkey =
  7. #etc …
enabled是可选的,默认为true.设置成false可以禁用tracker. force-ssl 也是可选的,可以设置成true强制加密种子下载。
HTTPS为加密下载,一般建议留空使用默认值。
upload-delay-secs也是可选的,意思是autodl-irssi在上传/下载之前等待的秒数。默认是0,表示不等待,这个选项并不需要99.999%的时间。
那么现在你的Tracker已经保存配置文件autodl.cfg里了。
注意:你要花一些时间自己努力填写这些。我尝试有礼貌的提供尽可能多的有关Trackers的信息给大家,但是这依然不够。请确保把所有<>的信息填写覆盖成你自己的。比如:
替换成

mxl1983413
当然这里应该是你的真实用户名。再比如:把替找成
irc.freenode.net
下面是一些国外有名的PT站点的配置文件模板:
What.CD

  1. [tracker what]
  2. authkey =
  3. torrent_pass =
  4. force-ssl = true
  5. #upload-delay-secs =
  6. enabled = true
  7. [server]
  8. nick =|bot
  9. ident-password =
  10. ident-email =
  11. port =
  12. ssl = true
  13. [channel]
  14. name = #
  15. invite-command =
BTN
  1. [tracker btn]
  2. authkey =
  3. torrent_pass =
  4. force-ssl = true
  5. #upload-delay-secs =
  6. enabled = true
  7. [server]
  8. nick =|bot
  9. ident-password =
  10. ident-email =
  11. port =
  12. ssl = true
  13. [channel]
  14. name = #
SCC
注意:这个有些麻烦,你需要访问他们的support channel,请求他们允许你在自己的虚拟机上使用IRC自动下载,等他们授权后你才可以正常订阅。
  1. [tracker scc]
  2. authkey =
  3. force-ssl = true
  4. #upload-delay-secs =
  5. enabled = true
  6. [server]
  7. nick = Username-bot
  8. ident-password =
  9. ident-email =
  10. port =
  11. ssl = true
  12. [channel]
  13. name = #
  14. invite-http-data = announce=yes
  15. invite-http-header = Cookie: uid=; pass=
  16. 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!icon biggrin 使用Autodl irssi在IRC自动下载种子的方法
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.icon smile 使用Autodl irssi在IRC自动下载种子的方法
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.

No comments:

Post a Comment