DrKain / scrape-youtube

A lightning fast package to scrape YouTube search results
MIT License
112 stars 30 forks source link

Error: Failed to extract InitialData. The request may have been blocked. #14

Closed Yimura closed 4 years ago

Yimura commented 4 years ago

Describe the bug When searching for a video on YouTube it returns the below error:

Error: Failed to extract InitialData. The request may have been blocked.
    at /usr/src/app/node_modules/scrape-youtube/lib/index.js:252:27
    at new Promise (<anonymous>)
    at Youtube.extractInitialData (/usr/src/app/node_modules/scrape-youtube/lib/index.js:228:16)
    at Youtube.<anonymous> (/usr/src/app/node_modules/scrape-youtube/lib/index.js:187:55)
    at step (/usr/src/app/node_modules/scrape-youtube/lib/index.js:44:23)
    at Object.next (/usr/src/app/node_modules/scrape-youtube/lib/index.js:25:53)
    at /usr/src/app/node_modules/scrape-youtube/lib/index.js:19:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/node_modules/scrape-youtube/lib/index.js:15:12)
    at Request._callback (/usr/src/app/node_modules/scrape-youtube/lib/index.js:174:112)
    at Request.self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:314:20)
    at Request.<anonymous> (/usr/src/app/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:314:20)
    at IncomingMessage.<anonymous> (/usr/src/app/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:420:28)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1252:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Before I could fix this by retrying searching.

To Reproduce Use the package as you would normally.

Expected behavior The package should not fail permanently on such requests.

Screenshots https://prnt.sc/v7ysxj

Versions:

Additional context none

DrKain commented 4 years ago

Thanks for reporting. I'll look into this.