处理Torrent文件的工具。

torrentool的Python项目详细描述


https://github.com/idlesign/torrentool

LBC Python 2
https://img.shields.io/pypi/v/torrentool.svghttps://img.shields.io/pypi/l/torrentool.svghttps://img.shields.io/coveralls/idlesign/torrentool/master.svghttps://img.shields.io/travis/idlesign/torrentool/master.svghttps://landscape.io/github/idlesign/torrentool/master/landscape.svg?style=flat

说明

处理Torrent文件的工具。

适用于Python2.7+和3.5+。

包括:

  • 命令行接口(需要安装click包)
  • Torrent Utils(文件创建、读取和修改)
  • bencoding utils(解码器、编码器)

使用cli

; Make .torrent out of `video.mkv`
$ torrentool torrent create /home/my/files_here/video.mkv

; Make .torrent out of entire `/home/my/files_here` dir,
; and put some open trackers announce URLs into it,
; and publish file on torrent caching service, so it is ready to share.
$ torrentool torrent create /home/my/files_here --open_trackers --cache

; Print out existing file info.
$ torrentool torrent info /home/my/some.torrent

使用命令行--help开关了解更多信息。

注意

有些命令要求安装requests包。

从您的python代码

fromtorrentool.apiimportTorrent# Reading and modifying an existing file.my_torrent=Torrent.from_file('/home/idle/some.torrent')my_torrent.total_size# Total files size in bytes.my_torrent.magnet_link# Magnet link for you.my_torrent.comment='Your torrents are mine.'# Set a comment.my_torrent.to_file()# Save changes.# Or we can create a new torrent from a directory.new_torrent=Torrent.create_from('/home/idle/my_stuff/')# or it could have been a single filenew_torrent.announce_urls='udp://tracker.openbittorrent.com:80'new_torrent.to_file('/home/idle/another.torrent')

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为textview创建选定状态(突出显示)   Java Hibernate计数行   Java语言中的字符串比较   java为什么SparkLauncher会立即返回而不会生成任何作业?   java layout_centerInParent在抛出回收视图后不工作   c#中的readInt16()与java中的readShort()   java如何在工具栏菜单中添加昼夜切换器   java在eclipse上向Tomcat提供<Realm/>信息   java使用给定的随机路径构造一个图   带有对象推送的java Morphia聚合阶段组   java关闭JTable实例   性能如何更好地转换java中的所有集合元素?   JAVA木卫一。IOException:通过Eclipse读取Java中的EOF Lucene   java如何在Android中将光标设置在tableLayout的行/列中所需的位置   使用HashMap的Set的java迭代器不会生成值/键吗?   java google guava cachebuilder在ExipeAfterAccess和expireActerWrite之间使用的时间更长   如何将这个排序映射方法从java转换为Kotlin   java如何从运行的JAR文件中读取war目录?   SpringBootJava。使用Java 9模块(JPM)时lang.NoSuchMethodError