XBMC Community Forum  

Go Back   XBMC Community Forum > Help and Support > Plugin/Script (Python) Help and Support

Plugin/Script (Python) Help and Support Python requests/suggestions, support, bugs, and everything python goes in here!
Please, add platform prefix to threads that are not platform-independent!:
Thread prefixes; "[LINUX]", "[LIVE]", "[MAC]", "[WINDOWS]", and "[XBOX]"

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-11-26, 20:59   #1
ronmojohny
Junior Member
 
Join Date: Nov 2004
Posts: 2
ronmojohny is on a distinguished road
Default

i want to be able to display a jpeg from a website. the webcam updates the jpeg every 30 seconds, but i don't care about it updating; i just want to see how heavy the traffic is at the time i go there. i tried to set it up as a stream on http://www.onlinestreams.nl/ but they don't support jpegs it seems. does anyone have a solution? many webcams work like this.

thanks
ronmojohny is offline   Reply With Quote
Old 2004-11-30, 00:06   #2
dude
Junior Member
 
Join Date: Nov 2004
Posts: 14
dude is on a distinguished road
Default

this little script should do the trick...

Quote:
import urllib
import xbmc
import xbmcgui

action_menu = 10 #'back'
root_dir = "q:\\scripts\\"
url_webcam = "http://www.tcomeng.com/webcams/emeraldhills.jpg"

class webcam(xbmcgui.window):
* *def (self):
* * * *imgpath = root_dir + "webcam.jpg"
* * * *loc = urllib.urlopener()
* * * *loc.retrieve(url_webcam, imgpath)
* * * *self.addcontrol(xbmcgui.controlimage(100, 100, 0, 0, imgpath)) * *

* *def onaction(self, action):
* * * *if action == action_menu:
* * * * * *self.close()

win = webcam()
win.domodal()
del win
dude is offline   Reply With Quote
Old 2004-12-12, 07:01   #3
senergy
Fan
 
Join Date: Nov 2003
Posts: 769
senergy is on a distinguished road
Default

hi, im using this code
the script downloads the pic fine but then it just stays on a blank screen. checking the logs i get
"error picture::load:unable to open image: q:\scripts\wip\webcam.jpg" multiple times.
any help?

Quote:
import urllib
import xbmc
import xbmcgui

action_menu = 10 #'back'
root_dir = "q:\\scripts\\wip\\"
url_webcam = "http://www.tcomeng.com/webcams/emeraldhills.jpg"

class webcam(xbmcgui.window):
* def (self):
* * * imgpath = root_dir + "webcam.jpg"
* * * loc = urllib.urlopener()
* * * loc.retrieve(url_webcam, imgpath)
* * * self.addcontrol(xbmcgui.controlimage(100, 100, 0, 0, imgpath)) * *

* def onaction(self, action):
* * * if action == action_menu:
* * * * * self.close()

win = webcam()
win.domodal()
del win
senergy is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MJPEG / MJPG (Motion-JPEG) codec support Kilokahn XBMC Feature Suggestions 3 2005-05-12 13:41
M-jpeg playback Hobbie XBMC for Xbox Specific Support 0 2005-03-17 22:22
My Website Alexpoet Plugin/Script (Python) Development 4 2004-07-20 15:06
JPEG Display on 1280x960 sunfish XBMC for Xbox Specific Support 2 2003-11-08 03:20
JPEG Display sunfish XBMC for Xbox Specific Support 0 2003-10-14 03:01


All times are GMT +2. The time now is 19:30.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project