From 2bcf0a4c49d00b61f230854a7c45d4acfa96d4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 28 Jul 2023 14:25:37 +0200 Subject: [PATCH] [instagram] fix initialization order (#4359) regression caused by the changes in a383eca7 --- gallery_dl/extractor/instagram.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index cb77fa1c..561941ce 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -36,6 +36,13 @@ class InstagramExtractor(Extractor): self.item = match.group(1) def _init(self): + self.www_claim = "0" + self.csrf_token = util.generate_token() + self._find_tags = re.compile(r"#\w+").findall + self._logged_in = True + self._cursor = None + self._user = None + self.cookies.set( "csrftoken", self.csrf_token, domain=self.cookies_domain) @@ -44,13 +51,6 @@ class InstagramExtractor(Extractor): else: self.api = InstagramRestAPI(self) - self.www_claim = "0" - self.csrf_token = util.generate_token() - self._find_tags = re.compile(r"#\w+").findall - self._logged_in = True - self._cursor = None - self._user = None - def items(self): self.login()