WordPress Image Attachment using remote image

You’ll want to get very familiar with wp_insert_attachment(), download_url() and media_handle_sideload(). It’s a bit lengthy to get into the details here, but it absolutely can be done. I used these methods to create a media tab that allows a user to put in a vimeo/youtube URL which I store in a postmeta and use their (vimeo/youtube) automatic thumbnail endpoints to attach an image to the post representing the video.