How to detect url callback request
<p>I have a locally-run app that makes API calls to a website (<a href="https://tumblr.com" rel="nofollow"><code>tumblr.com</code></a>). This involves setting some OAuth credentials; one step along the way requires extracting a key from a callback url that the server directs the browser to. So what I currently have the user do is:</p>

<ol>
<li><p>Open an authorization link in a browser, which prompts them to authorize the OAuth application on the website</p></li>
<li><p>Click through the authorization page on the website (“<em>Yes, I allow xxxxx app to access certain info associated with my account</em>”)</p></li>
<li><p>Clicking <code>Authorize app</code> makes a request to the localhost which includes a parameter in the url. Meaning that tumblr will redirect the browser to the page <code>http://localhost/?oauth_token={TOKEN}&amp;oauth_verifier={VERIFIER}#_=_</code>. I assume that causes a request to be made to the local machine when it does that.</p></li>
<li><p>The user is expected to isolate the key parameter in the url from the browser’s navigation bar, and paste it in the application.</p></li>
</ol>

<p>So is there any way I can bypass steps 3 and 4 and simply have the app pick up the callback request instead of expecting the user to copy and paste it from the browser? I’m afraid I don’t know much about how to handle network requests in python.</p>

<p>To be clear, what I need to do is get the <code>{VERIFIER}</code> string.</p>