Support » Plugin: Video Thumbnails » [Plugin: Video Thumbnails] DailyMotion not Working

  • Resolved Gee



    Thanks, for this great plugin!

    For those of you who have issue with DailyMotion not fetching the thumbnail. I found that their API use SSL and this plugin use CURL but, in some servers, need a parameter to ignore a certificate check.

    So, there is a quick & dirty fix:

    open the plugin file video-thumbnails.php
    locate the definition of the function “getDailyMotionThumbnail”,
    add the following curl option between others:
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    So now, it looks like that:

    // Get DailyMotion Thumbnail
    function getDailyMotionThumbnail($id) {
        if (!function_exists('curl_init')) {
        	return null;
        } else {
    		$ch = curl_init();
    		curl_setopt($ch, CURLOPT_URL, "$id?fields=thumbnail_url");
    		curl_setopt($ch, CURLOPT_HEADER, 0);
    		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    	        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    		curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    		$output = curl_exec($ch);
    		$output = json_decode($output);
    		$output = $output->thumbnail_url;
    		return $output;

    I hope this can help somebody and the author will take this in consideration on his next updates.


Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Video Thumbnails] DailyMotion not Working’ is closed to new replies.