$provider = $videoRow->img_minor_mime; $apiWrapperName = ucfirst( $videoRow->img_minor_mime ) . 'ApiWrapper'; $videoId = $metadata['videoId']; $result = null; $status = "fail"; echo "reuploading: [from:".$provider." videoId:$videoId] - ".$videoRow->img_name."\n"; echo "title: " . $title . "\n"; try { $oUploader = new VideoFileUploader(); $oUploader->setProvider( $provider ); $oUploader->setVideoId( $videoId ); $oUploader->setDescription( null ); $oUploader->setTargetTitle( $title ); $oUploader->hideAction(); $oUploader->upload( $title ); } catch( Exception $e ) { echo ("ERROR FETCHING DATA: [{$videoRow->img_minor_mime}]". $videoRow->img_name . "\n"); echo $e->getMessage() ."\n"; } echo("========================================== \n"); } echo "Done\n"; } $dbw->freeResult($rows);