View Single Post
  #1903  
Old 30.09.2021, 16:21
mirino mirino is offline
JD VIP
 
Join Date: Mar 2009
Posts: 364
Default

Quote:
Originally Posted by mgpai View Post
You can query filetype …
Yes it works. Thank you very much

Quote:
Originally Posted by pspzockerscene View Post
Wie meinst du das?
Ich brauche bei dem Link (*), siehe Post https://board.jdownloader.org/showpo...postcount=1898, eine andere Abfrage. Ich habe link.linkInfo.group == "VideoExtensions" ausprobiert. Damit funktioniert es: Es wird die .txt-Datei in jedem Video-Fall geschrieben, auch ohne dass eine Video-Description existiert und für andere Videos, als nur für "joinpeertube.org". Hier ist meine aktuelle Version:

Code:
// Write downloadLink, fileName and the videoDescriptionInfo to file.
// Trigger: A download stopped

if (link.finished && link.linkInfo.group == "VideoExtensions") { // query filetype instead of hostname (link.host == "joinpeertube.org")
	var ext = getPath (link.downloadPath).extension;
	var file = link.downloadPath.replace (ext, "txt");
	var data = [link.contentURL, link.name + "\n", link.comment].join("\n") + "\n";

	try {
		writeFile (file, data, true); // 'true' = append, 
		// 'false' = do not append (this will not overwrite the file, 
		// but throw an error if a file with same name exists on disk).
	} catch (e) {};
}

Last edited by mirino; 30.09.2021 at 16:34.
Reply With Quote