A former SNP council leader who preyed on young men and boys has been jailed for 18 months.