We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling the SoundCloud endpoint with minimal parameters returns a width="100%" in the response. For example http://soundcloud.com/oembed?url=http://soundcloud.com/ghing/the-calling-for-diychi-comp&format=json produces this response:
{ "version": 1, "type": "rich", "provider_name": "SoundCloud", "provider_url": "http://soundcloud.com", "height": 166, "width": "100%", "title": "The Calling (for DIYCHI comp) by ghing", "description": "Finished version of \"The Calling\" for the DIY CHI comp", "html": "<iframe width=\"100%\" height=\"166\" scrolling=\"no\" frameborder=\"no\" src=\"http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F27467434&show_artwork=true\"></iframe>" }
I'm not sure whether or not this adheres to the oEmbed spec, but it's a popular service, so it should be handled.
The problem is in these lines in OEmbedResource.create():
data['width'] = data.get('width') and int(data['width']) or None data['height'] = data.get('height') and int(data['height']) or None
the call to int(data['width']) raises a ValueError because of the '%' in data['width']
A simple workaround would be to wrap those lines in a try/except like this:
try: data['width'] = data.get('width') and int(data['width']) or None except ValueError: data['width'] = None try: data['height'] = data.get('height') and int(data['height']) or None except ValueError: data['height'] = None
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Calling the SoundCloud endpoint with minimal parameters returns a width="100%" in the response. For example http://soundcloud.com/oembed?url=http://soundcloud.com/ghing/the-calling-for-diychi-comp&format=json produces this response:
I'm not sure whether or not this adheres to the oEmbed spec, but it's a popular service, so it should be handled.
The problem is in these lines in OEmbedResource.create():
the call to int(data['width']) raises a ValueError because of the '%' in data['width']
A simple workaround would be to wrap those lines in a try/except like this:
The text was updated successfully, but these errors were encountered: