Skip to content

Commit

Permalink
[deviantart] update usernames (#455)
Browse files Browse the repository at this point in the history
In the case that a user changed his username, requesting deviations
with an old name might cause problems (missing deviations, etc.)

The internal 'username' value therefore now gets updated to the
current username taken from the user profile.
  • Loading branch information
mikf committed Oct 24, 2019
1 parent 2eb3881 commit 9e3a860
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gallery_dl/extractor/deviantart.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def skip(self, num):

def items(self):
if self.user:
self.group = not self.api.user_profile(self.user)
profile = self.api.user_profile(self.user)
self.group = not profile
if self.group:
self.subcategory = "group-" + self.subcategory
else:
self.user = profile["user"]["username"]

yield Message.Version, 1
for deviation in self.deviations():
Expand Down

0 comments on commit 9e3a860

Please sign in to comment.