A drunk pervert with a string of convictions for indecent exposure was caught on camera performing a solo sex act outside Wakefield Cathedral.
Leeds Crown Court heard 47-year-old Mohammed Yaseen was captured on CCTV urinating against the cathedral on Northgate in Wakefield city centre just before 11.30pm on August 31.
Richard Canning, prosecuting, said Yaseen then started to perform a solo sex act in full view of three members of the public.
Mr Canning said police attended and arrested Yaseen, who admitted outraging public decency.
Judge Simon Phillips QC jailed Yaseen for 16 months.
The court heard Yaseen, of Eskdale Road, Wakefield, has 25 previous convictions for 46 offences..
Mr Canning said: "The vast majority are almost identical offending to matters before the court today."
Mr Canning said Yaseen has 14 different convictions for exposure over the 12-year period between 2006 and 2018 and has served a number of prison sentences.
Yaseen, who was not legally represented, told the court via video link from HMP Leeds: "I want to apologise. If you give me one more chance, please. I will address my drinking problem.
"My drinking problem has put me in prison. My life will be wasted if I go back in prison again. I need help."
Jailing Yaseen for 16-months, Judge Phillips told him: "There were some three members of the public in the near vicinity at the time.
"It must have caused shock and distress for anyone who had the misfortune to observe what you were doing.
"Police officers arrested you. You were in drink at the time."
Judge Phillips said Yaseen's first conviction for indecent exposure was in 2004, adding: "Since that time you have regularly been before the courts almost on an annual basis for offences of exposure or outraging public decency.
"Offending of this nature is a nuisance in terms of society at large.
"Your actions could be considered by anyone with the misfortune of viewing them as being both shocking and distressing.
"You have indicated you need help and you wish to address your drink problem.
"You have only yourself to blame it seems to me for the situation you have found yourself in."