diff options
author | friendica <info@friendica.com> | 2014-01-20 01:29:41 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-20 01:29:41 -0800 |
commit | 1fa8546d467bcd541858967aaec33d8779e4df99 (patch) | |
tree | 1f402adaa49b4a080465463ade48c467ebb071b0 | |
parent | fdfea0a8e932bdb8d243c7b81bcdb9acefb28d4d (diff) | |
download | volse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.tar.gz volse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.tar.bz2 volse-hubzilla-1fa8546d467bcd541858967aaec33d8779e4df99.zip |
zidify audio/video links
-rwxr-xr-x | include/oembed.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/oembed.php b/include/oembed.php index 520b69892..6946ba4b8 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -26,7 +26,20 @@ function oembed_fetch_url($embedurl){ if(is_null($txt)){ $txt = ""; - if (!in_array($ext, $noexts)){ + if (in_array($ext, $noexts)) { + $m = @parse_url($embedurl); + $zrl = false; + if($m['host']) { + $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1", + dbesc($m['host']) + ); + if($r) + $zrl = true; + } + if($zrl) + $embedurl = zid($embedurl); + } + else { // try oembed autodiscovery $redirects = 0; @@ -57,12 +70,6 @@ function oembed_fetch_url($embedurl){ call_hooks('oembed_probe',$x); if(array_key_exists('embed',$x)) $txt = $x['embed']; - - // try oohembed service -// $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=' . $a->videowidth; -// $result = z_fetch_url($ourl); -// if($result['success']) -// $txt = $result['body']; } $txt=trim($txt); |