A German court in Hamburg dealt Google a blow on Friday, saying its YouTube online video-sharing site needed to prevent its users from posting copyrighted music clips without permission.