Warning: session_start(): open(/var/lib/php/sessions/sess_qqrnjjlqvgl7vft6bcn4gp0eeo, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
sclass YouTubeDownloader extends DynModule {
transient JTextArea ta;
transient JTextField tfURL, tfDest;
transient JButton btnGo;
void start {
doEvery(1000, r updateMe);
}
JComponent visualize() {
tfURL = jtextfield();
tfDest = jtextfield(desktopDir());
onEnter(tfURL, r go);
ret northAndCenterWithMargins(
vstackWithSpacing(
centerAndEast(withLabel("Video URL to download:", tfURL), btnGo = jbutton("Download", r go)),
withLabel("Destination directory:", tfDest)),
ta = typeWriterTextArea());
}
void unvisualize() { ta = null; }
void update {
if (ta != null) setText(ta, localPrintLog());
}
void go {
thread "YouTube Download" {
temp tempDisableButton(btnGo);
installOrUpdateYouTubeDL();
youtubeDownloadVideo(formatYouTubeURL(gtt(tfURL)), newFile(gtt(tfDest)));
}
}
}