sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[livejournal] r19388: LJSUP-8992: Youtube object embed parsing...

Committer: vtroitsky
LJSUP-8992: Youtube object embed parsing added and mail.ru object embed parsing added.
U   trunk/cgi-bin/LJ/EmbedModule.pm
Modified: trunk/cgi-bin/LJ/EmbedModule.pm
===================================================================
--- trunk/cgi-bin/LJ/EmbedModule.pm	2011-06-28 08:34:31 UTC (rev 19387)
+++ trunk/cgi-bin/LJ/EmbedModule.pm	2011-06-28 08:52:20 UTC (rev 19388)
@@ -131,8 +131,8 @@
         my $out=  '<lj-embed id="'. $attrs{id} .'" ';
 
         # LJSUP-8992
-        if ($code =~ m!src=["']?http://www\.youtube\.com/embed/([\w\d\_\-]+)['"]?!) {
-            $out .= 'vid="'.$1.'" source="youtube" ';
+        if ($code =~ m!src=["']?http://www\.youtube\.com/(v|embed)/([\w\d\_\-]+)['"]?!) {
+            $out .= 'vid="'.$2.'" source="youtube" ';
         } elsif ($code =~ m!src=["']?http://player\.vimeo\.com/video/(\d+)[?'"]?! || 
                  $code =~ m!=["']?http://vimeo\.com/moogaloop\.swf\?[\d\w\_\-\&\;\=]*clip_id=(\d+)[&'"]?! ) {
             $out .= 'vid="'.$1.'" source="vimeo" ';
@@ -140,7 +140,7 @@
             $out .= 'vid="'.$1.'" source="rutube" ';
         } elsif ($code =~ m!=["']?http://static\.video\.yandex\.ru/([\d\w\/\-\_\.]+)['"]?!) {
             $out .= 'vid="'.$1.'" source="yandex" '; 
-        } elsif ($code =~ m!http://img\.mail\.ru.+value=["']?movieSrc=([\w\d\/\_\-\.]+)["']?!) {
+        } elsif ($code =~ m!http://img\.mail\.ru.+movieSrc=([\w\d\/\_\-\.]+)["']?!) {
             $out .= 'vid="'.$1.'" source="mail.ru" ';
         }
 

Tags: livejournal, pm, sunnyman
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments