Things looked bleak for Buddy.

The Philly street cat was the victim of a brutal attack a month ago. Captured on video, it was shocking even by this tough town’s standards. The odds of him making it weren’t good.

Flash-forward: Buddy was watching the 76ers trounce the Raptors in the NBA playoffs on a cozy couch with a new kitty friend and two human fosters who adore him. He had toys galore, all the catnip he wanted, and a social media following hanging on his every meow.

And thanks to this little black cat who almost lost his life, other injured animals will have a better chance to live theirs.

Don’t believe in fairy tales? Here’s Buddy’s story.

It started on a porch in East Frankford. Buddy was what animal welfare folks call a community cat. People would put out food and water for him, but he was a rambling man. He seemed to prefer the outdoor life.

But on that day, two boys with two dogs walked by. They can be seen on a home-security video returning shortly afterward and letting the dogs loose on Buddy, who was on the porch. A man eventually came out of the house and rescued the cat.

Two boys, age 12 and 17, were arrested a few days later as juveniles on animal cruelty charges, which are still pending. The dogs, which belong to a family member of one of the boys, remain in Pennsylvania SPCA (PSPCA) custody.

Badly mauled, Buddy was brought to the PSPCA for treatment but transferred to the BluePearl emergency veterinary facility for more intensive care. He was unresponsive, in shock, and bleeding internally. His heart rate was almost twice what it should have been. His caretakers thought he might die.

But no one was giving up. That included Buddy.

Word of the incident spread. Reaction went viral.

The PSPCA was flooded with inquiries about Buddy. Then came the donations — toys, cat treats, and money to help. People were pulling for the little black cat — not just from the Philadelphia area or even the United States, but as far away as Europe, Asia, and Australia.

And sure enough, Buddy started to pull through.

“This is the biggest outpouring of support we have had for a single animal in the last decade,” said PSPCA spokeswoman Gillian Kocher. “There is nothing that comes close to it.”

Buddy could live out all his nine lives and barely make a dent in what’s been sent to him. So the spokeswoman said the PSPCA’s other felines are getting to enjoy his surfeit of toys and treats.

The PSPCA also received over $100,000 for Buddy — far more than the cost of his care.

So the PSPCA has created the Buddy Fund to help other abused or neglected animals, like Elsa, a sweet-tempered, white-and-gray stray who will receive eye surgeries and hopefully find a good home.

PSPCA is capitalizing on all the Buddy love to raise funds and adoption awareness for animals in need by selling T-shirts and stickers with the logo “Save Every Buddy.”

“It’s crazy to think about how this one cat has impacted so many animals and touched so many lives across not just Philadelphia and the country, but the globe,” said Kocher.

For the past couple weeks, Buddy’s been living in the feline lap of luxury with his two doting fosters, Katie Venanzi and her husband, David, in their South Philly home.

Venanzi was the Blue Pearl emergency veterinarian who worked on the critically wounded cat when he was brought to her facility from the PSPCA.

Venanzi sees lots of animals in her work, but there was something special about Buddy even from the beginning. He reminded her of Chloe, her own cat she’d lost to cancer a few months before. Like Chloe, Buddy was full of spunk, even as sick as he was.

“He was barely responsive that night he came in, but if you moved him the wrong way, he would growl at you.” the vet said. “That was how we knew, ‘Oh, he’s going to be OK.’ ”

Still in mourning for her late Chloe, Venanzi hadn’t been looking for a new addition to their household. But her husband suggested she might want to foster her special patient.

So a week later, Buddy moved in. The couple gave their new houseguest his space. Maybe he wouldn’t like living indoors, Venanzi worried. Maybe he wouldn’t like living with people.

That’s not how it’s worked out.

“He’s so, so, so loving,” Venanzi said.

Buddy started purring up a storm. He hit it off fine with Teddy, the Venanzis’ younger cat, and he quickly got the hang of batting around all the cat toys his many fans had sent him. And while he did enjoy looking out windows now and then, he didn’t seem all that interested in the great outdoors.

And although he has his own sleeping space in a spare room, the former alley cat seems to have discovered that bedding down with humans clearly has its charms.

His doctor, meanwhile, found her own broken heart mending a bit quicker than expected.

“We want to see how he does this week, but if he still seems really happy, then I think we’ll talk to the SPCA about formally adopting him,” she said. “We love him so much. He really is that special.”

Lots of other people think so, too.

At the PSPCA, there’s a whole bulletin board — Buddy’s Board — filled with the greatest hits of cards, notes, and super cute drawings from little kids sent to the feline rock star.

Indeed, if the folks at the PSPCA go more than a day or two without posting an update, his social media followers start clamoring for their Buddy fix.

“Everyone is very invested in this cat,” Kocher said. “It’s unlike anything I’ve ever seen before. I could post his left ear, and people would go crazy about it.”

A recent video of Buddy playing with a cat toy — that’s all he’s doing — got over 16,000 views and almost 2,000 likes in just the first day. It’s one of many like it, but people have yet to tire of Buddy’s comeback story. Still.

Actually, they seem outright inspired.

“This amazing little man blows me away,” one fan tweeted. “What a survivor!”

“Buddy always makes my day,” posted another.

“My heart sings when I see you doing this well,” tweeted one woman.

And from this bromancer: “I love you, little dude.”

Of course, there are lots of animal aficionados out there. But there is something a little different about the way people have responded to Buddy’s story.

“I think everyone these days is looking for some hope to cling to, and Buddy gave it to people. He’s still giving it to people,” Kocher said. “Out of something pretty horrible can come so much good. Despite bad things happening, there is still so much good in the world.”