linux – wget和curl以某种方式在下载时修改bencode文件
好的,所以我有一个奇怪的问题,我不完全确定如何解释…基本上我正在尝试解码一个bencode文件(.torrent文件)现在我尝试了4或5个不同的脚本我有通过谷歌和SO发现没有运气(不是在字典中得到这样的回报或者输出错误)
现在我正在下载.torrent文件 wget http://link_to.torrent file //and have also tried with curl like so curl -C - -O http://link_to.torrent 我得出的结论是,当我以这种方式下载时,文件中发生了一些事情. 更新: 更新2: *** differnet sizes*** http://torrage.com/torrent/6760F0232086AFE6880C974645DE8105FF032706.torrent wget -> 7345,curl -> 7345,browser download -> 7376 *** same size*** http://isohunt.com/torrent_details/224634397/south+park?tab=summary wget -> 7491,curl -> 7491,browser download -> 7491 *** differnet sizes*** http://torcache.net/torrent/B00BA420568DA54A90456AEE90CAE7A28535FACE.torrent?title=[kickass.to]the.simpsons.s24e12.hdtv.x264.lol.eztv wget -> 4890,curl-> 4890,browser download -> 4985 *** same size*** http://h33t.com/download.php?id=cc1ad62bbe7b68401fe6ca0fbaa76c4ed022b221&f=Game%20of%20Thrones%20S03E10%20576p%20HDTV%20x264-DGN%20%7B1337x%7D.torrent wget-> 30632,curl -> 30632,browser download -> 30632 *** same size*** http://dl7.torrentreactor.net/download.php?id=9499345&name=ubuntu-13.04-desktop-i386.iso wget-> 32324,curl -> 32324,browser download -> 32324 *** differnet sizes*** http://torrage.com/torrent/D7497C2215C9448D9EB421A969453537621E0962.torrent wget -> 7856,curl -> 7556,browser download -> 7888 所以我似乎在某些网站上工作得很好,但是真正在torcache.net和torrage.com上提供文件的网站.现在,如果我可以使用不直接依赖缓存的其他网站,那将是很好的但是我正在使用bitsnoop api(从torrage.com获取所有数据,因此它不是真正的选项)无论如何,如果有人有任何想法关于如何解决这个问题或寻找解决方案的步骤,将不胜感激! 即使任何人都可以重现结果,我们将不胜感激! 解决方法
对于使用命令行工具检索的文件,我得到:
$file 6760F0232086AFE6880C974645DE8105FF032706.torrent 6760F0232086AFE6880C974645DE8105FF032706.torrent: gzip compressed data,from Unix 当然,使用gunzip进行解压缩会产生正确的输出. $wget -S http://torrage.com/torrent/6760F0232086AFE6880C974645DE8105FF032706.torrent --2013-06-14 00:53:37-- http://torrage.com/torrent/6760F0232086AFE6880C974645DE8105FF032706.torrent Resolving torrage.com... 192.121.86.94 Connecting to torrage.com|192.121.86.94|:80... connected. HTTP request sent,awaiting response... HTTP/1.0 200 OK Connection: keep-alive Content-Encoding: gzip 所以服务器确实报告它发送gzip压缩数据,但wget和curl忽略了这一点.curl有一个 – 压缩开关,可以为你正确地解压缩数据.即使对于未压缩的文件,这应该是安全的,它只是告诉http服务器客户端支持压缩,但在这种情况下,curl会查看收到的标头,看它是否真的需要解压缩. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |