edgi-govdata-archiving / wayback

A Python API to the Internet Archive Wayback Machine
https://wayback.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
61 stars 12 forks source link

Multiple filter? #119

Closed BilibalaX closed 11 months ago

BilibalaX commented 1 year ago

Is it possible to add multiple filter fields?

Mr0grog commented 1 year ago

Not currently, but I’d be happy to accept a PR to add it!

There’s actually a big TODO comment in the code about it: https://github.com/edgi-govdata-archiving/wayback/blob/e633e86fe0a5943dad0959c1a501e2a62e0a526b/wayback/_client.py#L639-L657

You need to change the part in lines 650-657 to do different conversions for each option (instead of the same generic conversion for every option). The value should be a list or tuple, which will get serialized correctly as repeated items in the querystring in the actual request.