In her first-place primary run for state Senate in June, San Francisco Supervisor Jane Kim was said to benefit from a “Bernie bump” — an endorsement from presidential candidate Sen. Bernie Sanders.

Now Kim’s opponent in the Nov. 8 election, Supervisor Scott Wiener, is hoping for a “Perry push.” But there’s something standing in the way: Call it a Sony setback.

Last week, Wiener released a campaign musical video set to the tune of Katy Perry’s “Firework.” In it, three local drag queen performers — Carnie Asada, Au Jus and Miz Palou — energetically dance and lip-sync lyrics praising Wiener in various San Francisco locales. (Sample lyric: “Scott represents us all-all-all, our voice in Sacramento-oh-oh.”)

In other words, just another day in San Francisco politics.

At least that’s how it seemed until Friday, when Susan Arnold, vice president of the commercial music group for Sony/ATV, sent a letter to Wiener claiming he was guilty of “unlicensed copyright exploitation.” The letter gave his campaign three business days to take the video down, or “we shall be forced to proceed with legal action.”

Ben Depoorter, a professor at UC Hastings College of the Law who is an expert in copyright law, says this is typical of entertainment companies that worry about alienating potential buyers by having their performers associated with politics. Exhibit A is the country group the Dixie Chicks, who criticized then-President George W. Bush on stage in 2003 and faced a backlash that nearly ended their careers.

Borrowing Perry’s song makes it look like “a political endorsement, and a lot of music companies are worried about that,” Depoorter said. “When it comes to politics, record labels like to have their artists be Switzerland.”

Depoorter said Wiener has some options. He noted that some politicians — Donald Trump comes to mind — play music at their rallies even though the artists and their record companies object, and the pols have every right to do so as long as the venue has a public performance license.

However, Depoorter said, “syncing to video is a whole different ballgame.” To do that, he said, you have to ask permission — “that’s a very clear copyright rule.”

Another option for Wiener, said the law professor, is to claim the right of “fair use.” That lets someone use copyrighted material without permission, but only within certain legal guidelines.

Wiener would have to take the issue to court, however, so “a final decision would certainly be years away,” Depoorter said.

With the election one month from now, that’s not going to work. So Wiener has unleashed one of the most potent forces in city politics — drag queens.

“Don’t mess with drag queens,” Wiener said. “It’s rule No. 1.”

The three performers in his video — which Wiener planned to take down Wednesday, barring a reprieve — have attempted to reach out to Perry. In a letter to the pop star, they wrote, “Scott is a champion of LGBT rights, as are you ... and we want to keep this running to bring positive, fun energy to a campaign season filled with Trumpism.”

It’s not a complete shot in the dark. Wiener says Perry has already been politically active.

“She’s all in for Hillary (Clinton) and Kamala Harris,” he said. “She’s a great sport and has a sense of humor. She’s awesome.”

Meanwhile, Kim’s campaign director, Eric Jaye, is completely on message, using the Perry flap to hit Wiener for alleged renter abuses and campaign donations.

“There’s nothing cool or hip about using Republican money to overturn rent control,” he said. “You can steal any soundtrack you want; it doesn’t overturn that record.”

Granted, even if Perry agreed with the drag queens, it probably wouldn’t solve the copyright infringement.

“We know she’s not the only copyright holder,” Wiener said. “But it is her song. I’m working every connection I have.”

And Wiener didn’t pick a Perry song at random.

“I love, love, love Katy Perry,” he said. He even went to a Perry show in Las Vegas. “I’m a huge fan.”

What he’d like, of course, is for Perry to say something about his campaign and the video, even if Sony/ATV still stood in the way of putting it back online. After all, in some ways the video spot has already served its purpose.

“Even if it is taken down, they’ve already received a lot of attention,” Depoorter said. “You don’t want to get a letter like that, but as far as publicity, they’ve hit the jackpot.”

Which is also how Kim supporter Supervisor Aaron Peskin sees it.

“My question,” Peskin said, “is did Scott write to Sony and ask them to file a cease-and-desist letter so he’d get more publicity?”

C.W. Nevius is a San Francisco Chronicle columnist. His columns appear Tuesday, Thursday and Saturday. Email: cwnevius@sfchronicle.com Twitter: @cwnevius