jshemas / openGraphScraper

Node.js scraper service for Open Graph Info and More!
MIT License
669 stars 105 forks source link

error: Unexpected token x in JSON at position 207 #234

Closed yeouchien closed 2 months ago

yeouchien commented 2 months ago

url: https://www.youtube.com/watch?v=nFbKMg4E3JM

{
  error: true,
  result: {
    success: false,
    requestUrl: 'https://www.youtube.com/watch?v=nFbKMg4E3JM',
    error: 'Unexpected token x in JSON at position 207',
    errorDetails: SyntaxError: Unexpected token x in JSON at position 207
        at JSON.parse (<anonymous>)
        at t.<anonymous> (/.../node_modules/open-graph-scraper/dist/esm/lib/extract.js:102:47)
        at m.BOr (/node_modules/cheerio/lib/api/api/traversing.ts:581:24)
        at Jjr (/.../node_modules/open-graph-scraper/dist/esm/lib/extract.js:96:21)
        at vnn (/.../node_modules/open-graph-scraper/dist/esm/lib/openGraphScraper.js:41:40)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at WAt (/.../node_modules/open-graph-scraper/dist/esm/index.js:27:19)
        at lwn (/.../src/index.ts:97:17)
        at Runtime.handler (/node_modules/src/awslambda.ts:331:1)
  },
  response: undefined,
  html: undefined
}

i think this is a bug from https://github.com/jshemas/openGraphScraper/pull/214 and works after downgrade to 6.4.0

jshemas commented 2 months ago

Thanks for letting me know, I have not seen this issue before!

jshemas commented 2 months ago

Changes are live in open-graph-scraper@6.7.0. Please let me know if you have any more problems.