Skip to content

Embedly client fails on certain URLs with KeyError #24

@lsemel

Description

@lsemel

This happens with the latest version of the client 0.5.0

from embedly import Embedly
from django.conf import settings
client = Embedly(settings.EMBEDLY_EXTRACT_KEY)
url = u'http://aldianews.com/articles/politics/cost-story-—-interactive-storymap-about-conflict-journalism/36116'
thumbnail_max_width=320
words=100
embedly_obj = client.extract(url, maxwidth=thumbnail_max_width, words=words)

The resulting error is:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/lsemel/www/virtualenvs/muckrack/src/embedly/embedly/client.py", line 169, in extract
    return self._get(1, 'extract', url_or_urls, **kwargs)
  File "/Users/lsemel/www/virtualenvs/muckrack/src/embedly/embedly/client.py", line 121, in _get
    query += '&url=%s' % quote(url_or_urls)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1282, in quote
    return ''.join(map(quoter, s))
KeyError: u'\u2014'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions