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

User configurable sessions #45

Merged
merged 4 commits into from Jul 18, 2020

Conversation

@shawnmjones
Copy link
Member

shawnmjones commented Jul 18, 2020

These changes should allow a user to specify their own session objects, for setting their own request headers (like user agents) and more. It has only been tested with IA and archive.today.

@@ -49,11 +55,11 @@ def push(self, uri_org, p_args=[]):
msg = "IndexError (" + self.name+ "): unable to extract 'submitid' "
raise

# push to the archive
r = requests.post('https://'+host+'/submit/', timeout=120,
# push to the archive

This comment has been minimized.

@ibnesayeed

ibnesayeed Jul 18, 2020

Member
Suggested change
# push to the archive
# push to the archive
@maturban maturban merged commit 13ecf14 into oduwsdl:master Jul 18, 2020
@maturban
Copy link
Member

maturban commented Jul 18, 2020

I merged the work done by @shawnmjones. However, after some tests, I realized that the condition if 'user-agent' in session.headers:, added in each IA and IS handlers, will be always "True" because by default session.headers include User-Agent (e.g., 'User-Agent': 'python-requests/2.13.0')

@shawnmjones shawnmjones deleted the shawnmjones:user-configurable-sessions branch Jul 21, 2020
@shawnmjones
Copy link
Member Author

shawnmjones commented Jul 21, 2020

Thanks for catching this.

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.