From 9cea4e42e4619d0724f636d040c94128b181f719 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 30 May 2020 19:24:24 +0200 Subject: Added debian/ --- html/Downtube.png | Bin 0 -> 40244 bytes html/Downtube1024.png | Bin 0 -> 19108 bytes html/Downtube256.png | Bin 0 -> 4216 bytes html/Downtube320.png | Bin 0 -> 5256 bytes html/Downtube512.png | Bin 0 -> 8874 bytes html/downtube.css | 69 +++++++++++++++++++++++++++++++ html/downtube.js | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ html/index.html | 53 ++++++++++++++++++++++++ 8 files changed, 234 insertions(+) create mode 100644 html/Downtube.png create mode 100644 html/Downtube1024.png create mode 100644 html/Downtube256.png create mode 100644 html/Downtube320.png create mode 100644 html/Downtube512.png create mode 100644 html/downtube.css create mode 100644 html/downtube.js create mode 100644 html/index.html (limited to 'html') diff --git a/html/Downtube.png b/html/Downtube.png new file mode 100644 index 0000000..4b2d0b7 Binary files /dev/null and b/html/Downtube.png differ diff --git a/html/Downtube1024.png b/html/Downtube1024.png new file mode 100644 index 0000000..574a352 Binary files /dev/null and b/html/Downtube1024.png differ diff --git a/html/Downtube256.png b/html/Downtube256.png new file mode 100644 index 0000000..44da8e6 Binary files /dev/null and b/html/Downtube256.png differ diff --git a/html/Downtube320.png b/html/Downtube320.png new file mode 100644 index 0000000..254b362 Binary files /dev/null and b/html/Downtube320.png differ diff --git a/html/Downtube512.png b/html/Downtube512.png new file mode 100644 index 0000000..6ebd151 Binary files /dev/null and b/html/Downtube512.png differ diff --git a/html/downtube.css b/html/downtube.css new file mode 100644 index 0000000..2f68794 --- /dev/null +++ b/html/downtube.css @@ -0,0 +1,69 @@ +body { + font-family: "sans-serif"; +} + +figcaption { + text-align: center; + font-size: 8px; + color: #808080; +} + +figure { + display: inline-block; +} + +p { + margin: 30px 0px 30px 0px; +} + +div.status { + color: #FF0000; +} + +.mobile { + width: 300px; + border-width: 80px 15px 80px 15px; + border-style: solid; + border-radius: 30px; + border-color: #000000; +} + +.logo { + display: block; + margin: 0 auto; +} + +.screenshot { + width: 400px; + border: 2px solid; + border-color: #8888AA; +} + +img.banner { + vertical-align: -5px; +} + +.button { + color:#FFFFFF; + background-color:#50B050; + text-decoration: none; + padding: 15px 20px; + font-size: 16px; + border: none; + border-radius: 6px; + cursor: pointer; +} + +@media only screen and (min-width: 1px) and (max-width: 630px) { +} + +@media only screen and (min-width: 631px) and (max-width: 950px) { +} + +@media only screen and (min-width: 951px) { + div.page { + max-width: 950px; + width: 100%; + margin: 0 auto; + } +} diff --git a/html/downtube.js b/html/downtube.js new file mode 100644 index 0000000..abe62b8 --- /dev/null +++ b/html/downtube.js @@ -0,0 +1,112 @@ +// started on main page load +function init() { + + // Connect "Enter" in text field with Button click + var url = document.getElementById("url"); + url.addEventListener("keyup", function(event) { + if (event.keyCode === 13) { + event.preventDefault(); + on_start(); + } + }); +} + +function set_status(message) { + if (message == "") + message = " "; + + document.getElementById("status").innerHTML = message; +} + +// started on button click: get filename +function on_start() { + var xhr = new XMLHttpRequest(); + + // run on data received back + xhr.onreadystatechange = function() { + if (this.readyState != 4) { + return; + } + if (this.status != 200) { + set_status("Server Error while retrieving filename"); + return; + } + + var filename = this.responseText; + + get_file(filename); + } + + var parser = new DOMParser(); + var xmlDocument = parser.parseFromString("", "text/xml"); + + var requestElement = xmlDocument.getElementsByTagName("request")[0]; + + var commandElement = xmlDocument.createElement("command"); + commandElement.appendChild(document.createTextNode("getfilename")); + requestElement.appendChild(commandElement); + + var urlElement = xmlDocument.createElement("url"); + urlElement.appendChild(document.createTextNode(document.getElementById("url").value)); + requestElement.appendChild(urlElement); + + var formatElement = xmlDocument.createElement("format"); + formatElement.appendChild(document.createTextNode(document.getElementById("mp3").checked ? "mp3" : "mp4")); + requestElement.appendChild(formatElement); + + xhr.open("POST", "downtube.fcgi", true); + xhr.setRequestHeader("Content-type", "text/xml"); + xhr.responseType = 'text'; + xhr.send(xmlDocument); + + set_status("Please wait while retrieving filename..."); +} + +// started on button click: get file +function get_file(filename) { + var xhr = new XMLHttpRequest(); + + // run on data received back + xhr.onreadystatechange = function() { + if (this.readyState != 4) { + return; + } + if (this.status != 200) { + set_status("Server Error while retrieving " + filename); + return; + } + + var a = document.getElementById("download-a"); + a.setAttribute("download", filename); + var file = new Blob([this.response]); + a.href = window.URL.createObjectURL(file); + a.click(); + + set_status(""); // OK + } + + var parser = new DOMParser(); + var xmlDocument = parser.parseFromString("", "text/xml"); + + var requestElement = xmlDocument.getElementsByTagName("request")[0]; + + var commandElement = xmlDocument.createElement("command"); + commandElement.appendChild(document.createTextNode("getfile")); + requestElement.appendChild(commandElement); + + var urlElement = xmlDocument.createElement("url"); + urlElement.appendChild(document.createTextNode(document.getElementById("url").value)); + requestElement.appendChild(urlElement); + + var formatElement = xmlDocument.createElement("format"); + formatElement.appendChild(document.createTextNode(document.getElementById("mp3").checked ? "mp3" : "mp4")); + requestElement.appendChild(formatElement); + + xhr.open("POST", "downtube.fcgi", true); + xhr.setRequestHeader("Content-type", "text/xml"); + xhr.responseType = 'blob'; + xhr.send(xmlDocument); + + set_status("Please wait while retrieving " + filename + " ..."); +} + diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..05ab9d6 --- /dev/null +++ b/html/index.html @@ -0,0 +1,53 @@ + + + + + + + DownTube + + + + + +
+

+ +

+ Video URL:
+

+

+ +

+ Transform to format:
+ +
+ +
+

+ +
+
 
+

+ +

+ +
+
+
+
+
+
+
+
+

Contact

+ Roland Reichwein
+ Hauptstr. 101a
+ 82008 Unterhaching
+ mail@reichwein.it
+ https://www.reichwein.it
+
+ + + + -- cgit v1.2.3