Built a parse_url function for parsing media urls