Viddler appears to have recently made some changes to their site, and videos now have a format that looks like this:
http://www.viddler.com/v/76c1d314

These new links don't seem to work with the Media: Viddler module.

Comments

rs3876’s picture

Issue summary: View changes

It was not working for me also.
I tweaked into the viddler.inc. This does not seem a perfect fix but this is working.
Old format was "http://www.viddler.com/explore/embed/74f2ba7d/?f=1" and then New format is "http://www.viddler.com/v/74f2ba7d/?f=1", So removed explore from the url and replace embed with v if found.
Also on place of "http://lab.viddler.com/services/oembed" I used "http://www.viddler.com/oembed/" to get data using CURL.

-----------------
function emvideo_viddler_data($field, $item) {
// Initialize the data array.
$data = array();

// Mandatory parameters
$param_arr = array('type' => 'simple', 'format' => 'xml');

//$url = 'http://www.viddler.com/explore/' . $item['value'];

/*
New viddler api does not support the old URL
Old format - http://www.viddler.com/explore/embed/74f2ba7d/?f=1
New format - http://www.viddler.com/v/74f2ba7d/?f=1

So removed explore from the url and replace embed with v if found
*/
$prefix = "embed";
if (substr($item['value'], 0, strlen($prefix)) == $prefix) {
$item['value'] = substr($item['value'], strlen($prefix));
$item['value'] = "v".$item['value'];
}

// Make url after replace embed with v
$url = 'http://www.viddler.com/' . $item['value'];

// If embed code then get the src or the whole url
if (preg_match('/src="([^"]+)"/', $item['embed'], $matches)) {
$embedUrl = $matches[1];
}else{
$embedUrl = $item['embed'];
}

// Get the params of $embedUrl and add into url
// @ToDo This may not be an effective way of doing as
// ideally params should be coming from $item['value']]
if(preg_match_all('/([^?&=#]+)=([^&#]*)/',$embedUrl,$pm)){
$assoc_pm=array_combine( $pm[1], $pm[2]);
}

$arr_url = explode('?', $url);
$url = $arr_url[0];

// Keep in array if any param is already with URL
if(!empty($arr_url[1])){
$url_param = explode('&', $arr_url[1]);
foreach ($url_param as $chunk) {
$chunk = explode('=', $chunk);
$url_param_arr[$chunk[0]] = $chunk[1];
}
}

// Merge default param with any param that passed with embed code
if (!empty($assoc_pm) && array_key_exists('secret', $assoc_pm)) {
$param_arr = array_merge(array('secret' => $assoc_pm['secret']), $param_arr);
}
// Finally merged with url param
if (!empty($url_param_arr)) {
$param_arr = array_merge($url_param_arr, $param_arr);
}
//http://lab.viddler.com/services/oembed , this is not working with few urls
$data = emfield_request_xml('viddler', 'http://www.viddler.com/oembed/?url=' . urlencode($url), $param_arr, TRUE, FALSE, $item['value']);
$data['emvideo_viddler_version'] = EMVIDEO_VIDDLER_DATA_VERSION;
// No way found to get https url from Viddler so just replace http:// with https://.
// This should work for both secure and non secure web pages
$data['emvideo_viddler_thumbnail'] = $data['OEMBED']['THUMBNAIL_URL'][0];
$data['emvideo_viddler_embedurl'] = media_viddler_embedurl_from_data($data);
$data['emvideo_viddler_id'] =
media_viddler_id_from_embedurl($data['emvideo_viddler_embedurl']);

return $data;
}
------------------

One more change I had to do in emfield_request_xml() function of emfield.module and add the following condition just after build the url.
------------
if (!empty($encoded_params)) {
// Viddler already has "?" and does not like another "?"
if(strpos($url, '?') !== false){
$url .= '&'. implode('&', $encoded_params);
}
else{
$url .= '?'. implode('&', $encoded_params);
}
}
-----------