WebUi Plugin 0.5

Suggest, post, or discuss plugins for Deluge
scarecrow
New User
New User
Posts: 3
Joined: Tue Nov 06, 2007 9:56 am

Re: WebUi Plugin

Post by scarecrow »

Ummm... no, revision 124 isn't very good.
Using Deluge SVN built under Arch Linux ( pygtk 2.12.0, pyxdg 0.15), and Greek ( el_GR-UTF8) locales.
The webui in current SVN (rev. 117) works, but with serious problems:

Code: Select all

Start Webui(in process)..
http://0.0.0.0:8112/
webserver: kill 8565
Start Webui(in process)..
http://0.0.0.0:8112/
Applying preferences
Traceback (most recent call last):
  File "/usr/share/deluge/plugins/WebUi/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/share/deluge/plugins/WebUi/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/share/deluge/plugins/WebUi/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 143, in deco
    return func(self, name) #ok, continue..
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 130, in deco
    res = func(self, name)
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 160, in deco
    return func(self, name)
  File "/usr/share/deluge/plugins/WebUi/deluge_webserver.py", line 119, in GET
    return ws.render.torrent_info(get_torrent_status(torrent_id))
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 498, in __call__
    return f.go()
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 760, in go
    self.output._str = ''.join(map(self.h, self.parsetree))
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 684, in h_line
    o = self.h(x[NAME])
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 587, in h_paren
    return self.h(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 620, in h_expr
    item = self.h(i[THING])
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 609, in h_call
    args = [self.h(x) for x in i[ARGS]]
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 620, in h_expr
    item = self.h(i[THING])
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 552, in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/share/deluge/plugins/WebUi/webpy022/template.py", line 654, in h_test
    return e(ox) + e(oy)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)

WebUI:unload..
webserver: kill 8579
Pickling state...
Stopping DHT...
Saving fastresume data...
Quitting the core...
core: removing torrents...
core: removing settings...
core: shutting down session...
Σφάλμα κατάτμησης (segmentation fault)
Rev. 124 does not start at all:

Code: Select all

--Deluge Error--
Exception : Non Unicode for key:message
path : /index
file : /usr/share/deluge/plugins/WebUi/webserver_framework.py in get_torrent_status, line 244

--Input--
<Storage {'sort': 'calc_state_str', 'order': 'down'}>

--Versions--
WebUi : rev.124
Python : 2.5.1 (r251:54863, Oct  9 2007, 10:45:22) 
[GCC 4.2.1]
dbus:0.82.2

--Traceback--
  File "/usr/share/deluge/plugins/WebUi/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/share/deluge/plugins/WebUi/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/share/deluge/plugins/WebUi/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 140, in deco
    return func(self, name) #ok, continue..
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 127, in deco
    res = func(self, name)
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 157, in deco
    return func(self, name)
  File "/usr/share/deluge/plugins/WebUi/deluge_webserver.py", line 102, in GET
    for torrent_id in ws.proxy.get_session_state()]
  File "/usr/share/deluge/plugins/WebUi/webserver_framework.py", line 245, in get_torrent_status
    raise Exception('Non Unicode for key:%s' % (k, ))
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: WebUi Plugin

Post by mvoncken »

scarecrow wrote:

Code: Select all

--Deluge Error--
Exception : Non Unicode for key:message
path : /index
file : /usr/share/deluge/plugins/WebUi/webserver_framework.py in get_torrent_status, line 244
124 only added a more specific error-message.
This was what I suspected.
gettext returns unicode data in an string-object.

Either gettext or the translation file is broken.
My guess is it's the translation file.
I'll discuss with the core-devs, i prefer fixing the origin of the problem instead of catching unicode errors everywhere.
dev: webui, core, labels | irc:vonck7 |
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: WebUi Plugin

Post by mvoncken »

I could solve the unicode problem by changing 1 line in deluge-core.
src/__init__.py

Code: Select all

gettext.install(APP, DIR)
to

Code: Select all

gettext.install(APP, DIR, unicode=1)
I'll notify the core devs, this will solve some problems in the gtk-ui too.

edit : markybob committed the change to deluge-svn.
dev: webui, core, labels | irc:vonck7 |
scarecrow
New User
New User
Posts: 3
Joined: Tue Nov 06, 2007 9:56 am

Re: WebUi Plugin

Post by scarecrow »

Yessir! I can happily report that it's working fine now... thank you.
After the fix some other plugins are misbehaving when shutting Deluge (I get some

Code: Select all

KeyError: '\xce\xa4\xce\xbf\xcf\x80\xce\xbf\xce\xb8\xce\xb5\xcf\x83\xce\xaf\xce\xb5\xcf\x82'
python errors, and the program does not shut down. But the web plugin works fine now, so time to enter another thread... :twisted:
XThief
New User
New User
Posts: 8
Joined: Sun Nov 18, 2007 12:05 am

Re: WebUi Plugin

Post by XThief »

First of all, I love this pluging, beautiful theme.
There is one thing I miss, Could you put a option to change the GLOBAL download and upload limit?
this would make the pluging perfect, please do this ;)
thank you in advance
Znuff
Member
Member
Posts: 11
Joined: Sun Nov 18, 2007 6:34 am

Re: WebUi Plugin

Post by Znuff »

Can someone add a feature to pass a cookie when using the URL download?

Would help with private trackers that require you to log in.
abubin
Seeder
Seeder
Posts: 217
Joined: Thu Sep 13, 2007 6:03 am

Re: WebUi Plugin

Post by abubin »

me excited about this :
tests/ 0.6 tests.
this means 0.6 is around the corner....yippee... :D
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: WebUi Plugin

Post by mvoncken »

Znuff wrote:Can someone add a feature to pass a cookie when using the URL download?

Would help with private trackers that require you to log in.
This makes sense.
I'll add that to my todo-list, but that list is getting longer all the time..
Cross site scripting is blocked by browsers, so i can't just steal a cookie.
The only way i can think of would be an adaption of the the greasemonkey firefox plugin.

How to adapt the greasemonkey script :
get the torrent-content using a javascript http request.
http-post the contents to /torrent/add (fill a hidden form and post it)
dev: webui, core, labels | irc:vonck7 |
Znuff
Member
Member
Posts: 11
Joined: Sun Nov 18, 2007 6:34 am

Re: WebUi Plugin

Post by Znuff »

Exactly for that userscript I need it.

The userscript can easily read a cookie, I even modified the script myself to do that for a few private trackers I use... But there's no way to pass it to deluge :-)


Been looking around the code for a solution but it's way too complex for me.
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: WebUi Plugin

Post by mvoncken »

Znuff wrote:Exactly for that userscript I need it.

The userscript can easily read a cookie, I even modified the script myself to do that for a few private trackers I use... But there's no way to pass it to deluge :-)


Been looking around the code for a solution but it's way too complex for me.
Added in rev.163.
No cookies, the userscript downloads the torrent and submits it to the webui as base64.

Could you give me the parsing code for those other private sites?
dev: webui, core, labels | irc:vonck7 |
Post Reply