Google may have to hand over to Viacom details of who watched what video, when, and from where on YouTube, but at least it doesn't have to reveal its search code to Viacom, a New York judge ordered this week.

Viacom International filed suit against Google and its video-sharing subsidiary YouTube in the US District Court for the Southern District of New York in 2007.

It accused the companies of illegally distributing copyright content belonging to Viacom, and using Google's search algorithms to give undue prominence to the copyright content. As part of the discovery phase of the case Viacom asked for information about YouTube's search algorithms - a request the judge denied - and user database.

But the court ruling is "erroneous" and "a set-back to privacy rights", said Electronic Frontier Foundation Senior Staff Attorney Kurt Opsahl in a blog posting about the order.

To build its case, Viacom asked for a list of all the login IDs belonging to YouTube's users, along with the company's log of which videos they watched, when, and from which IP (Internet Protocol) address. With that logging database, it hopes to show that its copyright content is of more interest to YouTube's users than video created by the users themselves.

In addition, Viacom asked for a list of the videos removed from YouTube, including the login IDs of the users who originally posted them and the reason for removal, so as to show that YouTube had at some stage distributed content belonging to Viacom.

While Google argued that Viacom would "likely be able to determine the viewing and video uploading habits of YouTube's users based on the user's login ID and the user's IP address," Judge Louis L Stanton said the company had cited "no authority barring them from disclosing such information in civil discovery proceedings, and their privacy concerns are speculative."

He consequently ordered YouTube to give Viacom its logging database and the list of removed videos.

Google will comply with the court's order, but will first ask Viacom to allow it to render the logs anonymous in order to respect users' privacy, the search company's senior litigation counsel Catherine Lacavera said.

Viacom also wanted to find out how Google's video search works. It requested the source code for Google's search algorithms, hoping to demonstrate that they had been modified to give greater prominence to its videos in order to attract more users. Viacom also asked for the code for YouTube's "Video ID" tool, which creates a digital fingerprint of videos supplied by copyright owners, so as to remove matching videos uploaded by YouTube users without the copyright owners' permission.

Stanton denied Viacom's requests for the source code, accepting Google's argument that it was a trade secret.

"We are pleased the court put some limits on discovery," Lacavera said.

Visit Broadband Advisor for the latest news and reviews about the internet and internet tools, and to use PC Advisor's independent broadband speed checker

Visit PC Advisor's Google spotlight for the latest Google news and opinion