MICHAEL DOUGLAS snubs SCOTT THORSON, terminally ill for­mer lover of piano legend LIBERACE – even though he’s starring in a movie based on a book written by the dying man!

Thorson, who was diag­nosed with advanced anal cancer in August, was Liberace’s lover from 1976 to 1982. His book, “Be­hind the Candelabra: My Life with Liberace,” is the ba­sis of an upcoming HBO film that stars Douglas as the flam­boyant performer.

But even though the “Wall Street” ac­tor is a fellow cancer sufferer, sources say he rebuffed Thor­son’s request to visit him on the set.

All I wanted do was was meet Michael and talk to him about my cancer,” Thor­son, 54, explained to The ENQUIRER. “But I was bluntly told it would be im­possible. That really hurt.”

Thorson’s six-year ro­mance with Liberace be­gan when he was just 18 and the entertainer was 57. Thorson says he was showered with lavish gifts, expensive vacations and promises by Liberace to adopt and care for him.

But the relationship end­ed in 1982, when Thorson says he was dumped for a teenager.

Although “Behind the Candelabra” was published in 1988, a year after Liberace died of AIDS, Thorson says he didn’t find out until 2008 that pro­ducer Jerry Weintraub wanted to make a movie out of the book.

At the time, Thorson was serving time behind bars on a drug-related robbery and desper­ately needed money. He admits he got “a little up-front money and a small percentage” of the film sales.

While Thorson did his time, Weintraub assembled his team: Douglas as Liberace, Matt Da­mon as Thorson and director Steven Soderbergh.

In August 2010, Douglas was diagnosed with Stage 4 throat cancer and the movie was put on hold. Thankfully, Douglas beat the  cancer, and production began in the summer of 2012 in Los Ange­les, Las Vegas and Palm Springs. But Thorson says he was left out in the cold.

“I thought it was very strange that I was never contacted,” he said. “Then, about three months ago, I got one phone call from Jerry Weintraub when he found out that I had cancer. He said, ‘I’m very sorry that you’re going through cancer.’ And that was it.”

Thorson says he was immediate­ly cut off when he asked if he could reach out to both Douglas and Da­mon. He said the indication was that Douglas – whose son Cam­eron is also in jail on drug charges – didn’t want him on the set, even as a consultant.

“It was clear that I wasn’t wel­come,” he said. “My heart sank. These people were portraying me but I was a persona non grata. I’m angry.”

Thorson has undergone radia­tion and chemotherapy treatments, but the tumor remains, he says.

“Right now, I’m very scared,” Thorson admitted. “I’ve already run through the money I got for the movie and I’ve got nothing left.

“I don’t know if I’ll make it to the premiere in May…or if I’m even invited.”