I have a 4Runner 2000 SR5 v6, 97.500 miles, same problem, I change the sparks plugs, O2 Sensor before catalitic, clean MAF sensor, check for vacuum leaks, erase code and after 2 hours Check Engine light again P0171.
I'm going to change the fuel filter and add a injector cleaner.
Any advice.
Thanks