-
I'm trying to make a conditional directory name when downloading groups that detects if the files being downloaded are from sta.sh. "folder":
{
"directory":
{
"subcategory == 'group-folder' and 'parent' in locals() and parent['_extractor'] == '<class \\'gallery_dl.extractor.deviantart.DeviantartStashExtractor\\'>'":
[
"groups",
"{parent[_username]}",
"{parent[folder][title]}"
"{author[username]}"
"stash",
],
"subcategory == 'group-folder'":
[
"groups",
"{folder[owner]}",
"{folder[title]}",
"{author[username]}"
],
"folder['owner'] == username and author['type'] == 'banned'":
[
"users",
"{author[username]}"
],
"":
[
"error"
]
}
} Does anybody know how to do this? Edit: for testing.. downloading this group gets to a stash download pretty quickly https://www.deviantart.com/sci-twi-fans |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you are downloading stash content as a child extractor with a subcategory == 'stash' and 'parent' in locals() and parent['subcategory'] == 'group-folder'
You could theoretically get the string representation of that object, but you really shouldn't do something like this. str(parent['_extractor']) == '<class \\'gallery_dl.extractor.deviantart.DeviantartStashExtractor\\'>' You might as well check the parent['_extractor'].subcategory == 'stash' |
Beta Was this translation helpful? Give feedback.
When you are downloading stash content as a child extractor with a
group-folder
extractor as parent, the currentsubcategory
value will bestash
andparent['subcategory']
will begroup-folder
<class 'gallery_dl.extractor.deviantart.DeviantartStashExtractor'>
is an actual Python object, not a simple string, so your test is always going to fail / return False.You could theoretically get the string representation of that object, but you really shouldn't do something like this.
You might as well chec…