Content migrate fails when YouTube video not valid

Created on 8 May 2012, about 13 years ago
Updated 16 May 2025, 3 days ago

When performing a CCK content_migrate, the valid_id() test of MediaInternetYouTubeHandler object returns false when it encounters an invalid YouTube id. This behavior was likely designed for the UI but during a batch update it stops the migration with a fatal error.

This is what I'm using to get around it:

public function valid_id($id) {
    $url = 'http://gdata.youtube.com/feeds/api/videos/'. $id;
    $response = drupal_http_request($url, array('method' => 'HEAD'));
    if ($response->code != 200) {
      watchdog('video field', "The following YouYube video is invalid: " . $id);
      return TRUE;
//      throw new MediaInternetValidationException(t('The YouTube video ID is invalid or the video was deleted.'));
    }
πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Embedded Video Field

Created by

πŸ‡ΊπŸ‡ΈUnited States aangel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024