From 6b56b3ebe1589cf4689001b66d82e30af3c13814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 18 Aug 2021 01:50:21 +0200 Subject: [PATCH] [twitter] report API errors as generic StopExtraction exceptions prevents duplicate logging messages for nonexistent users (#1759) --- gallery_dl/extractor/twitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index e56a9488..54d6d209 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -749,8 +749,8 @@ class TwitterAPI(): ) except Exception: msg = data["errors"] - if response.status_code < 400: - self.extractor.log.warning(msg) + if msg and response.status_code < 400: + raise exception.StopExtraction(msg) else: msg = ""