the logic for the script is good, but there is a problem. the script uses the request url from "history_messages?chat_session_id..." but the request url sometimes contains a "&cache_version={number}" at the end. this breaks the script and causes the constant cache error. to fix this, you will need to remove the "&cache_version={number}" before starting the export. just change the hookXHR to this and the script should work properly.
the logic for the script is good, but there is a problem. the script uses the request url from "history_messages?chat_session_id..." but the request url sometimes contains a "&cache_version={number}" at the end. this breaks the script and causes the constant cache error. to fix this, you will need to remove the "&cache_version={number}" before starting the export. just change the hookXHR to this and the script should work properly.