[instagram] add 'order-files' option (#4017, #3993)

This commit is contained in:
Mike Fährmann
2023-05-18 22:34:33 +02:00
parent 82a12d6126
commit d680623db3
2 changed files with 22 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ class InstagramExtractor(Extractor):
previews = self.config("previews", False)
video_headers = {"User-Agent": "Mozilla/5.0"}
order = self.config("order-files")
reverse = order[0] in ("r", "d") if order else False
for post in self.posts():
if "__typename" in post:
@@ -71,6 +74,8 @@ class InstagramExtractor(Extractor):
if "date" in post:
del post["date"]
if reverse:
files.reverse()
for file in files:
file.update(post)