Solutions to slow internet in Vietnam: Download Bitshare with great speed

Submitted by tomo on August 5, 2011 - 4:04am

The internet speed in Vietnam is back to dialup level.  There are rumors of another cable cut as well as maintenance that will last more than another week.  This after weeks of "undersea cable maintenance" after which we had awesome download speeds for awhile.  This means a lot of large transfers from sites outside of Vietnam are unbearably slow.  In the meantime, go buy your favorite movies or TV shows on DVD for 10,000 VND, it'll be quicker.

There is a time of day when speeds are much better.  It's in the wee hours of the morning, when most of the population has stopped downloading porn for the day.

If you're slightly resourceful you can take advantage of that window of high speed internet by downloading to a server outside Vietnam during the daytime and then downloading from there to your home PC at nighttime.

Don't have your own server? Virtual private servers are cheap, and having one also lets you have your own personal proxy server to access Facebook in Vietnam when it's down.

So the idea is the download to the overseas server during the day, then offload it at night.  But for many file uploading sites (like Rapidshare, Megaupload, etc.) you can't just hotlink to a file, so regular wget won't work.  

So I looked for ways around this.  Here's how to download Bitshare files to a server from the command line.

First, when hacking around in Bitshare's javascript code, I noticed they use the runde function that so many other file-sharing sites use to do their countdown.  I have no idea what runde means or if it's from a library or if everyone's just copying everyone else's code.  The countdown is also resource (cpu) expensive, as it's updating every fraction of a second.  In Chrome, if the tab isn't currently active, the browser will deprioritize javascript running in that window and so the timer will run really slow.

Fortunately, it's really easy to hack the timer.  In Chrome Developer's console, just enter:

time="1.0"

You mean need to do it a few times depending on where in the timer update we are in when we reset the timer (it may be in the process of updating).  But you should eventually get it to 0.

You'll need the Chrome cookies.txt export extension to easily access your cookies from Bitshare.com.

Save your exported cookies to cookies.txt in your current directory on the server.  Then run the script with the current page URL, copy and paste the link for download that appears after you fill in the captcha, and enter the name of the file to download to (we could probably get this automatically from wget, feel free to send me a patch).

A variant on this should work for most file uploading sites which give you a download link after entering the captcha.  For ones where download begins when submitting the captcha form, it's a bit different.

Attachments: 
Read the rest of this article...
tomo
The file has been renamed because I forgot Apache wouldn't allow downloading files with .sh extension.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div> <pre>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
By submitting this form, you accept the Mollom privacy policy.
© 2010-2014 Saigonist.