Skip to content

Commit 11dfc32

Browse files
committed
feat: enhance YouTube download UI with loading markdown and RPC initialization
- Add Markdown UI for displaying loading information - Reorder RPC initialization in load method - Bump package version to 0.1.5
1 parent bb4f392 commit 11dfc32

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kunkun/kunkun-ext-youtube-downloader",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"license": "MIT",
55
"exports": "./mod.ts",
66
"imports": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.kunkun.sh",
33
"name": "kunkun-ext-youtube-dowloader",
4-
"version": "0.1.4",
4+
"version": "0.1.5",
55
"license": "MIT",
66
"type": "module",
77
"kunkun": {

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
toast,
1717
ui,
1818
TemplateUiCommand,
19+
Markdown,
1920
} from "@kksh/api/ui/template";
2021
import type { API } from "./api";
2122
import * as v from "valibot";
@@ -169,7 +170,6 @@ class DownloadYouTubeExtension extends TemplateUiCommand {
169170
});
170171
}
171172
async load() {
172-
this.rpc = await getRpcAPI();
173173
const ffmpegExists = await shell.hasCommand("ffmpeg");
174174
if (!ffmpegExists) {
175175
toast.error("ffmpeg not found", {
@@ -186,6 +186,16 @@ class DownloadYouTubeExtension extends TemplateUiCommand {
186186
toast.warning("Invalid YouTube URL from clipboard");
187187
return ui.goBack();
188188
}
189+
190+
ui.render(
191+
new Markdown(`
192+
# Download YouTube Video
193+
194+
Loading Information from YouTube URL: ${url}
195+
`)
196+
);
197+
198+
this.rpc = await getRpcAPI();
189199
const formats = await this.rpc.api.getAvailableResolutions(url);
190200
const form = new Form.Form({
191201
title: "Download YouTube Video",

0 commit comments

Comments
 (0)