Changeset 93685 in spip-zone
- Timestamp:
- Dec 14, 2015, 2:59:34 PM (5 years ago)
- Location:
- _plugins_/oembed
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/oembed/inc/oembed_recuperer_url.php
r93009 r93685 8 8 if (!defined('_ECRIRE_INC_VERSION')) return; 9 9 10 11 function inc_oembed_recuperer_url($data_url,$url,$format){ 10 /** 11 * Recuperer une URL oembed, si possible via curl et IPv4 pour contourner le bug de Youtube sur les IPv6 12 * 13 * @param string $oembed_url 14 * @param string $url 15 * @param string $format 16 * @return bool|mixed|string 17 */ 18 function inc_oembed_recuperer_url($oembed_url,$url,$format){ 12 19 $data = false; 13 20 … … 15 22 // si possible via curl en IPv4 car youtube bug en IPv6 16 23 if (function_exists('curl_init')){ 17 spip_log('Requete oembed (curl) pour '.$url.' : '.$ data_url,'oembed.'._LOG_DEBUG);24 spip_log('Requete oembed (curl) pour '.$url.' : '.$oembed_url,'oembed.'._LOG_DEBUG); 18 25 $c = curl_init(); 19 26 curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 20 curl_setopt($c, CURLOPT_URL, $data_url); 27 curl_setopt($c, CURLOPT_URL, $oembed_url); 28 29 if (isset($GLOBALS['meta']["http_proxy"]) AND $GLOBALS['meta']["http_proxy"]){ 30 curl_setopt($c, CURLOPT_PROXY, $GLOBALS['meta']["http_proxy"]); 31 if (isset($GLOBALS['meta']["http_noproxy"])){ 32 curl_setopt($c, CURLOPT_NOPROXY, $GLOBALS['meta']["http_proxy"]); 33 } 34 } 35 21 36 // the real trick for Youtube : 22 37 // http://stackoverflow.com/questions/26089067/youtube-oembed-api-302-then-503-errors … … 27 42 } 28 43 else { 29 spip_log('Requete oembed (recuperer_page) pour '.$url.' : '.$ data_url,'oembed.'._LOG_DEBUG);44 spip_log('Requete oembed (recuperer_page) pour '.$url.' : '.$oembed_url,'oembed.'._LOG_DEBUG); 30 45 include_spip('inc/distant'); 31 $data = recuperer_page($ data_url);46 $data = recuperer_page($oembed_url); 32 47 } 33 48 … … 38 53 // TODO : format xml 39 54 //if ($format == 'xml') 40 // $cache[$ data_url] = false;55 // $cache[$oembed_url] = false; 41 56 } 42 57 -
_plugins_/oembed/paquet.xml
r93344 r93685 2 2 prefix="oembed" 3 3 categorie="multimedia" 4 version="1.5. 3"4 version="1.5.4" 5 5 etat="stable" 6 6 compatibilite="[3.0.0;3.1.*]"
Note: See TracChangeset
for help on using the changeset viewer.