The circumstantial complements in accusative are not preceded by preposition and indicate length, weigth,size, distance, quantity or price. They answer to the question ¿cuánto? and function as adverbs.
Este paquete pesa una tonelada.
Un kilo cuesta 4 euros.
He pasado quince días en casa de unos amigos.
In no case maybe considered as direct objects.