mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[oauth] add the 'extractor.oauth.browser' option
enables/disables the use of webbrowser.open() during OAuth authorization
This commit is contained in:
parent
1a9b4759a2
commit
b4c438c9ad
@ -73,7 +73,7 @@ modules = [
|
||||
"imagehosts",
|
||||
"directlink",
|
||||
"recursive",
|
||||
"oauthhelper",
|
||||
"oauth",
|
||||
"test",
|
||||
]
|
||||
|
||||
|
@ -65,7 +65,8 @@ class OAuthBase(Extractor):
|
||||
"""Open 'url' in browser amd return response parameters"""
|
||||
import webbrowser
|
||||
url += "?" + urllib.parse.urlencode(params)
|
||||
if not webbrowser.open(url):
|
||||
browser = self.config("browser", True)
|
||||
if not browser or (browser and not webbrowser.open(url)):
|
||||
print("Please open this URL in your browser:")
|
||||
print(url, end="\n\n", flush=True)
|
||||
return self.recv()
|
Loading…
Reference in New Issue
Block a user