Repository: pyload/pyload

Issue:
ShareOnline still not working
After a while ShareOnline isn´t able to run as premium user.

<pre><code>
04.08.2015 02:24:41 INFO      Download starts: itg-dark.matter-ded-hdtv-x264-107.part1.rar
04.08.2015 02:24:41 INFO      ACCOUNT ShareonlineBiz: Relogin user `XXXXXXXXXXX`...
04.08.2015 02:24:41 WARNING   ACCOUNT ShareonlineBiz: Could not login user `XXXXXXXXXXX` | 'password'
</code></pre>



Discussion:
Here is the debug log from it:

<pre><code>
04.08.2015 13:43:20 INFO    Download starts: tvs-defiance-dl-hdtv-x264-306.part4.rar
285 04.08.2015 13:43:20 DEBUG   ACCOUNT ShareonlineBiz: Reached login timeout for XXXXXXXXXXX
286 04.08.2015 13:43:20 INFO    ACCOUNT ShareonlineBiz: Relogin user `XXXXXXXXXXX`...
287 04.08.2015 13:43:20 WARNING ACCOUNT ShareonlineBiz: Could not login user `XXXXXXXXXXX` | 'password'
</code></pre>

@wastez I don't have a premium account to test..
Also, after how much time does this occur?

Last time it happens after i tried to download a file 20 minutes after the start of the pyload service.

Direct after the start it is working but then a few minutes later it´s not possible to download anymore.

Seems like uploaded has the same problem. https://github.com/pyload/pyload/issues/1687

please post debug log, maybe there is something helpful there

Now i have something:

<pre><code>
04.08.2015 15:31:52 INFO      Download starts: wcd.x264.S06E05.part4.rar
04.08.2015 15:31:52 DEBUG     ACCOUNT ShareonlineBiz: Reached login timeout for XXXXXXXXXXX
04.08.2015 15:31:52 INFO      ACCOUNT ShareonlineBiz: Relogin user `XXXXXXXXXXX`...
04.08.2015 15:31:52 WARNING   ACCOUNT ShareonlineBiz: Could not login user `XXXXXXXXXXX` | 'password'
Traceback (most recent call last):
  File "/opt/pyload/.pyload/userplugins/internal/Account.py", line 59, in _login
    self.login(user, info['login']['password'], info['data'], self.req)
KeyError: 'password'
</code></pre>

This happens after 10 minutes. 

add this before line 59 and post the result (of-course don't forget remove sensitive data) 

``` python
            self.log_debug(info)
```

Right now i'm not in front of a Computer. 
Will Test it in 40 minutes. 

Ok i did it, thats the result:

<pre><code>
300 04.08.2015 16:54:29 INFO    Download starts: wcd.x264.S06E05.part4.rar
301 04.08.2015 16:54:29 DEBUG   ACCOUNT ShareonlineBiz: Reached login timeout for XXXXXXXXXXX
302 04.08.2015 16:54:29 INFO    ACCOUNT ShareonlineBiz: Relogin user `XXXXXXXXXXX`...
303 04.08.2015 16:54:29 DEBUG   ACCOUNT ShareonlineBiz: {'login': {'timestamp': 1438700069.002477}, 'data': {'validuntil': 1439809326.0, 'valid': True, 'trafficleft': 104153946.75, 'maxtraffic': 104857600, 'premium': True, 'login': 'XXXXXXXXXXX', 'password': 'mypassword', 'type': 'ShareonlineBiz', 'options': {'limitdl': ['0']}}}
304 04.08.2015 16:54:29 WARNING ACCOUNT ShareonlineBiz: Could not login user `XXXXXXXXXXX` | 'password'
</code></pre>

The problem seam to appear after the same timeout every time.
about 10 minutes.

Ok i tested it right now. 
It´s exactly 10 minutes.

Edit:
10 minutes are exactly the relogin time in account.py
So it could be the relogin sequence.

can you post full debug log please (with the modified `Account.py` of-course)?

Edit: what version is your `Account.py` plugin?

it happens also with the newest. (0.16)

ok, waiting for full log...

I will post the log but this is everything about it.

i have the same issue here. my account.py is 0.16 too

@wastez i want to see the login and relogin

734 04.08.2015 18:49:12 INFO    Download finished: xxxxxx.part06.rar
733 04.08.2015 18:49:12 INFO    HOSTER ShareonlineBiz[26]: No errors found
732 04.08.2015 18:49:12 INFO    HOSTER ShareonlineBiz[26]: Checking file...
731 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: WAIT 3 seconds
730 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: Processing as free download...
729 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: File status: online
728 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: File size: 1049624576 bytes
727 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: File name: xxxxx.part05.rar
726 04.08.2015 18:48:26 INFO    HOSTER ShareonlineBiz[27]: Updating file info...
725 04.08.2015 18:48:26 WARNING ACCOUNT ShareonlineBiz: Could not login user `xxxxxxx` | 'password'
724 04.08.2015 18:48:26 INFO    ACCOUNT ShareonlineBiz: Relogin user `xxxxxx`...
723 04.08.2015 18:48:26 INFO    Download starts: xxxxx.part05.rar
722 04.08.2015 18:48:25 INFO    Download finished: xxxxx.part07.rar  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< last working file

@steuerlexi you have to edit `Account.py` as I mentioned before and also enable debug mode.

@GammaC0de hehe, ok my bad. That will take me another 10 minutes or so

Here it is.
Login:

<pre><code>
04.08.2015 18:40:39 INFO      ACCOUNT ShareonlineBiz: Login user `XXXXXXXXXXX`...
04.08.2015 18:40:39 DEBUG     ACCOUNT ShareonlineBiz: {'login': {'timestamp': 1438706439.281705, 'password': 'mypassword', 'valid': None}, 'data': {'validuntil': None, 'valid': None, 'trafficleft': None, 'maxtraffic': None, 'premium': None, 'login': 'XXXXXXXXXXX', 'password': 'mypassword', 'type': 'ShareonlineBiz', 'options': {'limitdl': ['0']}}}
04.08.2015 18:40:39 DEBUG     ACCOUNT ShareonlineBiz: LOAD URL https://api.share-online.biz/cgi-bin | cookies=True | get={'q': 'userdetails', 'aux': 'traffic', 'username': 'XXXXXXXXXXX', 'password': 'mypassword'} | req=None | decode=False | multipart=False | post={} | ref=True | just_header=False
04.08.2015 18:40:39 DEBUG     ACCOUNT ShareonlineBiz: user=XXXXXXXXXXX
email=my@mail.com
group=Premium
register_date=1339429545
expire_date=1439809326
points=6718
money=6.72
a=8B442ECFF11252EC95792BEBAD5D5EC496147EFAD3775AEABE2979948B166F81976475B3E84100F39F1523EDAB0B40FCE5312CEBE7776A80954B3ED2866973E2
traffic_1d=2103443654;1.959
traffic_7d=0;0.000
04.08.2015 18:40:39 INFO      ACCOUNT ShareonlineBiz: Parsing account info for user `XXXXXXXXXXX`...
04.08.2015 18:40:39 DEBUG     ACCOUNT ShareonlineBiz: LOAD URL https://api.share-online.biz/cgi-bin | cookies=True | get={'q': 'userdetails', 'aux': 'traffic', 'username': 'XXXXXXXXXXX', 'password': 'mypassword'} | req=None | decode=False | multipart=False | post={} | ref=True | just_header=False
04.08.2015 18:40:40 DEBUG     ACCOUNT ShareonlineBiz: user=XXXXXXXXXXX
email=my@mail.com
group=Premium
register_date=1339429545
expire_date=1439809326
points=6718
money=6.72
a=8B442ECFF11252EC95792BEBAD5D5EC496147EFAD3775AEABE2979948B166F81976475B3E84100F39F1523EDAB0B40FCE5312CEBE7776A80954B3ED2866973E2
traffic_1d=2103443654;1.959
traffic_7d=0;0.000
04.08.2015 18:40:40 DEBUG     ACCOUNT ShareonlineBiz: Account info for user `XXXXXXXXXXX`: {'login': {'timestamp': 1438706439.281705, 'password': '**********', 'valid': True}, 'data': {'premium': True, 'trafficleft': 102803455.80664062, 'options': {'limitdl': ['0']}, 'maxtraffic': 104857600, 'validuntil': 1439809326.0, 'login': 'XXXXXXXXXXX', 'password': '**********', 'type': 'ShareonlineBiz', 'valid': True}}
</code></pre>

Relogin:

<pre><code>
04.08.2015 18:52:13 DEBUG     ACCOUNT ShareonlineBiz: Reached login timeout for XXXXXXXXXXX
04.08.2015 18:52:13 INFO      ACCOUNT ShareonlineBiz: Relogin user `XXXXXXXXXXX`...
04.08.2015 18:52:13 DEBUG     ACCOUNT ShareonlineBiz: {'login': {'timestamp': 1438707133.692208}, 'data': {'validuntil': 1439809326.0, 'valid': True, 'trafficleft': 102800629.77148438, 'maxtraffic': 104857600, 'premium': True, 'login': 'XXXXXXXXXXX', 'password': 'mypassword', 'type': 'ShareonlineBiz', 'options': {'limitdl': ['0']}}}
04.08.2015 18:52:13 WARNING   ACCOUNT ShareonlineBiz: Could not login user `XXXXXXXXXXX` | 'password'
Traceback (most recent call last):
  File "/opt/pyload/.pyload/userplugins/internal/Account.py", line 60, in _login
    self.login(user, info['login']['password'], info['data'], self.req)
KeyError: 'password'
04.08.2015 18:52:13 DEBUG     HOSTER ShareonlineBiz[1664]: PROCESS URL http://www.share-online.biz/dl/32ESDDSN4ER | PLUGIN VERSION 0.55
04.08.2015 18:52:13 INFO      HOSTER ShareonlineBiz[1664]: Updating file info...
04.08.2015 18:52:14 DEBUG     HOSTER ShareonlineBiz[1664]: File info: {'status': 2, 'fileid': '32ESDDSN4ER', 'name': 'wcd.x264.S06E05.part4.rar', 'url': u'http://www.share-online.biz/dl/32ESDDSN4ER', 'pattern': {'ID': u'32ESDDSN4ER'}, 'md5': 'd01a5e8f3dad33ae3f9be5d1070ec715', 'size': 2893860.0}
04.08.2015 18:52:14 DEBUG     HOSTER ShareonlineBiz[1664]: Previous file info: {}
04.08.2015 18:52:14 INFO      HOSTER ShareonlineBiz[1664]: File name: wcd.x264.S06E05.part4.rar
04.08.2015 18:52:14 INFO      HOSTER ShareonlineBiz[1664]: File size: 2893860 bytes
04.08.2015 18:52:14 INFO      HOSTER ShareonlineBiz[1664]: File status: online
04.08.2015 18:52:14 DEBUG     HOSTER ShareonlineBiz[1664]: LOAD URL http://www.share-online.biz/dl/32ESDDSN4ER | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=False | just_header=False
04.08.2015 18:52:14 INFO      HOSTER ShareonlineBiz[1664]: Processing as free download...
04.08.2015 18:52:14 INFO      HOSTER ShareonlineBiz[1664]: WAIT 3 seconds
04.08.2015 18:52:14 DEBUG     HOSTER ShareonlineBiz[1664]: Previous waitUntil: 0.000000
</code></pre>

@wastez try to delete/comment lines [86](https://github.com/pyload/pyload/blob/stable/module/plugins/internal/Account.py#L86) and [87](https://github.com/pyload/pyload/blob/stable/module/plugins/internal/Account.py#L87) of `Account.py`

@GammaC0de you mean those two ?         

if user in self.info:
            self.info[user]['login'].clear()

yes

@GammaC0de @wastez Until know it looks very good. 4 consecutive download successful. I will report again in 20 minutes.

@GammaC0de @wastez @steuerlexi  Seems to be working on my side with Uploaded.

@GammaC0de @wastez @kenodai Yes, it works like a charm. I think this issue has been solved. Thanks for the great work


Resolving patch:
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py
--- a/module/plugins/internal/Account.py
+++ b/module/plugins/internal/Account.py
@@ -13,7 +13,7 @@
 class Account(Plugin):
     __name__    = "Account"
     __type__    = "account"
-    __version__ = "0.16"
+    __version__ = "0.17"
     __status__  = "testing"
 
     __description__ = """Base account plugin"""
@@ -83,9 +83,6 @@ def relogin(self, user):
             req.clearCookies()
             self.clean()
 
-        if user in self.info:
-            self.info[user]['login'].clear()
-
         return self._login(user)
 
 


Test patch: