由于+-的网络封锁,导致很多好东西无法使用,dropbox就是其一。
当我们在linux的软件管理器搜索并安装dropbox后,启动dropbox会弹出一个对话框,提示:In order to use Dropbox, you must download the proprietary daemon.让我们下载proprietary daemon。这时候你点击确定,是无法启动dropbox的。
其实,我们安装的这个dropbox只是一个壳,程序所需的daemon还没有安装。但是由于+-的封锁,我们无法连接官网进行下载。
经过查看dropbox的源代码,可以发现如下内容。
class DownloadState(object):
def __init__(self):
try:
self.file = urllib.urlopen(“http://www.getdropbox.com/download?plat=%s” % plat())
except IOError:
FatalVisibleError(“Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable.”)
fcntl.fcntl(self.file, fcntl.F_SETFL, os.O_NONBLOCK)
def __init__(self):
try:
self.file = urllib.urlopen(“http://www.getdropbox.com/download?plat=%s” % plat())
except IOError:
FatalVisibleError(“Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable.”)
fcntl.fcntl(self.file, fcntl.F_SETFL, os.O_NONBLOCK)
很明显,真实的下载地址就是:
http://www.getdropbox.com/download?plat=%s 。但地址中的plat=???呢。我们查看plat函数的代码:
def plat():
if sys.platform.lower().startswith(‘linux’):
arch = platform.machine()
if (arch[0] == ‘i’ and arch[1].isdigit() and arch[2:4] == ‘86′):
plat = “x86″
elif arch == ‘x86_64′:
plat = arch
else:
FatalVisibleError(“Platform not supported”)
return “lnx.%s” % plat
else:
FatalVisibleError(“Platform not supported”)
if sys.platform.lower().startswith(‘linux’):
arch = platform.machine()
if (arch[0] == ‘i’ and arch[1].isdigit() and arch[2:4] == ‘86′):
plat = “x86″
elif arch == ‘x86_64′:
plat = arch
else:
FatalVisibleError(“Platform not supported”)
return “lnx.%s” % plat
else:
FatalVisibleError(“Platform not supported”)
没错,64位系统下plat()的返回值是x86_64,32位的是x86.注意这一句:return “lnx.%s” % plat ,以我64位系统为例,返回的最终值为lnx.x86_64 。于是,真实的下载地址是
http://www.getdropbox.com/download?plat=lnx.x86_64 。遗憾的是:没有翻墙的童鞋还是无法下载这个文件。不过我已经将32和64对应的文件都下载并分享了。
地址如下:
https://dl.dropbox.com/u/102960712/dropbox-lnx.x86-1.4.17.tar.gz
https://dl.dropbox.com/u/102960712/dropbox-lnx.x86_64-1.4.17.tar.gz
这两个都是最新版本。
下载并解压后,你会得到一个名叫:.dropbox-dist的文件夹。直接拷贝到你电脑的主文件夹下面就好了。然后启动dropbox,一切ok。