Your challenge is to get a European power to take influence of at least one of the Barbary States away from the Ottoman power and into its sphere of influence. Bonus points of Egypt.
(A side effect is the popularity of stage shows all over Europe featuring young women claiming to have been freed from the lustful Arab. Usually starting with a primly-dressed young schoolgirl or bride-to-be who defies her parents to seek adventure/join her future husband, it proceeds through her capture at sea, being stripped (suitably discreetly) and put on the auction block with her wailing companions; her display in more and more diaphanous “Arab” costumes, being forced to perform erotic “Oriental” dances for her master; her resistance to his advances, a nicely sadistic interlude in the dungeons with whips and chains, followed by…a veil drawn over her Fate Worse Than Death- then on to the rescue (by Danes or Swedes in the British versions), and her restoration, covered in shame, to her parents (or a convent in Catholic countries.) After an evening of titillation, a suitably moral climax follows, with the young woman, now modestly dressed, hanging her head in shame and giving a lecture to other young women about the dangers of disobedience to parental authority. The women involved are usually actresses/prostitutes who have been no closer to the Barbary Coast than their audiences; a sideline employment is provided for some Black Loyalists in Britain in playing the part of cruel African eunuchs.)