DirecTV customers get back Comedy Central, Nickelodeon and MTV after the two corporations make an undisclosed deal

Media giant Viacom has restored Jersey Shore, Spongebob Squarepants and comedian Jon Stewart to 20m viewers cut off earlier this month after a dispute over fees.

The media firm said Friday it had settled the acrimonious dispute with satellite TV firm DirecTV that had led to the loss of 17 Viacom channels for DirectTV subscribers. Terms of the deal were not disclosed.

DirecTV customers lost access to channels including MTV, Comedy Central and Nickelodeon on July 10 as the two companies haggled over how much DirecTV should pay Viacom. DirecTV had said Viacom had requested a 30% increase in carriage fees, equal to $1 billion over five years. Viacom said its networks represented about 20% of all viewing on DirecTV, but less than 5% of its programming costs.

The two sides attacked each other online via their websites and YouTube. After the blackout DirecTV told customers they could still access shows on Viacom's websites including MTV.com and ComedyCentral.com. The media firm hit back by pulling full-length episodes from those sites for all visitors.

"The attention surrounding this unnecessary and ill-advised blackout by Viacom has accomplished one key thing: it serves notice to all media companies that bullying TV providers and their customers with blackouts won't get them a better deal." said Derek Chang, executive vice president of content strategy and development for DirecTV, in a statement.

"It's high time programmers ended these anti-consumer blackouts once and for all and prove our industry is about enabling people to connect to their favorite programs rather than denying them access."

"Viacom is extremely pleased to bring its programming back to DirecTV subscribers, and thanks everyone affected by the disruption for their patience and understanding during this challenging period," Viacom said in a statement.

The dispute came amid escalating tensions between media firms and broadcasters. On July 1, AMC Networks, the media company behind "Breaking Bad," "The Walking Dead" and "Mad Men," was removed from the Dish Network after the two companies failed to reach a new contract.

Broadcasters are attacking the "bundling" of shows, a practice under which they are obliged to buy a portfolio of TV stations. DirecTV and others want to be able to pick and choose channels.

The blackout angered customers of both companies who took to Twitter and YouTube to complain. After Viacom pulled its internet shows Jon Stewart mocked the dispute on The Daily Show. He said that both companies were portraying the dispute like "some kind of basic cable Arab Spring. I got news for you. It's not," he said.

Then, he blasted Viacom for its part in the war. "You're pulling the shows from the Internet?" he asked. "Viacom, what are you, China?"

He said that young people know how to work around the restrictions. "So basically you're blocking the old people from watching the show" and showing people there were other ways to entertain themselves including "movies, board games, the Bible, masturbation."