I had this problem: smashed screen, connect to itunes screen, recovery fails error 1 right at the end.
I also cleared the DNS cache and hosts file, but I do not believe these contributed to the success.
I fixed it by hinging up the screen and disconnecting the battery for a few minutes reconnecting the battery, then trying to restore again. It took several attempts before it worked.
Note that you should not be using shift-restore in itunes to restore using a specified IPSW, rather, you should allow iTunes to pick the IPSW. (or as I already had the same IPSW iTunes would have downloaded, I copied it to the folder where itunes keeps IPSWs (look up the location specific to your OS).