This commit is contained in:
Andrey Kondratev
2025-08-28 13:41:56 +05:00
parent 57f0519a32
commit 913f833b8c
4 changed files with 66 additions and 17 deletions

View File

@@ -25,6 +25,7 @@ interface VideoResult {
channel: string;
thumbnail: string;
duration: number;
url: string;
}
interface SearchResponse {
@@ -124,7 +125,7 @@ class QuixoticApp {
}
this.results.innerHTML = videos.map(video => `
<div class="video-item" onclick="app.convertVideo('${video.id}', '${this.escapeHtml(video.title)}')">
<div class="video-item" onclick="app.convertVideo('${video.id}', '${this.escapeHtml(video.title)}', '${this.escapeHtml(video.url)}')">
<img class="video-thumbnail" src="${video.thumbnail}" alt="${this.escapeHtml(video.title)}" loading="lazy">
<div class="video-info">
<div class="video-title">${this.escapeHtml(video.title)}</div>
@@ -144,8 +145,8 @@ class QuixoticApp {
this.noResults.classList.remove('hidden');
}
public async convertVideo(videoId: string, title: string): Promise<void> {
console.log('Convert video called:', { videoId, title });
public async convertVideo(videoId: string, title: string, url: string): Promise<void> {
console.log('Convert video called:', { videoId, title, url });
const videoElement = (event as any)?.currentTarget as HTMLElement;
if (videoElement) {
videoElement.classList.add('converting');
@@ -161,6 +162,7 @@ class QuixoticApp {
body: JSON.stringify({
videoId,
title,
url,
userId: this.tg?.initDataUnsafe?.user?.id || 'demo'
})
});