Fix downloader bug, use plink and add icon to plugin template

This commit is contained in:
2025-12-28 13:28:50 -06:00
parent abe5ce7fba
commit 2eff24d67b
12 changed files with 21 additions and 17 deletions

View File

@@ -24,8 +24,10 @@
}, },
"template_project_dependencies": [ "template_project_dependencies": [
], ],
"type": "template" "type": "template",
"template_icon": "icon.png"
}, },
"name": "Tesses.YouTubeDownloader.PluginTemplate", "name": "Tesses.YouTubeDownloader.PluginTemplate",
"version": "1.0.0.0-prod" "version": "1.0.0.0-prod",
"icon": "icon.png"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -2,16 +2,6 @@ func Components.PersonalListDescription(tytd,name,editing)
{ {
var description = tytd.GetPersonalListDescription(name); var description = tytd.GetPersonalListDescription(name);
var first=true; var first=true;
var description_with_br = "";
each(var txt : description.Split("\n"))
{
if(!first)
{
description_with_br += <br>;
}
description_with_br += Net.Http.HtmlEncode(txt);
first=false;
}
<return> <return>
<if(editing)> <if(editing)>
<true> <true>
@@ -32,7 +22,7 @@ func Components.PersonalListDescription(tytd,name,editing)
<false> <false>
<div class="row" id="description"> <div class="row" id="description">
<div class="max"> <div class="max">
<p><raw(description_with_br)></p> <plink(description)>
</div> </div>
<div class="min"> <div class="min">
<button hx-get={$"./edit-personal-description?name={Net.Http.UrlEncode(name)}"} hx-target="#description" hx-swap="outerHTML"><i>edit</i></button> <button hx-get={$"./edit-personal-description?name={Net.Http.UrlEncode(name)}"} hx-target="#description" hx-swap="outerHTML"><i>edit</i></button>

View File

@@ -20,7 +20,7 @@ func Pages.VideoInfo(tytd,ctx)
<div class="min"> <div class="min">
<h4>{vi.title}</h4> <h4>{vi.title}</h4>
<a class="underline" href={$"./channel?id={Net.Http.UrlEncode(vi.channelId)}"}>{vi.author}</a> <a class="underline" href={$"./channel?id={Net.Http.UrlEncode(vi.channelId)}"}>{vi.author}</a>
<p>{vi.shortDescription}</p> <plink(vi.shortDescription)>
</div> </div>
</div>; </div>;

View File

@@ -28,6 +28,7 @@ class TYTD.AOVideoDownload : IVideoDownload {
var req = this.tytd.ManifestRequest(id).playerResponse; var req = this.tytd.ManifestRequest(id).playerResponse;
this.info.Title = req.videoDetails.title; this.info.Title = req.videoDetails.title;
tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Audio"); tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Audio");
Console.WriteLine($"Downloading: {this.info.Title} with id: {id} Highest Audio");
this.info.Channel = req.videoDetails.author; this.info.Channel = req.videoDetails.author;
this.info.ChannelId = req.videoDetails.channelId; this.info.ChannelId = req.videoDetails.channelId;
@@ -66,6 +67,7 @@ class TYTD.AOVideoDownload : IVideoDownload {
} }
public Start() public Start()
{ {
if(this.done) return;
for(var i = 0; i < 5; i++) for(var i = 0; i < 5; i++)
{ {
var req = { var req = {

View File

@@ -7,6 +7,7 @@ class TYTD.NoConvertVideoDownload : IVideoDownload {
private done=false; private done=false;
public NoConvertVideoDownload(id) public NoConvertVideoDownload(id)
{ {
this.info = { this.info = {
@@ -36,6 +37,7 @@ class TYTD.NoConvertVideoDownload : IVideoDownload {
this.info.Title = req.videoDetails.title; this.info.Title = req.videoDetails.title;
tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Video/Audio"); tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Video/Audio");
Console.WriteLine($"Downloading: {this.info.Title} with id: {id} Highest Video/Audio");
this.info.Channel = req.videoDetails.author; this.info.Channel = req.videoDetails.author;
this.info.ChannelId = req.videoDetails.channelId; this.info.ChannelId = req.videoDetails.channelId;
@@ -220,5 +222,7 @@ class TYTD.NoConvertVideoDownload : IVideoDownload {
} }
} }
this.progress(1.0); this.progress(1.0);
return;
} }
} }

View File

@@ -28,6 +28,7 @@ class TYTD.SDVideoDownload : IVideoDownload {
var req = this.tytd.ManifestRequest(id).playerResponse; var req = this.tytd.ManifestRequest(id).playerResponse;
this.info.Title = req.videoDetails.title; this.info.Title = req.videoDetails.title;
tytd.LOG($"Downloading: {this.info.Title} with id: {id} LowVideo"); tytd.LOG($"Downloading: {this.info.Title} with id: {id} LowVideo");
Console.WriteLine($"Downloading: {this.info.Title} with id: {id} LowVideo");
this.info.Channel = req.videoDetails.author; this.info.Channel = req.videoDetails.author;
this.info.ChannelId = req.videoDetails.channelId; this.info.ChannelId = req.videoDetails.channelId;
@@ -48,6 +49,7 @@ class TYTD.SDVideoDownload : IVideoDownload {
} }
public Start() public Start()
{ {
if(this.done) return;
for(var i = 0; i < 5; i++) for(var i = 0; i < 5; i++)
{ {
var req = { var req = {

View File

@@ -3,6 +3,7 @@ class TYTD.TranscodeAudio : IVideoDownload {
private ncv; private ncv;
private tytd; private tytd;
private ext; private ext;
private done;
public TranscodeAudio(id,ext) public TranscodeAudio(id,ext)
{ {
@@ -30,7 +31,7 @@ class TYTD.TranscodeAudio : IVideoDownload {
public Start() public Start()
{ {
var id = this.id; var id = this.id;
this.ncv.Start(); if(!this.ncv.Start()) return;
var p = new Process(); var p = new Process();
p.FileName = Env.GetRealExecutablePath("ffmpeg").ToString(); p.FileName = Env.GetRealExecutablePath("ffmpeg").ToString();

View File

@@ -30,7 +30,7 @@ class TYTD.TranscodeVideo : IVideoDownload {
public Start() public Start()
{ {
var id = this.id; var id = this.id;
this.ncv.Start(); this.mcv.Start();
var p = new Process(); var p = new Process();
p.FileName = Env.GetRealExecutablePath("ffmpeg").ToString(); p.FileName = Env.GetRealExecutablePath("ffmpeg").ToString();

View File

@@ -30,6 +30,8 @@ class TYTD.VOVideoDownload : IVideoDownload {
this.info.Channel = req.videoDetails.author; this.info.Channel = req.videoDetails.author;
this.info.ChannelId = req.videoDetails.channelId; this.info.ChannelId = req.videoDetails.channelId;
tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Video"); tytd.LOG($"Downloading: {this.info.Title} with id: {id} Highest Video");
Console.WriteLine($"Downloading: {this.info.Title} with id: {id} Highest Video");
this.tytd.PutVideoInfo(req.videoDetails); this.tytd.PutVideoInfo(req.videoDetails);
var width = 0; var width = 0;
@@ -63,6 +65,7 @@ class TYTD.VOVideoDownload : IVideoDownload {
} }
public Start() public Start()
{ {
if(this.done) return;
var req = { var req = {
FollowRedirects = true, FollowRedirects = true,
RequestHeaders = [ RequestHeaders = [