[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell-Script auf einem Debian-System funktioniert nicht



Mathias Malum schrieb:
Hallo Leute,

auf einem Debian-System mit Lenny funktioniert ein Shell-Script nicht.
Danke an alle die geholfen haben.

Ich habe es aber nicht so hin bekommen, wie ich es wollte. Übrig geblieben ist das unten stehende Fragment eines Greasemonkes-Scripts.

Hinweis: Es handelt sich um ein User-Script für die Firefox-Extension eines _Debian_-Systems!

Mathias


// ==UserScript==
// @name          Download arte Videos
// @description Adds a link to download the WMV file under every video in arte.
// @include       http://plus7.arte.tv/*
// ==/UserScript==

function create_link (title, format, quality, url) {
   var title = title;
   //alert(format + ' - ' + quality + ' - ' + url);

   // link
   var link = document.createElement('a');
   link.href= url;
var txt = document.createTextNode("Download \"" + title + "\" | Format: " + quality + " | Quality: " + format); link.appendChild(txt);
   var div = document.createElement("div");
   div.align = "left";
   div.appendChild(link);
   document.getElementById('menu').appendChild(div);

   // textarea
   shell = "\nFor Linux-User only!!!\n";
   shell += "Copy this text in a terminal:\n\n";
var title = title.replace(/ /g, " ");
   var title = title.replace(/ /g, "_");
   var title = title.replace(/:/g, "-");
   var title = title.replace(/\s/g, "");
shell += "mplayer -dumpstream -dumpfile \"" + title + "\".wmv `wget -O - -q " + url + " |grep mms |awk -F\\\" '{print $2}'`\n";
   shell+="\n\n";
var pre = document.createElement('pre');
   var style = document.createAttribute("style");
style.nodeValue = "font-family:monospace, font-size:10px; color:black; background-color:white;";
   pre.setAttributeNode(style);

var txt = document.createTextNode(shell); pre.appendChild(txt); var div = document.createElement("div"); div.appendChild(pre);
   document.getElementById('barre_nav_site').appendChild(div);
}


(function() {
   // availableFormats = there is a js variable?
   var swfArgs = unsafeWindow.availableFormats;
   if (swfArgs) {
       //alert("Video(s) available");
       title = document.getElementsByTagName('h2')[0].firstChild.data;
       for (var i = 0; i < swfArgs.length ; i++) {
if (swfArgs[i]["quality"] == "HQ" && swfArgs[i]["format"] == "WMV") { create_link(title, swfArgs[i]["format"], swfArgs[i]["quality"], swfArgs[i]["url"]);
           }
};
   };

})();



Reply to: