mirror of
https://onedev.site.tesses.net/tytd2025
synced 2026-02-08 17:45:45 +00:00
First commit
This commit is contained in:
1
Tesses.YouTubeDownloader.PluginTemplate/src/main.tcross
Normal file
1
Tesses.YouTubeDownloader.PluginTemplate/src/main.tcross
Normal file
@@ -0,0 +1 @@
|
||||
func PluginInit() new Plugin();
|
||||
29
Tesses.YouTubeDownloader.PluginTemplate/src/plugin.tcross
Normal file
29
Tesses.YouTubeDownloader.PluginTemplate/src/plugin.tcross
Normal file
@@ -0,0 +1,29 @@
|
||||
/^
|
||||
%PROJECT_NAME Class
|
||||
^/
|
||||
class Plugin {
|
||||
public Plugin()
|
||||
{
|
||||
/*
|
||||
You can access these anywhere in the plugin
|
||||
|
||||
TYTD.GetVideoId(id): get the youtube video id from url or id
|
||||
TYTD.GetPlaylistId(id): get the youtube playlist id from url or id
|
||||
TYTD.GetChannelId(id): get the youtube channel id from url or id
|
||||
TYTD.Config[key]: get a string setting for this plugin
|
||||
TYTD.Config[key] = value: set a string setting for this plugin (is presistant)
|
||||
TYTD.Config.Directory: a crosslang SubdirFilesystem for the Files directory in plugin directory
|
||||
TYTD.Config.DirectoryPath: same directory but the actual path of it for FS.Local
|
||||
|
||||
Resolution, SubscriptionBell, TYTD.Downloader (the instance, you can't create your own instance of it): See https://cpkg.tesseslanguage.com/package_docs?name=Tesses.YoutubeDownloader&version=1.0.0.0-prod
|
||||
|
||||
*/
|
||||
Console.WriteLine("Run your initialization here");
|
||||
}
|
||||
|
||||
public Server = new PluginServer();
|
||||
public Close()
|
||||
{
|
||||
Console.WriteLine("Do any finishing work");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class PluginServer
|
||||
{
|
||||
public Handle(ctx)
|
||||
{
|
||||
ctx.WithMimeType().SendText(<div><h1>Hello, world from @%PROJECT_NAME<h1><p>Path: {ctx.Path}, OriginalPath: {ctx.OriginalPath}</p></div>);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user