"Google must hand over the log holding details of every user who has watched any video on YouTube, a US court ruled.
The ruling comes as part of Google's legal battle with Viacom over allegations of copyright infringement.
Digital rights group the Electronic Frontier Foundation (EFF) called the ruling a "set-back to privacy rights".
The log, which will be handed to Viacom, contains the log-in ID of users, the computer IP address (online identifier) and video file details.
Viacom has alleged that YouTube is guilty of massive copyright infringement.
The court declined Viacom's request that Google be forced to hand over the source code of YouTube, saying it was a "trade secret" that should not be disclosed.
But it said privacy concerns expressed by Google about handing over the log were "speculative".
The ruling will see the viewing habits of millions of YouTube users given to Viacom.
The EFF said: "The Court's erroneous ruling is a set-back to privacy rights, and will allow Viacom to see what you are watching on YouTube.
"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.""
Som om Google inte kunde göra saker och ting värre. The end of Youtube might be near...
Ingen status?