pip install micawber
python
import micawber
python
patterns = micawber.DEFAULT_PROVIDERS + [
micawber.Provider('http://www.yourdomain.com/video/*',
endpoint='http://www.yourdomain.com/oembed/{format}'),
micawber.Provider('http://www.yourdomain.com/audio/*',
endpoint='http://www.yourdomain.com/oembed/{format}'),
]
providers = micawber.bootstrap_basic(embedly_endpoint='http://your.embedly.com/endpoint',
parsers=patterns)
python
text = """
"""
providers.register('http://www.yourdomain.com/video/*', micawber.parse_html)
providers.register('http://www.yourdomain.com/audio/*', micawber.parse_html)
rich_media = micawber.parse_html(text)
for media in rich_media:
print("URL:", media['url'])