WordPress.org

Ready to get started?Download WordPress

Forums

Video Thumbnails
[resolved] DailyMotion not Working (4 posts)

  1. Gee
    Member
    Posted 3 years ago #

    Hi,

    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, "https://api.dailymotion.com/video/$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);
    		curl_close($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.

    Thanks

    http://wordpress.org/extend/plugins/video-thumbnails/

  2. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for pointing this out, I thought I had included this same fix originally but it must have slipped by. I'll fix this in the next version.

    Thanks again

  3. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    Just released version 1.7.4 which includes this fix

  4. manchumahara
    Member
    Posted 3 years ago #

    Here I got a more easy way http://retrohelix.com/2010/06/youtube-and-dailymotions-thumbnails/ though may be will need to resize the thumb as needed.

    thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic