Kodi Community Forum
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC (/showthread.php?tid=113136)



- HarryRosen - 2011-11-03

did you call the file htpcfrontend.conf with the .conf extention? try calling the file just htpcfrontend


- Dougedey - 2011-11-03

I'm finding the same issue, I've set everything up as the instruction vaguely mention and the result is I just get a directory listing.


- DejaVu - 2011-11-03

Nice - that sorted it - but still get directory listings only.

Code:
xbmc@XBMCLive:~$ a2ensite htpcfrontend
Enabling site htpcfrontend.
Could not create /etc/apache2/sites-enabled/htpcfrontend: Permission denied
xbmc@XBMCLive:~$ sudo a2ensite htpcfrontend
[sudo] password for xbmc:
Enabling site htpcfrontend.
Run '/etc/init.d/apache2 reload' to activate new configuration!
xbmc@XBMCLive:~$ /etc/init.d/apache2 reload
* Reloading web server config apache2                                          httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                                         [fail]
xbmc@XBMCLive:~$ sudo /etc/init.d/apache2 reload
* Reloading web server config apache2                                   [ OK ]
xbmc@XBMCLive:~$

EDIT -
I reset my Apache log just before the reload and found this. Don't know if it will help though.
Code:
[Thu Nov 03 02:31:20 2011] [notice] Graceful restart requested, doing restart
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:21 2011] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/2.8 Python/2.6.5 configured -- resuming normal operations



- percula - 2011-11-03

DejaVu Wrote:EDIT -
I reset my Apache log just before the reload and found this. Don't know if it will help though.
Code:
[Thu Nov 03 02:31:20 2011] [notice] Graceful restart requested, doing restart
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:20 2011] [error] Exception KeyError: KeyError(-1215748352,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Nov 03 02:31:21 2011] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/2.8 Python/2.6.5 configured -- resuming normal operations

Did a bit of Google-fu... the KeyError thing is a known bug that was patched over a year ago. But I dont think Ubuntu heard about it as the version of mod_wsgi that installed on 10.04 is 2.8-2 with the current version being 3.3

I will venture to say all of the people (myself included) that are just getting the directory listing are on some flavor of Ubuntu with mod_wsgi version less than 3.3

I will leave the find of the right package to someone else...


- Dougedey - 2011-11-03

percula Wrote:Did a bit of Google-fu... the KeyError thing is a known bug that was patched over a year ago. But I dont think Ubuntu heard about it as the version of mod_wsgi that installed on 10.04 is 2.8-2 with the current version being 3.3

I will venture to say all of the people (myself included) that are just getting the directory listing are on some flavor of Ubuntu with mod_wsgi version less than 3.3

I will leave the find of the right package to someone else...

Ubuntu 11.10 comes with 3.3.

You can get the 3.3 packages from here: http://packages.debian.org/unstable/python/libapache2-mod-wsgi


- percula - 2011-11-03

Dougedey Wrote:Ubuntu 11.10 comes with 3.3.

You can get the 3.3 packages from here: http://packages.debian.org/unstable/python/libapache2-mod-wsgi

Doesn't seem to matter, I compiled 3.3 on 10.04, no more of the threading errors in the apache error log, but still no site either, just the directory listing.

One wild goose chased down, next.


- UndisclosedP - 2011-11-03

Seems like needing apache for this is overkill. I'd second the request to put something like CherryPY in to the app so it 'just works'. That being said. There is a quick way to get the app running without apache right now.

This instructions were performed on a debian sid box, but I don't see why they wouldn't work on ubuntu/lenny/whatever. I'm assuming you've managed to clone marashino out of git, installed the other pre-requisites. (Flask, JSONRPClib, etc) and set up a settings.py

Code:
sudo easy_install gunicorn
cd /your/maraschino/directory/
gunicorn -b yourip:yourport -w 4 htpcfrontend:app

Now maraschino will be served up at the ip : port you specified, no need for apache. If you want it to run persistently run

Code:
gunicorn -b yourip:yourport -w 4 htpcfrontend:app -D

Though this wont survive a reboot like the apache method. It does get the app up and running for you to play with. I assume you could knock up init scripts if you so desired. But I haven't got the time just now, and don't see the point until I'm using Eden full time.

@mrkipling Thanks for your efforts on this, its gorgeous and amazing, can't wait to actually use it full time when Eden goes gold.

NINJA EDIT:
So hacked around with flask, which i've never used before and it seems it does have its own built in web server. I'm not sure why mrkipling doesnt suggest using it. Perhaps you can enlighten us. But another way to get the app to 'just run' is

Code:
cd /your/maraschino/directory/
python htpcfrontend.py

This will start the flask debug server on port 127.0.0.1:5000 and it seems to work perfectly! You can hack htpcfrontend.py to run a different port and ip like so at the end of the file.

Code:
if __name__ == '__main__':
    app.run(debug=True,port=5001,host='0.0.0.0')



- mrkipling - 2011-11-03

UndisclosedP Wrote:So hacked around with flask, which i've never used before and it seems it does have its own built in web server. I'm not sure why mrkipling doesnt suggest using it. Perhaps you can enlighten us. But another way to get the app to 'just run' is

Code:
cd /your/maraschino/directory/
python htpcfrontend.py

This will start the flask debug server on port 127.0.0.1:5000 and it seems to work perfectly! You can hack htpcfrontend.py to run a different port and ip like so at the end of the file.

Code:
if __name__ == '__main__':
    app.run(debug=True,port=5001,host='0.0.0.0')

A good point! I didn't think to suggest using the development server because, well, it's a development server - but now you mention it I'm sure it's fine for most uses. If people are having trouble setting up a proper web server then this could be a good alternative.

I'll have a play around with it, and making it start on boot, and if I'm satisfied with it then I'll add this method to the documentation.


- mrkipling - 2011-11-03

DejaVu Wrote:Could I make a coulpe of suggestions/requests...

hard drive capacity widget and frontend settings editing.

The HD capacity widget is a good idea - I've added it to my list of stuff that I'd like to implement.

The ability to edit settings and module placement in the browser is already on my todo list. It's a sizeable chunk of work though so it might be a little while.


- DejaVu - 2011-11-03

Ran it manually from inside Putty to have a nose and I must say, it looks even better in the flesh!
I reckon this is the way to go - forget *apache and just run it using Python within a deamon and an init.d script with its own unique port?
Thanks UndisclosedP.

Changing None next to Trakt_API_Key to my API Key is throwing an error. Tried with ('apikey'), without (apikey) and with ("apikey"). Also tried with commas - but keep getting...

Code:
xbmc@XBMCLive:~$ sudo python /var/www/htpc-frontend/htpcfrontend.py
Traceback (most recent call last):
  File "/var/www/htpc-frontend/htpcfrontend.py", line 2, in <module>
    from settings import *
  File "/var/www/htpc-frontend/settings.py", line 30
    TRAKT_API_KEY = thisismytraktvapikey
Traceback (most recent call last):
  File "/var/www/htpc-frontend/htpcfrontend.py", line 2, in <module>
    from settings import *
  File "/var/www/htpc-frontend/settings.py", line 30
    TRAKT_API_KEY = thisismytraktvapikey
                                                       ^
SyntaxError: invalid syntax
What is the correct syntax for this?


- mrkipling - 2011-11-03

DejaVu Wrote:Ran it manually from inside Putty to have a nose and I must say, it looks even better in the flesh!
I reckon this is the way to go - forget *apache and just run it using Python within a deamon and an init.d script with its own unique port?
Thanks UndisclosedP.

I'm all for this. I'm focussing on developing other features at the moment, but if somebody wants to create an init.d script and whatever else is necessary to get this working then I'm sure that people would find a use for it Smile

DejaVu Wrote:Changing None next to Trakt_API_Key to my API Key is throwing an error. Tried with ('apikey'), without (apikey) and with ("apikey"). Also tried with commas - but keep getting...

Code:
xbmc@XBMCLive:~$ sudo python /var/www/htpc-frontend/htpcfrontend.py
Traceback (most recent call last):
  File "/var/www/htpc-frontend/htpcfrontend.py", line 2, in <module>
    from settings import *
  File "/var/www/htpc-frontend/settings.py", line 30
    TRAKT_API_KEY = thisismytraktvapikey
Traceback (most recent call last):
  File "/var/www/htpc-frontend/htpcfrontend.py", line 2, in <module>
    from settings import *
  File "/var/www/htpc-frontend/settings.py", line 30
    TRAKT_API_KEY = thisismytraktvapikey
                                                       ^
SyntaxError: invalid syntax
What is the correct syntax for this?

It needs to be a string - so, for example:

Code:
TRAKT_API_KEY = 'whateveryourapikeyis'



- mybrain87 - 2011-11-03

Tried that:

Code:
cd /your/maraschino/directory/
python htpcfrontend.py

But it seems to just hang there:
* Running on http://127.0.0.1:5000/
* Restarting with reloader

When i got to 192.168.1.16:5000 theres nothing.

Am I doing something wrong?


- HarryRosen - 2011-11-03

try sudo python htpcfrontend.py

that worked for me

on a side note, everything is running now, but the thumbnails are not working for the episodes. and trak.tv doesn't show up.

my thumbnails are stores on my server since i have a centralized database if that matters.


- mrkipling - 2011-11-03

HarryRosen Wrote:try sudo python htpcfrontend.py
that worked for me

Glad to hear it!

HarryRosen Wrote:on a side note, everything is running now, but the thumbnails are not working for the episodes. ... my thumbnails are stores on my server since i have a centralized database if that matters.

If you look at the HTML and pull out a thumbnail URL, what happens when you try to view this URL in your browser?

HarryRosen Wrote:and trak.tv doesn't show up.

First of all, check to make sure that your Trakt profile is set to public (i.e. not protected). Support for protected profiles is planned for the future.

If it's still not loading, what appears in the console when the page requests the Trakt module via AJAX? If something is erroring then it should display here.

Finally, find out what the AJAX request to the trakt URL (/xhr/trakt) returns and post it here. You can do this using a developer toolbar/plugin like Chrome's built-in one or Firebug for Firefox.


- HarryRosen - 2011-11-03

I get this for the thumbnail as the link

http://localhost:8080/vfs/special://masterprofile/Thumbnails/Video/7/73ba92a4.tbn

my images are not stored on the same box as the xbmc.

i wonder if it's because I am using my VPN to my house thats why it's not showing, because the trak.tv is not showing and the now playing isn't as well

another side note is it possible to have a recently added for movies as well