I am building a QGIS plugin in Python to fetch Landsat images from this STAC server: https://landsatlook.usgs.gov/stac-server
I need to be able to download the thumbnails, but cannot find how to authenticate to do this programmatically. How can I authenticate to get this thumbnail jpeg using vanilla python (or standard included libs)?
Trying to fetch the url redirects to the USGS login page.
NB: I do not want to use any extra python libraries that are not supplied with QGIS as it makes sharing the plugin more complex.
This is where I get redirected when attempting to download: https://ers.cr.usgs.gov/login?redirectUrl=https://ers.cr.usgs.gov/?redirect_url%3Dhttps%253A%252F%252Flandsatlook.usgs.gov%252Fdata%252Fcollection02%252Flevel-2%252Fstandard%252Foli-tirs%252F2019%252F109%252F073%252FLC08_L2SP_109073_20190527_20200828_02_T1%252FLC08_L2SP_109073_20190527_20200828_02_T1_thumb_small.jpeg
I do not want to use web scraping.