Police seized a stun gun from a flat after receiving a tip-off that the man who lived there had been accessing child porn.
Officers discovered the weapon after receiving intelligence that illegal images had been obtained from an internet address linked to the property at Cottingley Heights in Cottingley.
Leeds Crown Court heard police arrested Richard De’andrade on October 30, 2014, after finding the stun gun on a shelf inside the flat.
Computers and other equipment were seized but De’andrade denied that they contained any illegal material.
The property was analysed and found to contain 168 illegal images and movies.
Three images and four movies were at category A - the most serious level of offending. Many of the images featured the sexual abuse of boys aged between eight and 15 years old. De’andrade pleaded guilty to possession of a prohibited weapon and 11 offences of making indecent images of a child.
Michael Collins, mitigating, said his client had not been in trouble in the two years since his arrest. He added that De’andrade was willing to work with the service probation to address his offending behaviour if he was not sent immediately to custody.
De’andrade was given a 12 month prison sentence, suspended for two years, and ordered to take part in a 30-day activity requirement.
He was also told he must go on the sex offenders register for 10 years.
Judge Neil Clark said: “Anyone who even takes the risk of downloading this material compounds to misery (children) suffer.”