Skip to content

Commit

Permalink
Updated YouTube
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Dec 8, 2013
1 parent 811690c commit a10efdd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20131208" version_string="201312080" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<addon addon_id="s9e" title="s9e Media Pack" url="https://github.com/s9e/XenForoMediaBBCodes" version_id="20131208b" version_string="201312081" install_callback_class="s9e_MediaBBCodes" install_callback_method="install">
<bb_code_media_sites>
<site media_site_id="bandcamp" site_title="Bandcamp" site_url="http://bandcamp.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchBandcamp">
<match_urls>!(?'id')bandcamp\.com/album/.!
Expand Down Expand Up @@ -166,7 +166,7 @@
<embed_html><![CDATA[<object width="448" height="374" data="http://www.worldstarhiphop.com/videos/e/16711680/{$id}"><param name="allowfullscreen" value="true"/><embed type="application/x-shockwave-flash" src="http://www.worldstarhiphop.com/videos/e/16711680/{$id}" width="448" height="374" allowfullscreen=""/></object>]]></embed_html>
</site>
<site media_site_id="youtube" site_title="YouTube" site_url="http://www.youtube.com/" match_is_regex="1" supported="1" embed_html_callback_class="s9e_MediaBBCodes" embed_html_callback_method="embed" match_callback_class="s9e_MediaBBCodes" match_callback_method="matchYoutube">
<match_urls>!youtube\.com/(?:watch\?.*?v=|v/)(?'id'[-\w]+)!
<match_urls>!youtube\.com/(?:watch.*?v=|v/)(?'id'[-\w]+)!
!youtu\.be/(?'id'[-\w]+)!
!(?'id')youtu(?&gt;\.be|be\.com).*?[#&amp;?]t=(?'t'\d+)!
!(?'id')youtu(?&gt;\.be|be\.com).*?&amp;list=(?'list'[-\w]+)!</match_urls>
Expand Down
2 changes: 1 addition & 1 deletion build/upload/library/s9e/MediaBBCodes.php
Expand Up @@ -532,7 +532,7 @@ public static function renderYoutube($vars)

public static function matchYoutube($url)
{
$regexps = array('!youtube\\.com/(?:watch\\?.*?v=|v/)(?\'id\'[-\\w]+)!', '!youtu\\.be/(?\'id\'[-\\w]+)!', '!youtu(?>\\.be|be\\.com).*?[#&?]t=(?\'t\'\\d+)!', '!youtu(?>\\.be|be\\.com).*?&list=(?\'list\'[-\\w]+)!');
$regexps = array('!youtube\\.com/(?:watch.*?v=|v/)(?\'id\'[-\\w]+)!', '!youtu\\.be/(?\'id\'[-\\w]+)!', '!youtu(?>\\.be|be\\.com).*?[#&?]t=(?\'t\'\\d+)!', '!youtu(?>\\.be|be\\.com).*?&list=(?\'list\'[-\\w]+)!');
$scrapes = array();

return self::match($url, $regexps, $scrapes);
Expand Down
5 changes: 5 additions & 0 deletions tests/Test.php
Expand Up @@ -240,6 +240,11 @@ public function getMatchCallbackTests()
'http://www.youtube.com/watch?v=pC35x6iIPmo&list=PLOU2XLYxmsIIxJrlMIY5vYXAFcO5g83gA#t=123',
'id=pC35x6iIPmo;list=PLOU2XLYxmsIIxJrlMIY5vYXAFcO5g83gA;t=123'
),
array(
'youtube',
'http://www.youtube.com/watch_popup?v=qybUFnY7Y8w',
'qybUFnY7Y8w'
),
);
}

Expand Down

0 comments on commit a10efdd

Please sign in to comment.