# Auto Twitch Clip Scanner

**URL:** <https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279>\
**Category:** Approved\
**Tags:** chat, twitch\
**Created:** [September 12, 2023, 2:53am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279 "2023-09-12T02:53:44Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 12, 2023, 2:53am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/1 "2023-09-12T02:53:44Z")

</div>

## Description

This extension will run once per minute using the Present Viewers trigger to check for any new clips created within the scan interval. If any new clips are found, then a custom `New Twitch Clip Found` event will be triggered. Also included: a `!clip` command to create a clip via Chat and post to Chat/Discord, using this command will avoid the New Twitch Clip Found event from being triggered multiple times.

## Import Code

[autoTwitchClipScanner\_v0.2.3-3.sb](https://extensions.streamer.bot/uploads/short-url/iEg31pzKzBR1RAgOg9JkT4ljtqV.sb) (18.0 KB)

## Installation

1. Download the import code file
2. Click the Import button to open the Import dialog
3. Drag and drop the `autoTwitchClipScanner_v0.2.3-3.sb` file into the Import String box and then click Import

 ![image](https://extensions.streamer.bot/uploads/default/original/2X/d/dd463a44d01360e9b8e76c9bfb791d430d588d08.png)

## Configuration

### Posting clips only if title is unique

- Set `postUniqueTitlesOnly` to `True` if you only want to post clips that have a title that is different from the channel title

The two settings below use the following syntax for time spans:

| Postfix Symbol | Usage | Explanation |
| --- | --- | --- |
| `d` | 4d | 4 days |
| `h` | 4d3h | 4 days, 3 hours |
| `m` | 4d3h2m | 4 days, 3 hours, 2 minutes |
| `s` | 4d3h2m1s | 4 days, 3 hours, 2 minutes, 1 second |

### Scan Clips Interval

- The `scanClipsWithinLast` argument is the time span of how far back you want to scan clips for
  - This is set by default to `30d`, or 30 days
  - If you have a lot of clips, you may want to shorten the scan time span interval

 ![image](https://extensions.streamer.bot/uploads/default/original/2X/5/52b703d7823fff309c93dd2c8498b9e9a188aef4.png)

### Post Clips Interval

- The `postClipsWithinLast` argument is the time span of which clips you want to post if found
  - This is set by default to `8h`, or 8 hours, meaning any clips found within this time span will trigger the `New Twitch Clip Found` event
  - Make sure this time span is shorter than the Scan Clips Interval

 ![image](https://extensions.streamer.bot/uploads/default/original/2X/8/806572ac9d0d744b9e758dd5d2e4fabde75d2d90.png)

## New Twitch Clip Found

This is an example action that uses the New Twitch Clip Found Custom Trigger. It will be triggered if new Twitch clips are found. The trigger will populate the following variables:

### Variable List

| Variable Name | Explanation |
| --- | --- |
| `%clipId%` | An ID that uniquely identifies the clip. |
| `%clipUrl%` | A URL to the clip. |
| `%clipEmbedUrl%` | A URL that you can use in an iframe to embed the clip |
| `%clipCreatorId%` | An ID that identifies the user that created the clip. |
| `%clipCreatorUserName%` | The user’s display name. |
| `%clipVideoId%` | An ID that identifies the video that the clip came from. This field contains an empty string if the video is not available. |
| `%clipGameId%` | The ID of the game that was being played when the clip was created. |
| `%clipGameTitle%` | Title of the clip category |
| `%clipGameArtUrl%` | A URL to a thumbnail for the clip category |
| `%clipLanguage%` | The ISO 639-1 two-letter language code that the broadcaster broadcasts in. For example, _en_ for English. The value is _other_ if the broadcaster uses a language that Twitch doesn’t support. |
| `%clipTitle%` | The title of the clip. |
| `%clipCreatedAt%` | The date and time of when the clip was created. The date and time is in RFC3339 format. |
| `%clipThumbnailUrl%` | A URL to a thumbnail image of the clip. |
| `%clipDuration%` | The length of the clip, in seconds. |
| `%clipIsFeatured%` | A Boolean value that indicates if the clip is featured or not. |

- By default, a Twitch Chat Message subaction will read:

```plaintext
%clipCreatorUserName% created a clip with title '%clipTitle%': %clipUrl%

```

- You may also use something like a Discord Basic Webhook subaction to post the clip in a #twitch-clips channel on your community Discord server

 ![image](https://extensions.streamer.bot/uploads/default/original/2X/e/e2ab0ad3ce38629e17b3cfe3469fe30711b00f4b.png)

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 12, 2023, 6:45am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/2 "2023-09-12T06:45:58Z")

</div>

v1.0.1 - added an option `postUniqueTitlesOnly` to post only if the clip title is different from the channel title

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 12, 2023, 8:26pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/3 "2023-09-12T20:26:15Z")

</div>

v1.0.2 - added option for logging to a set of json files for debugging purposes

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 24, 2023, 11:05pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/4 "2023-09-24T23:05:43Z")

</div>

v1.0.6 - After some debugging, I think I can get some consistent results. I’ve cleaned up the logging code. If you need any logging, test the Test Trigger.

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 25, 2023, 6:52am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/5 "2023-09-25T06:52:04Z")

</div>

v1.0.7 - Fixed a bug preventing a clip from posting to discord

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [September 25, 2023, 7:35pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/6 "2023-09-25T19:35:00Z")

</div>

v1.0.8 - Fixed another silly bug

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [February 15, 2024, 5:27am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/7 "2024-02-15T05:27:46Z")

</div>

v2.0.1 - Updated the extension to just trigger a `New Twitch Clip Found` event when a new Twitch Clip is found. Much easier to set up

---

<div class="post-metadata">

**Author:** ![krak8](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/krak8/32/1325_2.png) [@krak8](https://extensions.streamer.bot/u/krak8)\
**Post date:** [February 15, 2024, 11:41am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/8 "2024-02-15T11:41:24Z")

</div>

This is what I was looking for ! ❤

---

<div class="post-metadata">

**Author:** ![krak8](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/krak8/32/1325_2.png) [@krak8](https://extensions.streamer.bot/u/krak8)\
**Post date:** [February 17, 2024, 3:40pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/9 "2024-02-17T15:40:21Z")

</div>

is it possible to get stream title? or am I missing something

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [February 17, 2024, 6:51pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/10 "2024-02-17T18:51:14Z")

</div>

> [@rondhi](#):
>
> `%clipTitle%` The title of the clip.

Stream Title? Independent of the `%clipTitle%` variable? That can be done by adding a `Get User Info for Target`, setting it to Broadcaster, and then using the `%targetChannelTitle%` variable

---

<div class="post-metadata">

**Author:** ![krak8](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/krak8/32/1325_2.png) [@krak8](https://extensions.streamer.bot/u/krak8)\
**Post date:** [February 18, 2024, 6:46am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/11 "2024-02-18T06:46:35Z")

</div>

I was looking for stream title. Oh thanks that worked 😄

---

<div class="post-metadata">

**Author:** ![krak8](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/krak8/32/1325_2.png) [@krak8](https://extensions.streamer.bot/u/krak8)\
**Post date:** [February 19, 2024, 3:49pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/12 "2024-02-19T15:49:19Z")

</div>

> > [@rondhi](#):
> >
> > `%clipTitle%` The title of the clip.
> 
> Stream Title? Independent of the `%clipTitle%` variable? That can be done by adding a `Get User Info for Target`, setting it to Broadcaster, and then using the `%targetChannelTitle%` variable

![Screenshot 2024-02-19 211057](https://extensions.streamer.bot/uploads/default/original/2X/3/37326b5fca52901e419810b8cd018cd20a29ed05.png)

The stream title wont work even though I did as you said!  
this is the screenshot of the SB 👇  
 ![Screenshot 2024-02-19 211742](https://extensions.streamer.bot/uploads/default/original/2X/2/201c489721adac32e1fa9c6b8a600dc425ae1384.png)

Can you tell what am I doing wrong?  
coz `%targetChannelTitle%` wont work.

---

<div class="post-metadata">

**Author:** ![rondhi](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rondhi/32/24_2.png) [@rondhi](https://extensions.streamer.bot/u/rondhi)\
**Post date:** [February 19, 2024, 4:04pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/13 "2024-02-19T16:04:24Z")

</div>

![image](https://extensions.streamer.bot/uploads/default/original/2X/d/dc27870422cccd3b8b4a33eff75033950013903a.png)  
Looks like you used the wrong subaction. `Twitch > User > Get User Info for Target` and set it to `Broadcaster`, then move that subaction to the top.

---

<div class="post-metadata">

**Author:** ![krak8](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/krak8/32/1325_2.png) [@krak8](https://extensions.streamer.bot/u/krak8)\
**Post date:** [February 19, 2024, 5:54pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/14 "2024-02-19T17:54:15Z")

</div>

![Screenshot 2024-02-19 232048](https://extensions.streamer.bot/uploads/default/original/2X/0/08e219bb380b6f6c05a874535630445487756e36.png)

Ye its showing the stream title now !  
Thanks for the help ! ❤

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [March 2, 2024, 11:16pm UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/15 "2024-03-02T23:16:01Z")

</div>



---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [March 3, 2024, 12:03am UTC](https://extensions.streamer.bot/t/auto-twitch-clip-scanner/279/16 "2024-03-03T00:03:20Z")

</div>


