Código:
async function watchAnime(episode_id) { res = await axios.get(`https://www1.gogoanime.cm/${episode_id}`) const body = await res.data; $ = cheerio.load(body) src=$('div.play-video > iframe').attr('src') iframe_result = src return await (iframe_result) }Producción :
"//gogoplay1.com/streaming.php?id=MTU1MzEy&title=B%3A+The+Beginning+Succession+%28Dub%29+Episode+6"Entonces, ¿hay alguna manera de eliminar las comillas de la URL de salida?
Para obtener una copia de una cadena str sin su primer y último carácter:
const newString = str.substring(1, str.length-1)Asi que :
const str = `"foo"` console.log(str.substring(1, str.length-1)) // output fooPuede usar .replace()
src.replace(/['"]+/g, '')Entonces en tu caso
async function watchAnime(episode_id) { res = await axios.get(`https://www1.gogoanime.cm/${episode_id}`) const body = await res.data; $ = cheerio.load(body) let src = $('div.play-video > iframe').attr('src') let iframe_result = src.replace(/['"]+/g, '') return await (iframe_result) }