Quote:
Originally Posted by mgpai
You can query filetype …
|
Yes it works. Thank you very much
Quote:
Originally Posted by pspzockerscene
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) {};
}