I'm creating a google apps script that would export a Google Sheet as an HTML file and place it in my Google Drive, however I need a direct download link in my script, and I couldn't find a working URL for exporting a spreadsheet as HTML. In addition to the data the HTML should also include any images embedded in the spreadsheet.
The direct download link for my Google sheet appears to work when exporting PDF as follows: https://docs.google.com/spreadsheets/d/1TavkbXHhw3hrDaRKhhNsevyRCM_UG8VD0x-d5eZnHZE/export?format=pdf
however, when swapping out 'format=pdf' to 'format=html' I get an error. https://docs.google.com/spreadsheets/d/1TavkbXHhw3hrDaRKhhNsevyRCM_UG8VD0x-d5eZnHZE/export?format=html
and the problem appears to be just for html, since the links for .csv, .xlsx, and .ods also work fine.
This solution comes close, but it downloads a .zip that has the html file inside it https://stackoverflow.com/a/44184071/19982878
It should be noted that Google Docs has a direct download link for HTML, which is showcased in this video (at 5:31) https://youtu.be/Rwau69hCC4Y?list=LL&t=331 Swapping out the ID for mine and 'document' to 'spreadsheet' didn't work in this case either.