Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering deviantart by extension works strange. #1272

Closed
Gh0sTG0 opened this issue Jan 25, 2021 · 6 comments
Closed

Filtering deviantart by extension works strange. #1272

Gh0sTG0 opened this issue Jan 25, 2021 · 6 comments

Comments

@Gh0sTG0
Copy link

Gh0sTG0 commented Jan 25, 2021

Hi. Trying to download from DA only non-picture files. Like all zips, pdfs, mp4s, etc. But skipping all jpg, png and gif files. Using latest windows .exe thing.
How trying to do it:

1st was test. I just downloaded it all:
gallery-dl "https://www.deviantart.com/sigeel/"
Address is just for test because it has: 311 jpg, 4 png, 4 pdf and 1 mp4.

After that I started to add --filter things, 1st one is just like it should (?) be:
gallery-dl --filter "extension not in ('jpg', 'png', 'gif')" "https://www.deviantart.com/sigeel/"
It just downloads all things - jpgs, pngs, and that pdfs and mp4.

So next I tried to do without not:
gallery-dl --filter "extension in ('jpg', 'png', 'gif')" "https://www.deviantart.com/sigeel/"
But it downloaded only jpgs, skipping pngs. And skipped things that are not in list, all pdfs and mp4 file.

Next I tried to set to include pdf and mp4:
gallery-dl --filter "extension in ('pdf', 'mp4', 'zip')" "https://www.deviantart.com/sigeel/"
It downloaded only that one mp4, skipping all pics and 3 pdfs.

Then I tried easiest way from README.rst:
gallery-dl --filter "extension == 'pdf' or extension == 'mp4'" "https://www.deviantart.com/sigeel/"
But it downloaded only mp4 file too.

I'm not sure. I'm new to gallery-dl, so not sure that I write all correct. If so, please tell me about how it should be in correct way.

Or maybe it can be a real bug?

@mikf
Copy link
Owner

mikf commented Jan 25, 2021

--filter "extension not in ('jpg', 'png', 'gif')" would have worked under normal circumstances, but the filename extension for any original file download on dA is unknown when --filter is evaluated. It gets filled in eventually when the download starts, but that, with the way it is curently implemented, is too late for --filter.

@rautamiekka
Copy link
Contributor

rautamiekka commented Jan 25, 2021

^ In that case it'd be a good idea to add a DA-specific warning (both to the docs and when the flag's used) that the filtering is unlikely to work as intended due to that, until a fix to abort+delete the transfer is added.

@Gh0sTG0
Copy link
Author

Gh0sTG0 commented Jan 25, 2021

--filter "extension not in ('jpg', 'png', 'gif')" would have worked under normal circumstances, but the filename extension for any original file download on dA is unknown when --filter is evaluated. It gets filled in eventually when the download starts, but that, with the way it is curently implemented, is too late for --filter.

So, no way to start with requesting filename, only then download it?
Ok. Thanks for answer.
PS Should I close this issue? new to github too.
PPS adding some flags and messages will be nice. Maybe with aborting download when it is used.

@mikf
Copy link
Owner

mikf commented Jan 25, 2021

Should be fixed in c26de09

@mikf mikf closed this as completed Jan 25, 2021
@UlyssesZh
Copy link

I think there are still problems... If I use the filter extension == 'gif' together with a --range specified when downloading from DeviantArt, it downloads nothing.

@mikf
Copy link
Owner

mikf commented May 5, 2022

@UlyssesZh works for me

$ gallery-dl https://www.deviantart.com/skatergators  --range 1-3 --filter "extension == 'gif'"
/tmp/deviantart/SkaterGators/deviantart_855055363_[COM] Humilty.gif
/tmp/deviantart/SkaterGators/deviantart_853510387_[COM] Wicker.gif
/tmp/deviantart/SkaterGators/deviantart_852808531_[COM] Kagami.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants