Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProblems with pushing mementos into Internet Archive #43
Comments
This comment has been minimized.
This comment has been minimized.
Thanks for providing details about the problem. Do you have any suggestion for how the user can provide headers? For example:
|
This comment has been minimized.
This comment has been minimized.
The |
This comment has been minimized.
This comment has been minimized.
@maturban MemGator has some logic of allowing users to specify user-agent through the command-line. I think simply allowing a string with some semantic CLI flag (e.g., MemGator's @ibnesayeed might have an opinion on this as well. |
shawnmjones commentedApr 1, 2020
I noticed this when I was using ArchiveNow this morning.
If I add a user agent to the arguments to the
requests.get
on line 15 ofarchivenow/archivenow/handlers/ia_handler.py
then it works.archivenow/archivenow/handlers/ia_handler.py
Line 15 in cafcbdd
I'm uncertain as to how you want to handle the user specifying their own user agent. The existing
--agent
argument appears to be for specifying which tool the user desires to employ for creating WARCs. Also, there doesn't appear to be a way to submit changes to any of the request headers inarchivenow/archivenow.py
.As I'm calling ArchiveNow within Python code, I would prefer an available parameter to the
push
function on line 129 ofarchivenow/archivenow.py
.archivenow/archivenow/archivenow.py
Lines 129 to 168 in cafcbdd
For example, we could have:
where the user can override any of the request headers by assigning them as a dictionary to the
headers
parameter. This dictionary would have to be re-submitted through the code on line 154 to the function executed via multithreading.I haven't submitted a pull request yet because all handlers would need to be updated to receive and act on this parameter. I'm not sure of the implications of that.