[Translated]20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md

This commit is contained in:
GOLinux 2015-05-13 14:31:45 +08:00
parent 99482de653
commit c695d1f645
2 changed files with 62 additions and 64 deletions

View File

@ -1,64 +0,0 @@
Translating by GOLinux!
Linux FAQs with Answers--How to view torrent file content on Linux
================================================================================
> **Question**: I have a torrent file downloaded from the web. Is there a tool that allows me to view the content of a torrent on Linux? For example, I want to know what files are included inside a torrent.
A torrent file (i.e., a file with **.torrent** extension) is a BitTorrent metadata file which stores information (e.g., tracker URLs, file list, sizes, checksums, creation date) needed by a BitTorrent client to download files shared on BitTorrent peer-to-peer networks. Inside a single torrent file, one or more files can be listed for sharing.
The content of a torrent file is encoded with BEncode, the BitTorrent's data serialization format. Thus to view the content of a torrent file, you need a corresponding decoder.
In fact, any GUI-based BitTorrent client (e.g., Transmission or uTorrent) is equipped with BEncode decoder, so can show to you the content of a torrent file by opening it. However, if you don't want to use any sort of BitTorrent client to check up on a torrent file, you can try a command-line torrent viewer called [dumptorrent][2].
The **dumptorrent** command prints the detailed content of a torrent file (e.g., file names, sizes, tracker URLs, creation date, info hash, etc.) by using a built-in BEncode decoder.
### Install DumpTorrent on Linux ###
To install dumptorrent on Linux, you can build it from the source.
On Debian, Ubuntu or Linux Mint:
$ sudo apt-get install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin
On CentOS, Fedora or RHEL:
$ sudo yum install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin
Make sure that /usr/local/bin is [included][2] in your PATH.
### View the Content of a Torrent ###
To check the content of a torrent, simply run dumptorrent with a torrent file as an argument. This will print a summary of a torrent, including file names, sizes and tracker URL.
$ dumptorrent <torrent-file>
![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg)
To view the full content of a torrent, add "-v" option. This will print more detailed information of a torrent, including info-hash, piece length, creation date, creator, and full announce list.
$ dumptorrent -v <torrent-file>
![](https://farm6.staticflickr.com/5331/17438628461_1f6675bd77_b.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/view-torrent-file-content-linux.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://dumptorrent.sourceforge.net/
[2]:http://ask.xmodulo.com/change-path-environment-variable-linux.html

View File

@ -0,0 +1,62 @@
Linux有问必答——Linux上如何查看torrent文件内容
================================================================================
> **问题** 我从网站上下载了一个torrent文件。Linux上有没有工具让我查看torrent文件的内容例如我想知道torrent里面都有什么文件。
torrent文件也就是扩展名为**.torrent**的文件是BitTorrent元数据文件里面存储了BitTorrent客户端用来从BitTorrent点对点网络下载共享文件的信息追踪器URL、文件列表、大小、校验和、创建日期等。在单个torrent文件里面可以列出一个或多个文件用于共享。
torrent文件内容由BEncode编码为BitTorrent数据序列化格式因此要查看torrent文件的内容你需要相应的解码器。
事实上任何图形化的BitTorrent客户端如Transmission或uTorrent都带有BEncode解码器所以你可以用它们直接打开来查看torrent文件的内容。然而如果你不想要使用BitTorrent客户端来检查torrent文件你可以试试这个命令行torrent查看器它叫[dumptorrent][1]。
**dumptorrent**命令可以使用内建的BEncode解码器打印torrent文件的详细信息文件名、大小、跟踪器URL、创建日期、信息散列等等
### 安装DumpTorrent到Linux ###
要安装dumptorrent到Linux你可以从源代码来构建它。
在Debian、Ubuntu或Linux Mint上
$ sudo apt-get install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin
在CentOS、Fedora或RHEL上
$ sudo yum install gcc make
$ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz
$ tar -xvf dumptorrent-1.2.tar.gz
$ cd dumptorrent-1.2
$ make
$ sudo cp dumptorrent /usr/local/bin
确保你的路径中[包含][2]了/usr/local/bin。
### 查看torrent的内容 ###
要检查torrent的内容只需要运行dumptorrent并将torrent文件作为参数执行。这会打印出torrent的概要包括文件名、大小和跟踪器URL。
$ dumptorrent <torrent-file>
![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg)
要查看torrent的完整内容请添加“-v”选项。它会打印更多关于torrent的详细信息包括信息散列、片长度、创建日期、创建者以及完整的声明列表。
$ dumptorrent -v <torrent-file>
![](https://farm6.staticflickr.com/5331/17438628461_1f6675bd77_b.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/view-torrent-file-content-linux.html
作者:[Dan Nanni][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://dumptorrent.sourceforge.net/
[2]:http://ask.xmodulo.com/change-path-environment-variable-linux.html