/[projects]/misc/xbmc/plugin.video.todic/default.py
ViewVC logotype

Diff of /misc/xbmc/plugin.video.todic/default.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3261 by torben, Fri Feb 19 21:39:29 2021 UTC revision 3264 by torben, Fri Feb 26 12:24:06 2021 UTC
# Line 3  Line 3 
3    
4  '''  '''
5      Todic plugin for XBMC      Todic plugin for XBMC
6      Version 1.9.0      Version 1.9.3
7  '''  '''
8    
9  import sys  import sys
# Line 198  def SaveFile(path, data): Line 198  def SaveFile(path, data):
198    
199    
200  def open_url(url):  def open_url(url):
201      with urllib.request.urlopen(url) as response:      with urllib.request.urlopen(url) as req:
202          data = response.read()          #data = response.read()
203          return data          #return data
204            charset=req.info().get_content_charset()
205            content=req.read().decode(charset)
206            return content
207    
208    
209  # wraps open url in a catch-all exception handler  # wraps open url in a catch-all exception handler
# Line 222  def rootMenu(): Line 225  def rootMenu():
225      msg = msg.strip()      msg = msg.strip()
226    
227      if msg != "":      if msg != "":
228            print("[Todic] rootMenu Dialog =" + str(msg))
229          dialog = xbmcgui.Dialog()          dialog = xbmcgui.Dialog()
230          dialog.ok('XBMC Todic', msg)          dialog.ok('XBMC Todic', msg)
231    
# Line 328  def play_video(url, name): Line 332  def play_video(url, name):
332          if (savedPosition > 0):          if (savedPosition > 0):
333              dialog = xbmcgui.Dialog()              dialog = xbmcgui.Dialog()
334              #yes / true -afspil fra position              #yes / true -afspil fra position
335              answer = dialog.yesno(heading='Todic', line1='Afspil fra sidste position', nolabel='Fra start', yeslabel='Fortsæt')              answer = dialog.yesno(heading='Todic', message='Afspil fra sidste position', nolabel='Fra start', yeslabel='Fortsæt')
336              if (answer == True):              if (answer == True):
337                  playPosition = savedPosition                  playPosition = savedPosition
338                    
# Line 411  def searchSeries(): Line 415  def searchSeries():
415  #=================================== Tool Box =======================================  #=================================== Tool Box =======================================
416  # shows a more userfriendly notification  # shows a more userfriendly notification
417  def showMessage(heading, message):  def showMessage(heading, message):
418      print( "[Todic::showMessage] " + message)      print( "[Todic::showMessage] " + str(message) )
419      print( message )      print( message )
420      duration = 15 * 1000      duration = 15 * 1000
421      xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' %      xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' %
# Line 478  try: Line 482  try:
482  except:  except:
483      pass      pass
484    
485    print( "[Todic] url=" + str(url))
486    print( "[Todic] name=" + str(name))
487    print( "[Todic] mode=" + str(mode))
488    
489    
490  try:  try:

Legend:
Removed from v.3261  
changed lines
  Added in v.3264

  ViewVC Help
Powered by ViewVC 1.1.20