How to create a media object from image URL programatically

any update on this?

Can I receive url and upload it as media file directly by specifying some property?
Or do I have to download the image first and then re upload it to media?