Google has been ordered to disclose a whopping 12 terabytes of logs which detail every video watched by every user of YouTube.
The decision is part of a copyright case Google is fighting against Viacom and its subsidiaries.
The $1bn case revolves primarily around user uploaded videos of Comedy Central and MTV shows.
After a request that YouTube remove some 100,000 videos, Viacom filed the suit and accused of Google profiting directly from stolen content.
US District Court Judge Louis Stanton granted Viacom's request for the logs, saying that the database is essential in deliberating whether YouTube profited from the infringing videos.
"They need the data to compare the attractiveness of allegedly infringing videos with that of non-infringing videos," wrote Judge Stanton.
"A markedly higher proportion of infringing video watching may bear on plaintiffs' vicarious liability claim, and defendants' substantial non-infringing use defence."
The judge also granted a motion by Viacom to release YouTube's archive of removed videos. Two other motions asking for the disclosure of the site's search and advertising code were denied.
Civil rights groups were quick to pounce on the decision. The Electronic Frontier Foundation said in a statement that the judge's decision will violate user privacy and the Federal Video Privacy Protection Act.
"The court's erroneous ruling is a setback to privacy rights, and will allow Viacom to see what you are watching on YouTube," said the EFF.
"We urge Viacom to back off this overbroad request and Google to take all steps necessary to challenge this order and protect the rights of its users."
Cotton seedling freezes to death as Chang'e-4 shuts down for the Moon's 14-day lunar night
Fortnite easily out-earns PUBG, Assassin's Creed Odyssey and Red Dead Redemption 2 in 2018
Meteor showers as a service will be visible for about 100 kilometres in all directions
Saturn's rings only formed in the past 100 million years, suggests analysis of Cassini space probe data
New findings contradict conventional belief that Saturn's rings were formed along with the planet about 4.5 billion years ago