I found the answer here: Can no longer produce PDF from Google Sheets spreadsheet for some of the users
Apparently,
//remove the trailing 'edit' from the url url = url.replace(/edit$/, '');
was no longer removing everything after the edit, so I followed @jesse-fox and @bcolbert's advice and changed it to the following:
url = url.replace(/edit.*$/,'');
and it works perfectly!
1.4m articles
1.4m replys
5 comments
57.0k users