the first time it was Harry(when he and Hermione used the time turner in Prisoner of Azkaban) and the সেকেন্ড time I believe it was Snape (when we see him talking with Dumbledore through the pensieve that Snape's patronus is the same as Lily Potter's
The Patronus which led Harry to where Gryffindor's sword was hidden had been cast দ্বারা Snape. Lily had a doe-formed Patronus, and Snape's Patronus had shifted to mimic hers because of his প্রণয় for her and his guilt over her death. Possibly Harry subconsciously recognised the form, which is why he trusted the Patronus and followed it. In one of Snape's memories, we later see him প্রদর্শিত হচ্ছে Dumbledore that his Patronus is still doe-formed as a way of proving that Lily is still his motivation.