diff --git a/docs/configuration.rst b/docs/configuration.rst index 76a4537a..72ef42e1 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1783,6 +1783,16 @@ Description in `cache `__. +extractor.oauth.host +-------------------- +Type + ``string`` +Default + ``"localhost"`` +Description + Host name / IP address to bind to during OAuth authorization. + + extractor.oauth.port -------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index bbd4dc09..1e485eea 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -198,6 +198,7 @@ { "browser": true, "cache": true, + "host": "localhost", "port": 6414 }, "paheal": diff --git a/gallery_dl/extractor/oauth.py b/gallery_dl/extractor/oauth.py index 653822f9..d6628c42 100644 --- a/gallery_dl/extractor/oauth.py +++ b/gallery_dl/extractor/oauth.py @@ -41,7 +41,8 @@ class OAuthBase(Extractor): stdout_write("Waiting for response. (Cancel with Ctrl+c)\n") server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - server.bind(("localhost", self.config("port", 6414))) + server.bind((self.config("host", "localhost"), + self.config("port", 6414))) server.listen(1) # workaround for ctrl+c not working during server.accept on Windows