From 3ee77a09026b55caa2e10cc780742627ff9361cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 8 Jun 2017 19:46:24 +0200 Subject: [PATCH] [oauth] print URL if webbrowser.open fails --- gallery_dl/extractor/oauth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/oauth.py b/gallery_dl/extractor/oauth.py index ed29b7fa..2cff856c 100644 --- a/gallery_dl/extractor/oauth.py +++ b/gallery_dl/extractor/oauth.py @@ -77,7 +77,10 @@ class OAuthReddit(OAuthBase): } url = "https://www.reddit.com/api/v1/authorize?" url += urllib.parse.urlencode(params) - webbrowser.open(url) + + if not webbrowser.open(url): + print("Please open this URL in your browser:") + print(url, end="\n\n", flush=True) params = self.recv()