The Doobie Brothers have played to countless crowds over the years, but one of their most memorable gigs got its start on Jan. 28, 1978, when the band tried to do a nice thing for some high school students and ended up being bootlegged by a kid wearing a trench coat and a beret.

We're talking, of course, about the Doobies' two-part appearance on the ABC sitcom What's Happening!!, in which viewers discover that the band just happened to graduate from the Watts high school the show's characters attended, and they decide to give a concert on campus -- but then the ever-bumbling Rerun (played by Fred Berry) ends up being strong-armed into secretly recording the gig.

The Doobies were far from the only musical act to put in an appearance on a prime-time series during the '70s (who can forget the time Davy Jones showed up on The Brady Bunch?), and no one tuned into these episodes for the acting; as you can see in the clips above and below, no one was working on an Emmy reel. But it's become a cult favorite over the years

Joking that it's "the thing we’ll always be remembered for, probably," Doobies co-founder Patrick Simmons recalled years later, "It was just a lot of fun. We got to know the people from the TV show and enjoyed the whole experience of a situation comedy."

The idea came from their publicist, David Gest, who later gained fame when he married Liza Minnelli. As Simmons told Yahoo!, "He was a great publicist. He was really good. He kind of made it up as we went along, but he had great ideas — how to stage events, interesting interviews for us, different things that we hadn’t really done before. That’s how we ended up on the show. That was his idea. So I give him credit in that regard.”

The two-episode arc, called "Doobie or Not Doobie," concludes with concert by the band in which Rerun's gigantic '70s portable tape recorder is exposed, setting in motion a scene in which, as Mental Floss put it, "The band, who are so upstanding they named themselves after an illegal drug, proceed to lecture the youngsters on morality and righteousness."

As evidenced by the unauthorized YouTube uploads of both parts embedded above and below, the show didn't come close to ending the scourge of bootlegging. But Simmons believes that their appearance had a more meaningful impact on society because America saw “a bunch of middle-class white guys doing a show with a mostly African-American cast." It also reflected the themes of one of their biggest hits.

"Our music is pretty pop, but it’s based in rhythm and blues, and it always has been," he said. "At the time, we had a song called ‘Takin’ It to the Streets,’ and I think [five-time Grammy winner Michael McDonald’s] intention with writing that song was a message that is as relevant today as it was then — that African-Americans have been getting a bum shake here in this country for a long time. In some ways it’s gotten better, but as we can tell from the social climate these days, there’s a perpetuation of racism that just blows my mind. I mean, I can’t even. I guess because of growing up in California with a multicultural population, I just never viewed other people with that kind of lens. My musical idols, more than half of them, were African-American, Hispanic. That was an absurd concept to me, that there was any difference whatsoever between people of color and white Americans.”

Making that attempt at crossing over also turned out to have a positive result for the band. “I think our audience broadened and we connected more with the African-American community, having those R&B and blues sounds in our music," he continued. "I think people were aware of our social viewpoint, that we really value all of a larger, multicultural social audience. So, doing that show for me was a joy in that regard — to be building what I thought was a bridge, at a time in television where those situation comedies were bridges between cultures."

And to this day, Simmons said that people still come up to him and quote the most famous line from the show, "Which Doobie you be?"