Oil prices post largest weekly gain in 8 months