mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.84k stars 889 forks source link

[kemonoparty] Attachments can't be filtered by extension #1974

Closed Copy-link closed 2 years ago

Copy-link commented 2 years ago

Tried "image-filter": "extension not in ('swf','zip')" and --filter "extension not in ('swf','zip')" but neither seemed to work.

I realized the problem must be that only the primary file of a post is susceptible to this filter.

mikf commented 2 years ago

--filter or image-filter apply to all files, and your --filter works for this example post:

$ gallery-dl -s https://kemono.party/fantia/user/114707/post/893927
893927_【進捗】+Twitter動画まとめ_01_4a100b08-92c1-428f-a92d-19a0791365f6.png
893927_【進捗】+Twitter動画まとめ_02_wip000.mp4
893927_【進捗】+Twitter動画まとめ_03_wip001.mp4
893927_【進捗】+Twitter動画まとめ_04_wip000_高画質.mp4
893927_【進捗】+Twitter動画まとめ_05_wip001_高画質.mp4
893927_【進捗】+Twitter動画まとめ_06_Twitter動画まとめ.zip

$ gallery-dl -s --filter "extension not in ('swf','zip','mp4')" https://kemono.party/fantia/user/114707/post/893927
893927_【進捗】+Twitter動画まとめ_01_4a100b08-92c1-428f-a92d-19a0791365f6.png

It does not work when the download URL or assumed filename is missing a filename extension. That might be the case here.

Copy-link commented 2 years ago

--filter or image-filter apply to all files, and your --filter works for this example post:

$ gallery-dl -s https://kemono.party/fantia/user/114707/post/893927
893927_【進捗】+Twitter動画まとめ_01_4a100b08-92c1-428f-a92d-19a0791365f6.png
893927_【進捗】+Twitter動画まとめ_02_wip000.mp4
893927_【進捗】+Twitter動画まとめ_03_wip001.mp4
893927_【進捗】+Twitter動画まとめ_04_wip000_高画質.mp4
893927_【進捗】+Twitter動画まとめ_05_wip001_高画質.mp4
893927_【進捗】+Twitter動画まとめ_06_Twitter動画まとめ.zip

$ gallery-dl -s --filter "extension not in ('swf','zip','mp4')" https://kemono.party/fantia/user/114707/post/893927
893927_【進捗】+Twitter動画まとめ_01_4a100b08-92c1-428f-a92d-19a0791365f6.png

It does not work when the download URL or assumed filename is missing a filename extension. That might be the case here.

It seems the problem I was actually having was that --filter and image-filter can't be used together (nor can you use multiple --filter commands in any way).

I overlooked that my script was applying an id-based filter. Sorry about that.