直接链接到Google云端硬盘图像不起作用[在CodeSkulptor中]



我已经上传到谷歌驱动器和保管箱(公共文件夹)图像没有加载,为什么当我访问谷歌驱动器的公共网址时,错误说(403。这是一个错误。

您的客户端无权从此服务器获取 URL/U7NFy4SAHqDw6I3-Yd11AG2fi5QaCiIsn62wqOJO0gPRO68G5yfGurFiVm75HezqRtmrwlE33lxRyTF6。(客户端 IP 地址:103.21.166.13)

ACL 被拒绝 这就是我们所知道的。

这是我的codeskulptor代码。

import simplegui
message = "Welcome!"
# Handler for mouse click
image = simplegui.load_image('https://drive.google.com/file/d/0Bworipp9D5BbQ0t1aVE2NDlsaXc/edit?usp=sharing')
# Handler to draw on canvas
def draw(canvas):
    canvas.draw_image(image, (596, 25), (1192, 50), (100, 100), (128, 128))
    print image.get_width();
    print image.get_height();
# Create a frame and assign callbacks to event handlers
frame = simplegui.create_frame("Home", 300, 200)
frame.set_draw_handler(draw)
# Start the frame animation
frame.start()

Google 云端硬盘不会随时提供上传文件的直接链接。
这可以通过将 URL 从以下位置更改为 URL 来规避:

https://drive.google.com/file/d/0Bworipp9D5BbQ0t1aVE2NDlsaXc/edit?usp=sharing

自:

https://docs.google.com/uc?export=download&id=0B8w52Vdma1fVMDhiZmlieEJxQ28


您可以看到,这是基于以下 URL 的常规模板,您只需从原始链接插入文件 ID:

https://docs.google.com/uc?export=download&id=

资料来源:谷歌论坛。

最新更新