youtube-info
youtube-info copied to clipboard
Always giving me StatusCodeError: 403 - ""
Sometimes I need to re-fetch it again and again and takes more than 10 times re-fetching until I can get the data properly. And it's totally annoying since I use this data to get video title
Experiencing the same thing
Also experiencing the same thing
Is it possible that the code now deprecated? I see no updates since last 2 years
Same
Changing the user-agent to 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)' in lib/fetch-page.js fixed the issue for me. Somehow wish we could pass the User-Agent option directly from the fetchVideo(id, opts)
Changing the user-agent to that worked for me as well. I found it in index.js.
Changing the user-agent works for me as well
Changing the user agent worked for a day for me but now it stopped working
I used this hotfix, still works for me, using default user-agent:
/* return fetchCommentCount(videoId, sessionToken, commentToken).then(function (
commentCount
) {
videoInfo.commentCount = commentCount */
return videoInfo
//})
I commented/removed lines 28-31 and 32, leaving only "return videoInfo" in index.js, because it looks like fetching comment count via "https://www.youtube.com/watch_fragments_ajax" doesn't work anymore. And this caused to return error 403 for me.
Edit: If you need video author, change:
var owner = $('.yt-user-info > a').text()
To this:
var owner = body.split('\"author\":\"')[1].split('","')[0]
In line 115.
I faced the same issue of status code 4: Problem: In index.js file, When it tries to run fetchCommentCount(which calculate the comment count), causes an error of 403.
Same
dQw4w9WgXcQ
Unhandled rejection Error: StatusCodeError: 403 - ""
at /home/disrupt/discordbots/Adora-Bot/node_modules/youtube-info/index.js:101:15
at tryCatcher (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/disrupt/discordbots/Adora-Bot/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)
Still broken for me