Creating media_bundle entities programatically
use Drupal\media_entity\Entity\Media;

$image_data = file_get_contents("URL OF FILE");
$file_image = file_save_data($image_data, 'public://FILENAME', FILE_EXISTS_REPLACE);
$media_image = Media::create([
  'bundle' =&gt; 'image',(YOUR BUNDLE)
  'name' =&gt; "FILENAME",
  'field_image' =&gt; [
    'target_id' =&gt; $file_image-&gt;id(),
  ],
]);
$media_image-&gt;save();


Try this one, maybe this will help.