YouTube has agreed to pay $24.5 million to settle a lawsuit that President Trump brought against the company over the suspension of his account following the Capitol riots, a court filing showed.