summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/StorageTo.py14
-rw-r--r--module/web/ServerThread.py1
-rw-r--r--module/web/media/default/css/default.css5
-rw-r--r--module/web/media/default/img/reconnect.pngbin0 -> 755 bytes
-rw-r--r--module/web/templates/default/base.html21
5 files changed, 35 insertions, 6 deletions
diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py
index dbff844ad..a9b1ec4c2 100644
--- a/module/plugins/hoster/StorageTo.py
+++ b/module/plugins/hoster/StorageTo.py
@@ -48,7 +48,12 @@ class StorageTo(Plugin):
pyfile.status.waituntil = self.time_plus_wait
pyfile.status.want_reconnect = self.want_reconnect
- thread.wait(self.parent)
+ while self.want_reconnect:
+ thread.wait(self.parent)
+ self.download_api_data()
+ self.get_wait_time()
+ pyfile.status.waituntil = self.time_plus_wait
+ pyfile.status.want_reconnect = self.want_reconnect
pyfile.status.url = self.get_file_url()
@@ -73,7 +78,10 @@ class StorageTo(Plugin):
self.download_api_data()
if self.api_data["state"] == "wait":
self.want_reconnect = True
- self.time_plus_wait = time() + int(self.api_data["countdown"])
+ else:
+ self.want_reconnect = False
+
+ self.time_plus_wait = time() + int(self.api_data["countdown"]) + 3
@@ -98,7 +106,7 @@ class StorageTo(Plugin):
if not self.html:
self.download_html()
file_name_pattern = r"<span class=\"orange\">Downloading:</span>(.*?)<span class=\"light\">(.*?)</span>"
- return re.search(file_name_pattern, self.html).group(1)
+ return re.search(file_name_pattern, self.html).group(1).strip()
def proceed(self, url, location):
self.req.download(url, location, cookies=True)
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index 7efcc0b75..ffd6a2d35 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -7,7 +7,6 @@ from subprocess import Popen
from subprocess import call
from sys import version_info
import threading
-from time import sleep
class WebServer(threading.Thread):
def __init__(self, pycore):
diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css
index 986e9a4bc..24bb9febf 100644
--- a/module/web/media/default/css/default.css
+++ b/module/web/media/default/css/default.css
@@ -968,7 +968,7 @@ a.urlextern {
background:transparent url(/media/default/img/external-10.2.png) no-repeat scroll right center;
padding:0 13px 0 0;
}
-a[href^="http://www.pyload.org"]:after, a.noextlink:after {
+a[href="http://www.pyload.org"]:after, a.noextlink:after {
background:none;
padding:0;
}
@@ -1008,6 +1008,9 @@ a.play {
a.time {
background:transparent url(/media/default/img/status_None.png) 0px 1px no-repeat;
}
+a.reconnect {
+ background:transparent url(/media/default/img/reconnect.png) 0px 1px no-repeat;
+}
a.play:hover {
background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat;
}
diff --git a/module/web/media/default/img/reconnect.png b/module/web/media/default/img/reconnect.png
new file mode 100644
index 000000000..49b269145
--- /dev/null
+++ b/module/web/media/default/img/reconnect.png
Binary files differ
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html
index 82581da45..27a50a018 100644
--- a/module/web/templates/default/base.html
+++ b/module/web/templates/default/base.html
@@ -76,6 +76,24 @@ function LoadJsonToContent(data)
$("speed").set('text', Math.round(data.speed*100)/100);
$("aktiv").set('text', data.activ);
$("aktiv_from").set('text', data.queue);
+
+ if (data.download) {
+ $("time").set('text', " {% trans "on" %}");
+ $("time").setStyle('background-color', "#8ffc25");
+
+ }else{
+ $("time").set('text', " {% trans "off" %}");
+ $("time").setStyle('background-color', "#fc6e26");
+ }
+
+ if (data.reconnect){
+ $("reconnect").set('text', " {% trans "on" %}");
+ $("reconnect").setStyle('background-color', "#8ffc25");
+ }
+ else{
+ $("reconnect").set('text', " {% trans "off" %}");
+ $("reconnect").setStyle('background-color', "#fc6e26");
+ }
}
function show(){
add_bg.set('opacity', 0);
@@ -180,7 +198,8 @@ function AddBox()
{% if perms.pyload.can_see_dl %}
<ul id="page-actions">
- <li><a class="time">{% trans "Download:" %}<a style=" background-color: #7CFC00; padding-left: 0cm; padding-right: 0.1cm; "> {% trans "on" %}</a></a></li>
+ <li><a class="time">{% trans "Download:" %}<a id="time" style=" background-color: {% if status.download %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.download %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></a></li>
+ <li><a class="reconnect">{% trans "Reconnect:" %}<a id="reconnect" style=" background-color: {% if status.reconnect %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.reconnect %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></a></li>
<li><a class="action backlink">{% trans "Speed:" %} <b id="speed">{{ status.speed }}</b> kb/s</a></li>
<li><a class="action cog">{% trans "Active:" %} <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
<li><a href="" class="action revisions" accesskey="o" rel="nofollow">{% trans "Reload page" %}</a></li>