Hello everyone ,
Since three days impossible to download my videos dailymotion from my drupal administration space via URL of the VIDEOS and Thumbnail Pictures Previews that I recover from dailymotion
Please tell me the worry
I look forward to hearing from you

Comments

EJAN511 created an issue. See original summary.

marvil07’s picture

Thanks for the report!

Do you see any error on the drupal log? e.g. at /admin/reports/status

EJAN511’s picture

Hello everyone ,

After several searches on the net, I just found the solution via this links :
How To Get Thumbnail From YouTube, Vimeo And Dailymotion Videos

EJAN511’s picture

Issue summary: View changes
EJAN511’s picture

hello,

I MAKE MY MODIFY ON THIS THIS FUNCTION BUT The error of display of the miniature remains possible
Be forgiving

class MediaDailymotionStreamWrapper extends MediaReadOnlyStreamWrapper {

public function getOriginalThumbnailPath() {
    $parameters = $this->get_parameters();
    $result = file_get_contents('https://api.dailymotion.com/video/'. check_plain($parameters['video_id']) . '?fields=thumbnail_360_url');

   /* if (isset($result->error)) {
      return FALSE;
    }*/

    $data = drupal_json_decode($result->data);
    return $data['thumbnail_360_url'];
    
  }
}

The code of the initial function module was

  public function getOriginalThumbnailPath() {
    $parameters = $this->get_parameters();
    $result = drupal_http_request('https://api.dailymotion.com/video/'. check_plain($parameters['video_id']) . '?fields=thumbnail_url');
    if (isset($result->error)) {
      return FALSE;
    }
    $data = drupal_json_decode($result->data);
    return $data['thumbnail_url'];
  }

And the php function that I use to make changes


function getDailymotionThumb($id) { 

    $thumbnail_medium_url='https://api.dailymotion.com/video/'.$id.'?fields=thumbnail_medium_url'; //pass thumbnail_large_url, thumbnail_small_url for different sizes 
    $json_thumbnail = file_get_contents($thumbnail_medium_url);  
    $arr_dailymotion = json_decode($json_thumbnail, TRUE); 
    $thumb=$arr_dailymotion['thumbnail_medium_url'];  
    echo $thumb;     
 
}  
getDailymotionThumb('VIDEO_ID'); 

marvil07’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

I tried to reproduce this locally with latest versions of both file_entity and media, and I could not reproduce it.

Please try with latest version of those modules, and provide the versions you are using.

marvil07’s picture

Also, not sure how you used the link you mentioned, please provide details.

This module is already using the same idea and API endpoint, the only difference I see is th use of fields=thumbnail_medium_url instead of fields=thumbnail_url, see MediaDailymotionStreamWrapper::getOriginalThumbnailPath().

avpaderno’s picture

Version: 7.x-1.1 » 7.x-1.2
Status: Postponed (maintainer needs more info) » Active
Issue tags: -dailymotion, -media, -drupal videos
marvil07’s picture

Status: Active » Postponed (maintainer needs more info)

@kiamlaluno I am marking it again as needs more information, please feel free to re-open if there is more information provided.

avpaderno’s picture

I apologize: The change of status was unintentional. I was first thinking of closing the issue since it hasn't received any reply in the past three years, but I then changed idea. I didn't notice the status was not the previous one.

avpaderno’s picture

I also re-published some of the comments, which were probably caught by our anti-spam system (which is prone to false positives, in some cases).