3 |
|
|
4 |
''' |
''' |
5 |
Todic plugin for XBMC |
Todic plugin for XBMC |
6 |
Version 0.0.19 |
Version 0.0.21a |
7 |
''' |
''' |
8 |
|
|
9 |
import sys |
import sys |
85 |
self.url = url |
self.url = url |
86 |
self.fetchClipDetails() |
self.fetchClipDetails() |
87 |
|
|
|
def setPosition(self, pos): |
|
|
print "[Todic] MovieDialog setPosition:" + str(pos) |
|
|
self.position = pos |
|
|
|
|
88 |
|
|
89 |
|
|
90 |
def fetchClipDetails(self): |
def fetchClipDetails(self): |
93 |
self.clipkey = param1["clipkey"] |
self.clipkey = param1["clipkey"] |
94 |
print "CLIPKEY:" + self.clipkey |
print "CLIPKEY:" + self.clipkey |
95 |
detailurl = __backend__ + "&action=clipdetails&clipkey=" + self.clipkey |
detailurl = __backend__ + "&action=clipdetails&clipkey=" + self.clipkey |
96 |
|
print "[Todic] detailURL = " + detailurl |
97 |
|
|
98 |
xml = open_url(detailurl) |
xml = open_url(detailurl) |
99 |
|
|
102 |
self.moviegroups = getText(doc.getElementsByTagName("moviegroups")) |
self.moviegroups = getText(doc.getElementsByTagName("moviegroups")) |
103 |
self.playlength = getText(doc.getElementsByTagName("playlength")) |
self.playlength = getText(doc.getElementsByTagName("playlength")) |
104 |
self.codecdetails = getText(doc.getElementsByTagName("codecdetails")) |
self.codecdetails = getText(doc.getElementsByTagName("codecdetails")) |
105 |
|
self.position = int( getText(doc.getElementsByTagName("position")) ) |
106 |
|
|
107 |
def setName(self, name): |
def setName(self, name): |
108 |
self.name = name |
self.name = name |
132 |
def onPlayBackStopped(self): |
def onPlayBackStopped(self): |
133 |
self.stopped = True |
self.stopped = True |
134 |
print "[TodicPlayer] : stopped" |
print "[TodicPlayer] : stopped" |
135 |
url = __backend__ + "&action=playbacktime&subaction=stopped&time=" + str( self.playingPosition ) |
self.reportPlaytime("stopped") |
136 |
open_url_safe(url) |
# url = __backend__ + "&action=playbacktime&subaction=stopped&time=" + str( self.playingPosition ) |
137 |
|
# open_url_safe(url) |
138 |
|
|
139 |
|
|
140 |
def onPlayBackEnded(self): |
def onPlayBackEnded(self): |
141 |
self.stopped = True |
self.stopped = True |
142 |
print "[TodicPlayer] : ended" |
print "[TodicPlayer] : ended" |
143 |
url = __backend__ + "&action=playbacktime&subaction=ended&time=" |
self.reportPlaytime("ended") |
144 |
open_url_safe(url) |
# url = __backend__ + "&action=playbacktime&subaction=ended&time=" |
145 |
|
# open_url_safe(url) |
146 |
|
|
147 |
def tick(self): |
def tick(self): |
148 |
if ( self.isPlaying() ): |
if ( self.isPlaying() ): |
151 |
#print "[Todic] tick " + str(now) + " " + str(self.lastReport) + " : " +str(now - self.lastReport) |
#print "[Todic] tick " + str(now) + " " + str(self.lastReport) + " : " +str(now - self.lastReport) |
152 |
if ( (now - self.lastReport) > 60.0): |
if ( (now - self.lastReport) > 60.0): |
153 |
self.lastReport = now |
self.lastReport = now |
154 |
self.reportPlaytime() |
self.reportPlaytime("playing") |
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
|
159 |
def reportPlaytime(self): |
def reportPlaytime(self, subaction): |
160 |
url = __backend__ + "&action=playbacktime&subaction=playing&time=" + str( self.playingPosition ) |
url = __backend__ + "&action=playbacktime&subaction=" + subaction + "&time=" + str( self.playingPosition ) |
161 |
open_url_safe(url) |
open_url_safe(url) |
162 |
print "[Todic] reportPlaytime:" + url |
print "[Todic] reportPlaytime:" + url |
163 |
|
|
266 |
description = getText(entry.getElementsByTagName("description")) |
description = getText(entry.getElementsByTagName("description")) |
267 |
playcount = getText(entry.getElementsByTagName("playcount")) |
playcount = getText(entry.getElementsByTagName("playcount")) |
268 |
|
|
269 |
|
|
270 |
if playcount == '': |
if playcount == '': |
271 |
playcount = '0' |
playcount = '0' |
272 |
playcount = int(playcount) |
playcount = int(playcount) |
305 |
d.setUrl(url) |
d.setUrl(url) |
306 |
d.setName(name) |
d.setName(name) |
307 |
d.setDescription(description) |
d.setDescription(description) |
|
d.setPosition(pos) #tager pos fra global scope |
|
308 |
|
|
309 |
d.doModal() |
d.doModal() |
310 |
|
|
452 |
name = None |
name = None |
453 |
mode = None |
mode = None |
454 |
description = None |
description = None |
455 |
pos = 0 |
|
456 |
|
|
457 |
|
#print params |
458 |
|
|
459 |
try: |
try: |
460 |
url = urllib.unquote_plus(params["url"]) |
url = urllib.unquote_plus(params["url"]) |
473 |
except: |
except: |
474 |
pass |
pass |
475 |
|
|
476 |
try: |
|
|
pos = int(params["pos"]) |
|
|
except: |
|
|
pass |
|
477 |
|
|
478 |
|
|
479 |
try: |
try: |