Video Error 153 and Empty Video Feeds

By
dracoblue
May 17, 2026

My next #notai generated post is about another day of developing the kiesel app. This day is on empty video lists and a YouTube Error 153 which I thought was a temporary error and ended up having a useful root cause.

Empty Video Feed

The feed of the kiesel.app is full of all kinds of embedded contents or original posts. The video feed on the other hand is meant to show only videos (like the audio feed for audio and image for image feed). I wanted to lazy load next page if the current page is empty. But the first page often had no videos at all - the filter and pagination collided: there are 50 posts in the timeline, 3 of them are videos and the tab: empty. The simple code was changed until it had all current cases included and looks like this:

  useEffect(() => {
    const hasCursor = Object.values(cursors).some((c) => !!c);
    if (
      !isLoading &&
      mediaFilter !== "posts" &&
      filteredFeed.length < 5 &&
      hasCursor &&
      feed.length > 0
    ) {
      loadFeed("more");
    }
  }, [filteredFeed.length, mediaFilter, isLoading]);

As you can see the loadFeed is triggered as soon as we are not loading, are not on the posts page and have less than 5 items visible. And of course only if the feed is visible at all.

Duplicate Videos

Shortly after the reposted videos appeared 3 times in a row in the feed. Why? Because of reposts.

So time for some straight forward dedup:

  const seen = new Set<string>();
  const deduped = posts.filter((p) => {
    const k = `${p.protocol}:${p.uri}`;
    if (seen.has(k)) return false;
    seen.add(k);
    return true;
  });

And now only the first time a video is in a feed it will be visible.

YouTube Error 153

The error code itself is documented at youtube iframe api and says:

The request does not include the HTTP Referer header or equivalent API Client identification

but I thought it was an embedding error. So I added an error boundary with the possibility to open the video in the inapp browser or externally. But it did not work for ANY of the videos. So something odd was going on.

The final fix was easy:

  <WebView
    source={{ html: embedHtml, baseUrl: "https://kiesel.app" }}
    style={styles.webview}
    allowsInlineMediaPlayback
    mediaPlaybackRequiresUserAction
    javaScriptEnabled
    scrollEnabled={false}
    // …
  />

As you can see the baseUrl is set and makes the iframe happy. The error boundary was removed. Less code, less noise.

See you in the next dev day post!