You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have the following prompt/script which uses the current YT video url to fetch some information on the video. The code fails in the line where the url function is being called. what am I missing here.
This is the error message: TypeError: Cannot read properties of undefined (reading 'apply')
Video data:
{{js:
currentURL()
.then(cURL => {
const noembedUrl = "https://noembed.com/embed?url=" + encodeURIComponent(cURL);
return url(noembedUrl); // Return the fetch promise to the next then() in the chain
})
.then(response => response.json()) // Parse the response as JSON
.then(data => {
const publishDate = data.upload_date;
const channelName = data.author_name;
const channelUrl = data.author_url;
// If you need to use these values in subsequent steps, you could return them as an object here
return {
publishDate,
channelName,
channelUrl
};
})
.catch(error => {
// Handle any errors that occur in the promise chain
return error;
});
}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have the following prompt/script which uses the current YT video url to fetch some information on the video. The code fails in the line where the url function is being called. what am I missing here.
This is the error message:
TypeError: Cannot read properties of undefined (reading 'apply')
Beta Was this translation helpful? Give feedback.
All reactions