question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.3.2 There are no continuations

See original GitHub issue

Steps to reproduce

Use innertube youtube instance to search for ‘ghost recon future soldier’ with filter set to last 24 hrs

I am using the function below to comment on relevant videos but it never fetches the next page. Wasnt a problem 2 days ago


async function fetchAllSearchResults({
  youtube,
  searchTerm,
  randomElement,
  responses,
  debug,
}) {
  let index = 1;
  let estimatedSize = 1;

  // Refer to ./responses/comment-failed.json and ./responses/comment-success.json to see what happens when posting a comment fails/succeeds
  async function processResult(youtube, result) {
    // Keep higher numbers to prevent getting caught
    const DELAY =
      MIN_DELAY + Math.floor(Math.random() * (MAX_DELAY - MIN_DELAY));

    // YouTube search returns a lot of false positives so we apply our own filter to confirm that only titles containing 'ghost recon future soldier' in some form will be considered

    if (!isGhostReconFutureSoldierVideo(result.title.text)) {
      console.log(
        `skip index:${index}/${estimatedSize} video:${result.id} channel:${result.author.name} REASON:title does not match "${searchTerm}" title:${result.title.text}`
      );
      index++;
      return;
    }

    const shouldPost = getShouldPostComment(result);
    if (shouldPost.isExisting) {
      console.log(
        `skip index:${index}/${estimatedSize} video:${result.id} channel:${result.author.name} REASON:exists`
      );
      index++;
      return;
    }
    if (shouldPost.isBlacklisted) {
      console.log(
        `skip index:${index}/${estimatedSize} video:${result.id} channel:${result.author.name} REASON:blacklisted`
      );
      index++;
      return;
    }
    if (shouldPost.hasCommentedTooManyTimes) {
      console.log(
        `skip index:${index}/${estimatedSize} video:${result.id} channel:${result.author.name} REASON:commented more than ${MAX_NUMBER_OF_COMMENTS_PER_CHANNEL} times`
      );
      index++;
      return;
    }

    const comment = randomElement(responses);
    const response = await youtube.interact.comment(result.id, comment);
    const { success } = response;
    if (success) {
      try {
        console.log(
          `EXEC index:${index}/${estimatedSize} video:${result.id} channel:${result.author.name} link:https://youtube.com/watch?v=${result.id} comment:${comment}`
        );
        createCommentHistory({
          videoId: result.id,
          videoTitle: result.title.text,
          authorId: result.author.id,
          authorName: result.author.name,
          authorUrl: result.author.url,
          viewCount: result.view_count.text,
          duration: result.duration.seconds,
          searchTerm: searchTerm,
          comment,
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString(),
        });
        index++;
      } catch (error) {
        console.error(error, result.id);
      }
    }
    await setTimeout(DELAY);
  }

  async function processResults(youtube, results) {
    for (let i = 0; i < results.length; i++) {
      await processResult(youtube, results[i]);
    }
  }

  async function fetchNextPage(previousResults) {
    if (previousResults.results && previousResults.results.length) {
      if (typeof previousResults.getContinuation === 'undefined' || typeof previousResults.getContinuation === null) {
        console.warn('Did not find a getContinuation() method on previousResults', Object.keys(previousResults));
        return
      }
      const results = await previousResults.getContinuation();
      await processResults(youtube, results.results);
      debug && saveResultsToFile(results, searchTerm);
      await fetchNextPage(results);
    }
  }
  const results = await youtube.search(searchTerm, {
    upload_date: "today",
    type: "video",
  });

  estimatedSize = results.estimated_results;
  console.log('how many results', estimatedSize);
  await processResults(youtube, results.results);
  debug && saveResultsToFile(results, searchTerm);
  await fetchNextPage(results);
}

Failure Logs

t
/Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:202
                    throw new Utils_1.InnertubeError('There are no continuations');
                          ^

InnertubeError: There are no continuations
    at Search.<anonymous> (/Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:202:27)
    at Generator.next (<anonymous>)
    at /Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:27:12)
    at Search.getContinuationData (/Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:197:16)
    at Search.<anonymous> (/Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:208:29)
    at Generator.next (<anonymous>)
    at /Users/vr/Desktop/code/FINISHED/yt-comment-bot/node_modules/youtubei.js/dist/src/core/Feed.js:31:71
    at new Promise (<anonymous>) {
  date: 2022-11-16T02:56:19.404Z,
  version: '2.3.2'
}

Expected behavior

I should be able to load the next page

Current behavior

Throws an error

Version

Default

Anything else?

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
slidenerdcommented, Nov 16, 2022

Not an issue on the latest version, sorry my bad

0reactions
LuanRTcommented, Nov 16, 2022

Just did a simple test and it seems to be normal behaviour. Code snippet I used:

let search = await yt.search('ghost recon future soldier', { type: 'video', upload_date: 'today' });

while (search.has_continuation) {
  search = await search.getContinuation();
  console.log(search);
}

Which results in:

Search {
  results: [ Message { type: 'Message', text: 'No more results' } ],
  refinements: [],
  estimated_results: 22,
  watch_card: { header: null, call_to_action: null, sections: [] },
  refinement_cards: { header: null, cards: [] }
}

This ‘No more results’ message is also displayed on the website. So I would say not many videos are being uploaded about that topic.

YT app with the exact same query after retrieving two continuations: Screenshot_20221116-005047

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · LuanRT/YouTube.js - GitHub
The console logs told me to open an issue about "Error: GridShow not found!" bug Something isn't working good first issue Good for ......
Read more >
continuation-local-storage - npm
Continuation -local storage works like thread-local storage in threaded programming, but is based on chains of Node-style callbacks instead of threads. The ...
Read more >
Categorical Structure of Continuation Passing Style - CiteSeerX
This thesis attempts to make precise the structure inherent in Continuation Pass- ing Style (CPS). We emphasize that CPS translates -calculus into a...
Read more >
2.3.2 Nonconforming Uses
(B) Continuation, Maintenance and Minor Repair: The continuation of a nonconforming use of land and the maintenance or minor repair of a structure ......
Read more >
on theories t categorical in iti - JSTOR
THEOREM 2.2. If p is a type over A, then there is a type q, jqj < No. such that p U q...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found