Jon Stewart has a message for one of his favorite old targets, the media: Stop whining.

The former host of "The Daily Show" stopped by CBS' "The Late Show with Stephen Colbert" on Monday night to deliver an almost 10-minute rant about President Trump and his contentious relationship with the press.

That includes Trump's staff blocking CNN, The New York Times, Politico and other news outlets from an off-camera White House briefing on Friday.

"So you agree with me that Trump banning any members of the press is un-American?" Colbert asked Stewart.

"You know what I say? I say stop your whining, press," Stewart declared. "Hey, media, so I heard Donald Trump broke up with you. Stings a little, doesn't it? ... Well, good riddance, I say! Kick him to the curb."

Like he used to on "The Daily Show," Stewart then looked directly into the camera.

"It is time for you to get your groove back, media," he said. "Because, let's face facts, you kind of let yourself go a little bit for these past few years. Put on a few pundits."

The comedian went on to say that the media has been obsessed with Trump.

Related: Jon Stewart on Trump: 'We have never faced this before'

"Obsessing, 24 hours a day, seven days a week, about this one guy. 'What's Donny up to? Did he say anything about us? You think he's gonna come on our show? Do you think he even likes us?" Stewart said. "He doesn't even have to come on. He can just call us! Oh, Donny, please, just let us know you're OK!'"

Stewart wrapped up by telling the media exactly what it should do.

"This breakup with Donald Trump has given you, the media, an amazing opportunity for self-reflection and improvement," he said. "Instead of worrying about whether Trump is un-American, or if he thinks you're the enemy, or if he's being mean to you, or if he's going to let you go back into the briefings, do something for yourself. Self-improvement! Take up a hobby. I recommend journalism."

Monday night was Stewart's second appearance on the show since Trump took office. "The Late Show" will air live Tuesday night following President Trump's address to Congress.