我正在尝试使用python-oembed
库从reddit(https://github.com/reddit/reddit/wiki/oEmbed)获取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')
并得到oembed.OEmbedError: Missing required fields on OEmbed rich response.
错误。你知道吗
如何检索这些数据?你知道吗
reddit返回的oembed无效。你知道吗
从http://oembed.com/,§2.3.4.4,
width
和height
是rich
类型所必需的。你知道吗但是,从the reddit sample,我们看到reddit不提供
width
或height
值。你知道吗您可能需要让reddit来修复损坏的oembed实现,或者您可能希望使用更宽容的库。你知道吗
相关问题 更多 >
编程相关推荐