Re: cannot download mbox with python - Mailing list pgsql-www

From Andreas 'ads' Scherbaum
Subject Re: cannot download mbox with python
Date
Msg-id 25b24513-cf6f-406e-a04e-b3d834ad5398@pgug.de
Whole thread Raw
In response to Re: cannot download mbox with python  (Pierre Forstmann <pierre.forstmann@gmail.com>)
List pgsql-www
On 07/12/2023 17:39, Pierre Forstmann wrote:
I've tried this:

import requests
from urllib.parse import urlparse

url = 'https://www.postgresql.org/list/pgsql-bugs/mbox/pgsql-bugs.202312'
#response = requests.get(url, auth=('xxx','yyy'))
session = requests.session()
session.auth = ('xxx','yyy')
response = session.get(url)
print('status: ' + str(response.status_code))
print('... done')
print(response.content)

The session.auth is still doing a basic http auth, not what you need here.

Try opening your link in a browser in an anonymous window:

https://www.postgresql.org/list/pgsql-bugs/mbox/pgsql-bugs.202312

It redirects you to the login, you need to emulate that path in your script,
login into the website and then you can retrieve the mbox.

-- 				Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

pgsql-www by date:

Previous
From: Pierre Forstmann
Date:
Subject: Re: cannot download mbox with python
Next
From: Guillaume Lelarge
Date:
Subject: Patch for new book edition