coleifer / micawber

a small library for extracting rich content from urls
http://micawber.readthedocs.org/
MIT License
632 stars 91 forks source link

Added support for youtube urls that start with "youtu.be" #7

Closed mvdwaeter closed 11 years ago

mvdwaeter commented 12 years ago

Urls that started with youtu.be got an ProviderException. I loosened up the regex for the youtube Provider so that these urls are also recognized as youtube urls.

In the meanwhile users can work around it with this:

import micawber
from micawber.providers import Provider

url = 'http://youtu.be/VpmOTGungnA'
pr = micawber.bootstrap_basic()
pr.register('https?://(\S*.)?youtu(\.be/|be\.com/watch)\S*', Provider('http://www.youtube.com/oembed'))
metadata = pr.request(url)