Boko Haram posted a video showing two men who were beheaded after they were accused of spying on the Nigerian Islamist militants.