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."
Latest Tesla news: Tesla stock price tanks amid reports of 'widening probe' by SEC and claims the base Model 3 loses money
SEC 'probe' takes its toll on Tesla as new research suggests that Tesla loses $6,000 on every $35,000 Model 3
10nm Cannon Lake Core i3-8121U CPUs make a rare outing with Intel's NUC mini PC
'Notorious' Australian child hacker thought he had executed 'flawless' hack
The former employee says that Tesla fired him for bringing the accusations to management internally