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

Use session.get instead of requests.get in getXMLHeader #438

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

Pokechu22
Copy link
Contributor

session.get uses our configured User-Agent, while requests.get uses the default one. Needed for python2 -u dumpgenerator.py --xml --xmlrevisions --images https://fidopedia.fido.de/, as that site rejects the requests user agent.

(That site also requires other stuff; see this branch (perma), though that's not fully complete.)

`session.get` uses our configured User-Agent, while `requests.get` uses the default one.
@nemobis
Copy link
Member

nemobis commented Sep 18, 2022

This relies on generateXMLDump() and getXMLHeader() actually passing the session variable, otherwise it will fail. Maybe we should handle the default value None here?

@nemobis nemobis merged commit 5d83703 into WikiTeam:master Sep 18, 2022
@Pokechu22
Copy link
Contributor Author

I'm not entirely sure about how the defaults are handled here. getXMLHeader calls getXMLPage which calls getXMLPageCore which directly calls session.post. I'm not really sure why the argument even is optional.

yzqzss added a commit to saveweb/wikiteam3 that referenced this pull request Jan 4, 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

Successfully merging this pull request may close these issues.

2 participants