Hi,
Every time I run my youtube migrate. It only does 50 to 250 videos out of 365 and keeps throwing the error for the others "Youtube Video ID does not exist or deleted". I have checked the youtube videos randomly. They are valid ids and sometimes it will migrate it and not others.

Is this some sort of timeout error or server request problem caused by the error that can be fixed? I don't know what to do to fix it.

Here is my migration:

class OutdoorsmanYoutubeMigration extends BasicExampleMigration {
  public function __construct() {
    parent::__construct();
    $this->description = t('Outdoorsman migration of Youtube videos');
    $this->dependencies = array('OutdoorsmanUser');
    $this->base_path = 'http://www.youtube.com/watch?v=';
    $this->map = new MigrateSQLMap($this->machineName,
      array('filename' => array(
                              'type' => 'varchar', 'length' => 255,
                              'not null' => TRUE,
                              'description' => 'Image filename.'
                      )),

      MigrateDestinationMedia::getKeySchema()
    );


    $query = db_select('videos', 'ov');
	    $query->fields('ov', array('user_id', 'video_type', 'filename', 'title', 'description', 'date_uploaded','link'))
	->condition('video_type', 'youtube');
	
    $this->source = new MigrateSourceSQL($query);

    // In this case, we need to specify the file_class in the second paramter -
    // this class understands how to translate a http://www.youtube.com/ URI
    // into Drupal's Youtube file scheme (youtube://).
    $this->destination = new MigrateDestinationMedia('video',
      'MigrateExtrasFileYoutube');

    // We just need to map the 'value' in the media destination to the Youtube
    // URI.
    $this->addFieldMapping('value', 'filename')->callbacks(array($this, 'add_path')); 
// add_path adds "http://www.youtube.com/v/" to the front of the video id name

    $this->addFieldMapping('field_video_description', 'description');
    $this->addFieldMapping('uid', 'user_id')
         ->sourceMigration('OutdoorsmanUser')
         ->defaultValue(13);

    $this->addUnmigratedDestinations(array('field_video_description:format',
      'field_video_description:language', 'timestamp'));
    if (module_exists('path')) {
      $this->addUnmigratedDestinations(array('path'));
    }
  }
}

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have media_oembed enabled? It seems to me the most likely issue would be networking glitches when trying to retrieve the title (line 118 of media.inc). Other than that, there's not much I can say from here, I haven't seen this myself, all I can suggest is debugging MigrateExtrasFileYoutube::processFile().

mikeryan’s picture

Issue summary: View changes

Add php tag to make code readable