title: wget and curl somehow modifying bencode file when downloading
body: <p>Okay so I have a bit of a weird problem going on that I'm not entirely sure how to explain... Basically I am trying to decode a bencode file (.torrent file) now I have tried 4 or 5 different scripts I have found via google  and S.O. with no luck (get returns like this in not a dictionary or output error from same ) </p>
  
  <p>Now I am downloading the .torrent file like so </p>
  
  <pre><code>wget http://link_to.torrent file  
   //and have also tried with curl like so 
  curl -C - -O http://link_to.torrent
  </code></pre>
  
  <p>and am concluding that there is something happening to the file when I download in this way. 
  The reason for this is I found this site which <a href="http://www.tools4noobs.com/online_tools/torrent_decode/" rel="nofollow">will decode a .torrent file you upload online</a> to display the info contained in the file. However when I download a .torrent file by not just clicking on the link through a browser but instead using one of the methods described above it does not work either. 
  So Has anyone experienced a similar problem using one of these methods and found a solution to the problem or even explain why this is happening ?
  As I can;t find much online about it nor know of a workaround that I can use for my server</p>
  
  <p>Update:
  Okay as was suggested by @coder543 to compare the file size of download through browser vs. wget. They are not the same size using wget style results in a smaller filesize so clearly the problem is with <code>wget &amp; curl</code> not the something else .. idea's? </p>
  
  <p><strong>Updat 2:</strong> 
  Okay so I have tried this now a few times and I am narrowing down the problem a little bit, the problem only seems to occur on torcache and torrage links. Links from other sites seems to work properly or as expected ... so here are some links and my results from the thrre different methods:</p>
  
  <pre><code>   *** differnet sizes***
   http://torrage.com/torrent/6760F0232086AFE6880C974645DE8105FF032706.torrent
     wget -&gt; 7345 , curl -&gt; 7345 , browser download -&gt; 7376
  
   *** same size***
   http://isohunt.com/torrent_details/224634397/south+park?tab=summary
   wget -&gt; 7491 , curl -&gt; 7491 , browser download -&gt; 7491
  
   *** differnet sizes***
   http://torcache.net/torrent/B00BA420568DA54A90456AEE90CAE7A28535FACE.torrent?title=[kickass.to]the.simpsons.s24e12.hdtv.x264.lol.eztv
   wget -&gt; 4890 , curl-&gt; 4890 , browser download -&gt; 4985
  
    *** same size***
   http://h33t.com/download.php?id=cc1ad62bbe7b68401fe6ca0fbaa76c4ed022b221&amp;f=Game%20of%20Thrones%20S03E10%20576p%20HDTV%20x264-DGN%20%7B1337x%7D.torrent 
    wget-&gt; 30632 , curl -&gt; 30632 , browser download -&gt; 30632
  
    *** same size***
   http://dl7.torrentreactor.net/download.php?id=9499345&amp;name=ubuntu-13.04-desktop-i386.iso
   wget-&gt; 32324, curl -&gt; 32324, browser download -&gt; 32324
  
   *** differnet sizes***
  http://torrage.com/torrent/D7497C2215C9448D9EB421A969453537621E0962.torrent
  wget -&gt; 7856 , curl -&gt; 7556 ,browser download -&gt; 7888
  </code></pre>
  
  <p>So I it seems to work well on some site but sites which really on torcache.net and torrage.com to supply files. Now it would be nice if i could just use other sites not relying directly on the cache's however I am working with the bitsnoop api (which pulls all it data from torrage.com so it's not really an option) anyways, if anyone has any idea on how to solve this problems or steps to take to finding a solution it would be greatly appreciated!</p>
  
  <p>Even if anyone can reproduce the reults it would be appreciated! 
  ... My server is 12.04 LTS  on 64-bit architecture and the laptop I tried the actual download comparison on is the same </p>