1. In PullRequest Review, if excel, bitbucket guide me that excel file can't view diff online and guide me to download old & new file mannually.
2, I choose to download new file, when click 'new file' button, excel will save to my download folder of my PC. excel file content seems Ok.
3. Now I want to download the "new file' with python script, with AI support I earned following codes:
~~~~~~~~~~~~~~~~~~~
import requests
bitbucket_token = "xxxxxx"
headers = {
"Authorization": f"Bearer {bitbucket_token}"
}
download_url = "https://aadev-aa.aaa.com/git/projects/aa/repos/bb/raw/Release/aaa.xlsx?at=xxxxxxxxxx"
file_response = requests.get(download_url, headers=headers)
tmp_file = "d:\\temp_download11111.xlsx"
with open(tmp_file, 'wb') as f:
f.write(file_response.content)
~~~~~~~~~~~~~~~~~~
temp_download11111.xlsx can be download, but it's a ascii file rather than an excel file and If I rename suffix from xlsx to html, it's looks like following: (BTW, about the token, for other purposes, following are all works: