David Masters was caught with the haul of covert pictures and videos, along with thousands of sickening abuse images he had downloaded online.
Police had raided his home after receiving intelligence that his computer IP address had been used to upload child abuse images on an encrypted messaging platform.
When the former IT professional's devices were examined, police found his sickening collection.
Judge Stephen Earl said Masters was a "sexually predatory male obtaining sexual gratification in the shadows".
Judge Earl added: "Thousands of images of schoolgirls were recovered from the devices and it became apparent those photographs were taken from his home address, specifically from upstairs windows, looking out onto the surrounding streets."
Judge Earl sentenced Masters to three years and ten months behind bars.
Masters must sign the sex offenders register and abide by a sexual harm prevention order for life.
The court heard Masters was engaged when his home was raided and his devices were seized in 2017.
He admitted all of the illegal material that was found was his.
Police also found pictures of a woman in various states of undress and three images and one video of a naked girl.
The court heard there were more than 17,000 indecent pictures and videos of children on his devices - 519 of the most serious, category A type, 464 category B and 16,615 category C.
He also had 92 extreme pornography images, which featured animals. In total the length of all the illegal videos was 29 hours and 59 minutes.
Masters told police he had used a social media platform to engage with others when drunk and received indecent images.
Prosecutor Jane Foley said: "He said he was more interested in the clothing worn by teenagers rather than sexual content."
Masters, 43, of Moorfield Gardens, Cleadon, pleaded guilty to voyeurism, taking indecent images of children, three counts of making indecent images and possession of extreme pornography.
Vic Laffey, defending, said Masters has sought help from specialist charity the Lucy Faithful Foundation.
He added: "There's an acknowledgement on his part of the harmful impact of the offending he has been involved in.”