Home > 维基技术 > 怎样才能看到维基百科上的图片?

怎样才能看到维基百科上的图片?

由于网通、移动、联通等几大ISP在中国大陆封锁了维基媒体服务器的图像服务器地址,因此有许多中国大陆的用户无法正常使用维基百科的服务,主要体现为页面加载速度非常缓慢,且所有图片无法显示。

在这篇文章之前,已经出现了许多解决这一问题的方法。但有的比较复杂,有的不能完全解决问题(如中文维基百科参数设置中小工具里的那个)。在这里,我写了一个Windows下的批处理程序,来方便需要的用户迅速解决图片无法显示的问题。下面,请按照我给出的步骤进行:

  1. 前往这里(不再建议使用,下方给出了更加智能的工具)下载并解压upload.cmd文件,将它保存在你的电脑的某个角落。
  2. 找到你的电脑的那个角落,双击运行upload.cmd。
  3. enjoy it!

对于Windows Vista和Windows 7的用户,你应该以管理员身份运行这个文件。做法如下:对upload.cmd点击右键,然后选中“以管理员身份运行”。下面给出了这一特殊步骤的图解:

对upload.cmd点右键,然后选择“以管理员身份运行”

对于使用Linux的童鞋们~我相信你们是能够读懂upload.cmd的内容的,然后自己到/etc/hosts下去DIY吧^ ^

2010年5月26日更新:由于Wikimedia最近修改了upload欧洲服务器的IP地址,因此原有的IP已经失效了。上面的下载点已更新了最新的IP地址供各位使用。

2010年8月31日更新:这是一个更加智能地修改hosts的工具。使用方法:解压,运行upload.exe即可。vista和7的用户需要选择以管理员模式运行;win9x的用户会被鄙视掉。程序用纯python编写,有病毒死一户口本。下载地址 | 源代码

Categories: 维基技术 Tags: ,
  1. Camille
    October 9th, 2010 at 23:15 | #1

    如何除去upload.cmd?它影响了看图片的速度啊!也不管用…求高人解答!

    [WORDPRESS HASHCASH] The poster sent us ’0 which is not a hashcash value.

  2. Camille
    October 9th, 2010 at 23:17 | #2

    如何从电脑除去upload.cmd???它影响看其他图片的速度

    [WORDPRESS HASHCASH] The poster sent us ’0 which is not a hashcash value.

  3. zz
    November 23rd, 2010 at 00:07 | #3

    把hosts文件删除试试。

  4. December 15th, 2010 at 09:47 | #4

    非常感谢,很好用的

  5. s187317.k9.stud
    December 21st, 2010 at 20:56 | #5

    谢谢,果然管用!

  6. 我问
    December 23rd, 2010 at 00:39 | #6

    运行upload.exe时弹出对话框:“由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。”

  7. deng1993612
    December 25th, 2010 at 18:00 | #7

    顶一个啊 能用~!!!!!!

  8. humengjun5012
    January 4th, 2011 at 00:10 | #8

    还是不好用啊~~~

  9. Neils Fu
    January 12th, 2011 at 19:18 | #9

    不管用啊,怎么回事?

  10. scorcher
    January 16th, 2011 at 15:59 | #10

    最后一句话太狠了吧。
    其实不用这样的,我相信来这里的人是不会那样做的。
    十分感谢。

  11. 大灰狼
    February 15th, 2011 at 10:10 | #11

    已失效

  12. alpha
    February 23rd, 2011 at 18:23 | #12

    刚试用,没失效~
    楼上乱讲

  13. levie
    February 24th, 2011 at 20:05 | #13

    确实没失效,给力啊~thx

  14. firogm
    March 6th, 2011 at 09:49 | #14

    I am a fresh linux user?How can I do this?

  15. firogm
    March 6th, 2011 at 10:45 | #15

    #!/usr/bin/env python
    # -*- coding: utf8 -*-
    import os, socket
    socket.setdefaulttimeout( 5 )

    def getip( domain ):
    print u’正在测试连接%s…’ % domain
    ( ip, port ) = socket.getaddrinfo( domain, 80 )[0][4]
    sock = socket.socket()
    try:
    sock.connect( ( ip, port ) )
    print u’成功!’
    except:
    print u’失败!’
    ip = ”
    sock.close()
    return ip

    #windir = os.environ.get( ‘WINDIR’ )

    domains = [ 'upload.pmtpa.wikimedia.org', 'upload.esams.wikimedia.org' ]
    for domain in domains:
    ip = getip( domain )
    if ip:
    break

    #if windir and ip:
    # fp = open( ‘%s\\system32\\drivers\\etc\\hosts’ % windir, ‘r’ )
    if ip :
    fp=open( ‘/etc/hosts’,'r’)
    lines = []
    for line in fp:
    if ‘upload.wikimedia.org’ not in line.lower():
    lines.append( line )
    lines.append( ‘%s\tupload.wikimedia.org\n’ % ip )
    print u’正在更新Hosts文件…’
    try:
    # fp = open( ‘%s\\system32\\drivers\\etc\\hosts’ % windir, ‘w’ )
    fp = open(‘/etc/hosts’,'w’)
    fp.writelines( lines )
    fp.close()
    print u’更新完毕。’
    except:
    # print u’Windows Vista、Windows 7用户请使用管理员模式运行本程序!’
    print u’Linux user should this script in root !’
    #elif not windir:
    # print u’请在Windows系统下运行本程序!’
    elif not ip:
    print u’很抱歉,我们无法在您的网络连接上检测到可用的IP地址,这可能是由于所有可用的IP地址均被ISP封锁,或是由于您并未连接到互联网。’
    #os.system( ‘pause’ )
    os.system( ‘sleep 5′ )

  16. george
    March 19th, 2011 at 13:13 | #16

    最近又不能用了,求更新……

  17. davidlung
    March 29th, 2011 at 20:38 | #17

    希望及时推出更新,wiki的图片时有时无,尤其是一些外文的内容。还有就是速度也比较慢。

  18. April 8th, 2011 at 09:43 | #18

    我是Linux用户,怎么办

  19. Philip Tzou
    April 8th, 2011 at 10:48 | #19

    @比尔盖子
    1. 进入shell
    2. sudo gedit /etc/hosts(乃要想用vim我也不拦你)
    3. 加入这一行:
    91.198.174.234 upload.wikimedia.org
    4. save and enjoy it.

  20. Philip Tzou
    April 8th, 2011 at 10:49 | #20

    davidlung :

    希望及时推出更新,wiki的图片时有时无,尤其是一些外文的内容。还有就是速度也比较慢。

    有就说明Wikimedia的欧洲服务器群是可以连上的,有可能是你的网络不稳定导致的

  21. Philip Tzou
    April 8th, 2011 at 10:50 | #21

    george :

    最近又不能用了,求更新……

    国内极少数运营商还封禁了欧洲服务器的,这样的话只能走代理

  22. April 24th, 2011 at 10:15 | #22

    行了,谢谢!

  23. ubuntu新手
    May 6th, 2011 at 20:53 | #23

    @Philip Tzou
    怎么加入那一行啊?新手。。。

  24. wrfenjoy
    May 20th, 2011 at 21:06 | #24

    非常感谢!

  25. May 30th, 2011 at 20:21 | #25

    中国移动的网络,这东西在指令中提示成功,其实还是看不到图。

  26. china dong
    June 13th, 2011 at 19:12 | #26

    我按照地址下载得到一名称为“dist”文件,解压后有一“upload.exe”文件,用管理员身份运行后,wiki图片仍然显示不了,能帮帮忙吗??

  27. Calibre
    June 18th, 2011 at 17:12 | #27

    已经测试成功,收藏了,谢谢

  28. communism
    August 24th, 2011 at 10:36 | #28

    有一些图片又不能显示了

  29. communism
    August 24th, 2011 at 10:38 | #29

    看来只能用自由门了

  30. icastor
    September 2nd, 2011 at 10:15 | #30

    有效!

Comment pages
1 2 10
  1. February 27th, 2010 at 03:28 | #1
  2. March 18th, 2010 at 03:17 | #2
  3. August 30th, 2010 at 09:43 | #3
  4. March 29th, 2011 at 13:26 | #4

site tracking with Asynchronous Google Analytics plugin for Multisite by WordPress Expert at Web Design Jakarta.