Skip to content

Weekly

Remove duplicates and dead videos from playlists

Each week duplicate, deleted and private videos are taken out of your playlists, with a log of what went.

Runs
Weekly
Apps
YouTube
AI
Not needed
Access
youtube (read+write)

Send this to your assistant

Create a ClickRuntime automation: every Sunday, remove duplicate, deleted and private videos from my playlists and email me what was removed.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Playlists decay quietly. A video is added twice by accident, a creator deletes a video, another is set to private, and the playlist now shows greyed-out entries that cannot be played. A visitor who clicks through your best-of list hits three dead items, and the polish you put into curating it is lost.

Every week, the items in your playlists are read, and duplicates by video ID and unavailable entries, meaning deleted or private videos, are identified and removed. A log is emailed to you showing which items were taken out and from which playlist.

Channels with long-running playlists, teachers who share reading lists with students and brands whose playlists are embedded on their website will find it the most useful. Your lists stay playable all year, with no quarterly audit of grey, unplayable rows.

What you get out of it

  • Playlists look looked-after

    Removing dead entries and duplicates means anyone who plays through your list gets a smooth experience, which reflects well on the channel. Viewers judge the whole channel by how smoothly a list plays.

  • Embedded playlists stay clean

    A playlist embedded on your website or in a course page is visible to many people, so broken items there cost more than on YouTube itself. A broken item on your own website looks worse than one buried inside YouTube.

  • Duplicates stop inflating the list

    A playlist that claims 60 videos but contains 8 repeats misleads viewers and wastes their time, and a weekly check keeps the count honest. Honest counts help viewers decide whether a playlist is worth their time.

  • Nothing is removed in secret

    The emailed log names each item and playlist touched, so you can restore a video that was marked private by mistake before it is lost from the list. Checking the log first means a video hidden by mistake can be restored before it is lost.

  • Little manual maintenance

    Instead of opening every playlist once a quarter to hunt for grey rows, the check runs on its own, and you only act when the log shows something unusual. Exceptions are rare, so your attention is needed only when the log shows something strange.

How it works

What happens, step by step

  1. Every week, ClickRuntime goes through the videos in your YouTube playlists.

  2. It finds videos that appear twice in the same playlist, and videos that have been deleted or made private.

  3. It removes those from the playlist.

  4. You get an email log of what was removed from which playlist, and why.

Before it runs live

  • Connect YouTube

What you get

RunsWeekly
Remove duplicates and dead videos from playliststoday, 9:00Succeeded
Email · Removed 3 playlist itemsTutorials: Deleted video (unavailable) Customer stories: Acme case study (duplicate)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other YouTube steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
playlist_cleanup.pyexample
from clickruntime import on_trigger, credentials, http, notify

YT = "https://www.googleapis.com/youtube/v3"

@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
    playlists = http.get(f"{YT}/playlists", headers=h, params={"part": "snippet", "mine": "true", "maxResults": 50}).json()["items"]
    removed = []
    for pl in playlists:
        items = http.get(f"{YT}/playlistItems", headers=h, params={"part": "snippet,status", "playlistId": pl["id"], "maxResults": 50}).json()["items"]
        seen = set()
        for it in items:
            vid = it["snippet"]["resourceId"]["videoId"]
            gone = it["snippet"]["title"] in ("Deleted video", "Private video") or it.get("status", {}).get("privacyStatus") == "private"
            if vid in seen or gone:
                http.delete(f"{YT}/playlistItems", headers=h, params={"id": it["id"]})
                removed.append(f"{pl['snippet']['title']}: {it['snippet']['title']} ({'duplicate' if vid in seen else 'unavailable'})")
            seen.add(vid)
    if removed:
        notify.email_me(f"Removed {len(removed)} playlist items", "\n".join(removed))
    return {"removed": len(removed)}

FAQ

Common questions

How does it decide a video is a duplicate?
It compares video IDs within the same playlist. If the same video appears twice, one copy is removed. The same video appearing in two different playlists is not a duplicate, since each playlist is treated separately.
Will it remove videos that are only temporarily private?
A private video shows as unavailable while it is private, so it can be removed. If you plan to republish videos, tell your AI assistant to leave private ones alone, or run it in report-only mode to review first.
Can it clean playlists I do not own?
No. It can only change playlists in the account connected to ClickRuntime. For playlists owned by others, such as a shared playlist from a collaborator, you would need access through that owner's account. Only your own playlists can be cleaned.
What permissions does it need?
youtube (read+write). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Remove duplicates and dead videos from playlists” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.