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."
Facebook told by Brussels-based court to stop tracking non-users and to delete all data held on them
Supply chain and manufacturing experience could give Dyson an important edge
New VR Zone Portal arcades open in London and Tunbridge Wells
Systems-on-a-chip with integrated AI features could make voice and facial recognition