Skip to content

Commit

Permalink
[instagram] use custom User-Agent header for video downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Aug 5, 2021
1 parent 7b029df commit 5d5ab66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gallery_dl/extractor/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def items(self):
self.login()
data = self.metadata()
videos = self.config("videos", True)
video_headers = {"User-Agent": "Mozilla/5.0"}

for post in self.posts():

Expand All @@ -60,6 +61,8 @@ def items(self):
url = file["display_url"]
elif not videos:
continue
else:
file["_http_headers"] = video_headers
file.update(post)
yield Message.Url, url, text.nameext_from_url(url, file)

Expand Down

0 comments on commit 5d5ab66

Please sign in to comment.