אני מריץ את הקוד הבא בapps script הקוד רץ בצורה תקינה ותגובת השרת תקינה
אבל כאשר אני מנסה לשמוע את הקובץ המערכת משמיעה שגיאה (M1080)
כאשר אני מנסה לשמוע את הקובץ דרך האתר הקובץ מושמע
אשמח לעזרה
const kolIsrael = () => {
const url = "spreaker.com/show/6095076/episodes/feed";
const feed = UrlFetchApp.fetch(url).getContentText();
const doc = XmlService.parse(feed);
const root = doc.getRootElement();
const channel = root.getChild('channel');
const item = channel.getChild('item');
const enclosure = item.getChild('enclosure')?.getAttribute("url")?.getValue();
const lest = settings.getRange("A75").getValue();
Logger.log(`${lest}` == `${enclosure}`);
if (`${lest}` != `${enclosure}`) {
const audio = UrlFetchApp.fetch(enclosure).getBlob();
let nt = "9";
let listfile = JSON.parse(UrlFetchApp.fetch(`${urlapi}GetIVR2Dir?token=0790000000:123456&path=ivr2:/${nt}/`));
Logger.log(listfile.responseStatus);
if (listfile.responseStatus === 'OK') {
Logger.log("listfile.responseStatus" + listfile.responseStatus);
let lastFileName = listfile.files
.filter(file => file.fileType === 'AUDIO' || file.fileType === 'TTS')
.map(file => file.name.split('.')[0])
.find(fileName => !isNaN(fileName));
let newNumber = Number(lastFileName || -1) + 1;
newName = newNumber.toString().padStart(3, '0');
let data = { 'path': `ivr2:9/${newName}.wav`, 'token': '0790000000:123456', 'contents': audio };
let options = { 'method': 'post', 'payload': data, 'convertAudio': 1, autoNumbering: true };
let request = JSON.parse(UrlFetchApp.fetch(`${urlapi}UploadFile`, options));
Logger.log(JSON.stringify(request));
settings.getRange("A75").setValue(enclosure);
}
}
let body = Logger.getLog();
settings.getRange("A76").setValue(body);
}
תגובת השרת (השניה) היא
{"responseStatus":"OK","path":"ivr/9/001.wav","size":6075387,"yemotAPIVersion":6,"success":true}