"Angelique and the Sultan", part of the Angélique historical novel series by Anne and Serge Golon and later made into a film, has the theme of a 17th Century French noblewoman captured by pirates and taken into the harem of the King of Morocco.