title: Example from Google to automate uploading a YouTube video gives "Error 400: invalid_request"
body: <p>I am following the guide here to upload a video to YouTube using their Data API:</p>
  <p><a href="https://developers.google.com/youtube/v3/guides/uploading_a_video" rel="nofollow noreferrer">https://developers.google.com/youtube/v3/guides/uploading_a_video</a></p>
  <p>When I run the sample code with this command:</p>
  <pre><code>python upload_video.py --file=&quot;/var/www/html/share/test.mp4&quot; --title=&quot;Test&quot; --privacyStatus=&quot;unlisted&quot; --noauth_local_webserver
  </code></pre>
  <p>It asks me to:</p>
  <pre><code>Go to the following link in your browser:
  
      https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload&amp;redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&amp;response_type=code&amp;client_id=snippped
  </code></pre>
  <p>After doing so, I receive this error:</p>
  <p><a href="https://i.stack.imgur.com/4g7JM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4g7JM.png" alt="Error from sample script in a browser" /></a></p>