citcit / autoembed

Automatically exported from code.google.com/p/autoembed
GNU Lesser General Public License v3.0
0 stars 0 forks source link

New youtube short url on share #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The url like: http://youtu.be/VIDEO_ID doesn't resolve
2. Is the current url type that youtube share by default

What is the expected output? What do you see instead?
The pattern for youtube videos must resolve this url type

What version of the product are you using? On what operating system?
1.8 (Mac OSX Snow Leopard)

I suggest the current pattern to solve the problem:

    'url-match' => 'http://(?:video\.google\.(?:com|com\.au|co\.uk|de|es|fr|it|nl|pl|ca|cn)/(?:[^"]*?))?(?:(?:www|au|br|ca|es|fr|de|hk|ie|in|il|it|jp|kr|mx|nl|nz|pl|ru|tw|uk)\.)?(?:youtube\.com|youtu\.be)(?:[^"]*?)?(?:&|&|/|\?|;|\%3F|\%2F)(?:video_id=|v(?:/|=|\%3D|\%2F))?([0-9a-z-_]{11})',

Original issue reported on code.google.com by muser83@gmail.com on 25 Aug 2011 at 7:28

GoogleCodeExporter commented 8 years ago
You can use the following stub.

    array(
        'title' => 'Youtube',
        'website' => 'http://www.youtu.be',
        'url-match' => 'http://(?:www\.)?youtu\.be/(.*)',
        'embed-src' => 'http://www.youtube.com/v/$2&rel=0&fs=1&hd=1',
        'image-src' => 'http://img.youtube.com/vi/$2/0.jpg',
        'iframe-player' => 'http://www.youtube.com/embed/$2',
        'embed-width' => '480',
        'embed-height' => '315',
    ),

James.

Original comment by james.po...@yourhomely.co.uk on 21 Apr 2012 at 1:02