Python 如何获取reddit注释的嵌入json?

Python 如何获取reddit注释的嵌入json?,python,python-3.x,oembed,reddit,Python,Python 3.x,Oembed,Reddit,我试图使用python oembedlibrary从reddit()获取oembed注释: 并获取oembed.OEmbedError:oembed富响应上缺少必需字段。错误 如何检索此数据?reddit返回的oembed无效 从§2.3.4.4开始,丰富类型需要宽度和高度 但是,从中可以看出,reddit既不提供宽度也不提供高度值 您可能需要让reddit修复其损坏的oembed实现,或者您可能希望使用更宽容的库 import oembed consumer = oembed.OEmbedC

我试图使用
python oembed
library从reddit()获取oembed注释:

并获取
oembed.OEmbedError:oembed富响应上缺少必需字段。
错误


如何检索此数据?

reddit返回的oembed无效

从§2.3.4.4开始,
丰富
类型需要
宽度
高度

但是,从中可以看出,reddit既不提供
宽度
也不提供
高度

您可能需要让reddit修复其损坏的oembed实现,或者您可能希望使用更宽容的库

import oembed

consumer = oembed.OEmbedConsumer()
endpoint = oembed.OEmbedEndpoint('https://www.reddit.com/oembed',['https://www.reddit.com/r/*'])

consumer.addEndpoint(endpoint)

response = consumer.embed('https://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/cno7zic')