Skip to content

Help with conditional file name? #2973

Answered by mikf
Twi-Hard asked this question in Q&A
Discussion options

You must be logged in to vote

When you are downloading stash content as a child extractor with a group-folder extractor as parent, the current subcategory value will be stash and parent['subcategory'] will be group-folder

subcategory == 'stash' and 'parent' in locals() and parent['subcategory'] == 'group-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.

str(parent['_extractor']) == '<class \\'gallery_dl.extractor.deviantart.DeviantartStashExtractor\\'>'

You might as well chec…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Twi-Hard
Comment options

Answer selected by Twi-Hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants