Added some sleeps to retries, to try to cut down on errors [superq]
Use urlsafe encoding