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

[Feature Request] NOT boolean for -f? #7

Open
blarg1980 opened this issue May 26, 2022 · 4 comments
Open

[Feature Request] NOT boolean for -f? #7

blarg1980 opened this issue May 26, 2022 · 4 comments

Comments

@blarg1980
Copy link

blarg1980 commented May 26, 2022

I get that's what --invertfilefiltering does. There are some additional files you want to skip that contain a word you cannot filter out other than filtering everything else. (If I make any sense?) or would that be possible?

Example:
-f "(USA)" NOT "(Beta)"

I get --invertfilefiltering helps, but for something like what I'm doing, I'll need to filter out a good chunk of countries

Example:
-f "(Demo)" "(Japan)" "(Korea)" "(Europe)" "(Australia)" "(Greece)" "(Germany)" "(Italy)" "(Spain)" "(France)" "(Europe, Australia)" --invertfilefiltering
^Some file names include said words, so I need to leave them in the parenthesis as it is part of a section of a file name that is used for regions.

I'm terrible with coding, so I might not make a lot of sense, but I hope I can help others who are having the same issue as I am.

@john-corcoran
Copy link
Owner

Thanks for the note, makes perfect sense! Filtering could be improved in a few ways - I'll have a think about this over the weekend and likely add a few additional options.

@blarg1980
Copy link
Author

blarg1980 commented Jun 2, 2022 via email

@ProximaNova
Copy link

ProximaNova commented Mar 3, 2023

You are saying you want filenames that match:
"(USA)" NOT "(Beta)"
and
"([not matching 'USA'])" AND "(Beta)"

One way to go about this is to have IA downloader create a line-delimited list of files that an item has and put it in a text file. Next, use vim or something to modify the text file :g/usa.*beta/di | :g/beta.*usa/di. Next use that modified TXT file as what IA downloader should download.

Implementing complex string matching could lead to IA downloader being a complex mess of code that does regular expression (regex) matching and whatever. Well, that is one way to look at it: that it should be separated to some other program. Maybe it would be good that it had a filename pattern matching thing that would match via regex as seen in sed and perl in GNU/Linux. The regex could be specified in a text file (like what grab-site does) for better compatibility across Linux, Windows, etc.

The whole "(USA)" NOT "(Beta)" string format is probably weak, so use regex instead. Regular expression is pretty much all you need when it comes to matching patterns of text. Regex for everything not usa.*beta (not implemented as of now): --invertfilefiltering -f file "filter.txt"; contents of file.txt:
/usa.*beta/gi
/beta.*usa/gi

Notice '-f file "filter.txt"' for a file with regex
and '-f "pattern"' for the pattern directly

@ProximaNova
Copy link

ProximaNova commented Mar 3, 2023

Correction: "contents of filter.txt"

Also, I don't think this downloader can download metadata in/at https://catalogd.archive.org/history/[item_id] (login required). If it did it should download it to folder "itemid~history". The tilde character (~) is not allowed in item IA IDs.

@john-corcoran john-corcoran changed the title NOT boolean for -f? [Feature Request] NOT boolean for -f? Oct 11, 2023
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

3 participants