If you see this after authorizing, copy the full URL from your browser and paste the "code" parameter into your script.