Python中文
首页
教程
问答
标签
搜索
登录
注册
下载python3中指向的内容torrent文件
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>也许我误解了.torrent文件是如何工作的,但是在python中有没有一种方法可以下载实际引用的<strong>内容</strong>。torrent文件指向将要下载的内容,比如使用像utorrent这样的torrent客户机,而是使用python从shell/命令行下载?在</p> <p>下面的方法只需下载一个.torrent文件,我可以打开torrent客户机,也可以下载.torrent,但我宁愿在命令行中简化这个过程。在网上找不到什么。。。在</p> <pre><code>torrent = torrentutils.parse_magnet(magnet) infohash = torrent['infoHash'] session = requests.Session() session.headers.update({'User-Agent': 'Mozilla/5.0'}) url = "http://torcache.net/torrent/" + infohash + ".torrent" answer = session.get(url) torrent_data = answer.content buffer = BytesIO(torrent_data) gz = gzip.GzipFile(fileobj = buffer) output = open(torrent['name'], "wb") output.write(torrent_data) </code></pre> <p>据我所知,我不能在64位windows操作系统上使用libtorrent for python3。在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>BitTornado可在Windows上运行,并具有命令行界面。看看btdownloadheadless.py. 但这是用python2编写的。 <a href="http://www.bittornado.com/download.html" rel="nofollow">http://www.bittornado.com/download.html</a></p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
python语法错误(如果不在Z中,则在X中表示s)
5 回答
Python语法错误(无效)概率
3 回答
python语法错误*带有可选参数的args
2 回答
python语法错误2.5版有什么办法解决吗?
3 回答
Python语法错误2.7.4
10 回答
python语法错误30/09/2013
9 回答
Python语法错误E001
9 回答
Python语法错误not()op
2 回答
python语法错误outpu
6 回答
Python语法错误print len()
1 回答
python语法错误w3
4 回答
Python语法错误不是caugh
10 回答
python语法错误及yt-packag的使用
5 回答
python语法错误可以查出来!!瓦里亚布
1 回答
Python语法错误可能是缩进?
6 回答
Python语法错误和缩进
2 回答
Python语法错误在while循环中生成随机numb
1 回答
Python语法错误在哪里?
2 回答
python语法错误在尝试导入包时,但仅在远程运行时
7 回答
Python语法错误在电子邮件地址提取脚本中
1 回答