enigma2-plugins : update patch.
[vuplus_openvuplus] / meta-openvuplus / recipes-vuplus / enigma2 / enigma2-plugins / enigma2_plugins_mytube_tpm.patch
diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2-plugins/enigma2_plugins_mytube_tpm.patch b/meta-openvuplus/recipes-vuplus/enigma2/enigma2-plugins/enigma2_plugins_mytube_tpm.patch
new file mode 100644 (file)
index 0000000..53f3173
--- /dev/null
@@ -0,0 +1,149 @@
+diff --git a/mytube/src/plugin.py b/mytube/src/plugin.py
+index d6fbe85..93b54c1 100755
+--- a/mytube/src/plugin.py
++++ b/mytube/src/plugin.py
+@@ -385,44 +385,10 @@ class MyTubePlayerMainScreen(Screen, ConfigListScreen):
+               current = self["config"].getCurrent()
+               if current[1].help_window.instance is not None:
+                       current[1].help_window.instance.hide()
+-
+-              l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
+-              if l3cert is None or l3cert is "":
+-                      self["videoactions"].setEnabled(False)
+-                      self["searchactions"].setEnabled(False)
+-                      self["config_actions"].setEnabled(False)
+-                      self["historyactions"].setEnabled(False)
+-                      self["statusactions"].setEnabled(True)
+-                      self.hideSuggestions()
+-                      self.statuslist = []
+-                      self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
+-                      self["feedlist"].style = "state"
+-                      self['feedlist'].setList(self.statuslist)
+-                      return
+-
+-              self.l3key = validate_cert(l3cert, self.l2key)
+-              if self.l3key is None:
+-                      print "l3cert invalid"
+-                      return
+-              rnd = get_rnd()
+-              if rnd is None:
+-                      print "random error"
+-                      return
+-
+-              val = etpm.challenge(rnd)
+-              result = decrypt_block(val, self.l3key)
+-
+-              self.statuslist = []
+-              if result[80:88] == rnd:
+-                      self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
+-                      self["feedlist"].style = "state"
+-                      self['feedlist'].setList(self.statuslist)
+-                      self.Timer.start(200)
+-              else:
+-                      self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
+-                      self["feedlist"].style = "state"
+-                      self['feedlist'].setList(self.statuslist)               
+-      
++              self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
++              self["feedlist"].style = "state"
++              self['feedlist'].setList(self.statuslist)
++              self.Timer.start(200)
+       def TimerFire(self):
+               self.Timer.stop()
+               if config.plugins.mytube.general.loadFeedOnOpen.value:
+@@ -453,49 +419,36 @@ class MyTubePlayerMainScreen(Screen, ConfigListScreen):
+                       self.statuslist = []
+                       self.hideSuggestions()
+                       result = None
+-                      if self.l3key is not None:
+-                              rnd = get_rnd()
+-                              if rnd is None:
+-                                      return
+-                              val = etpm.challenge(rnd)
+-                              result = decrypt_block(val, self.l3key)
+-                      if not result or result[80:88] != rnd:
++                      print "Genuine Dreambox validation passed"
++                      if self.FirstRun == True:
++                              self.appendEntries = False
++                              myTubeService.startService()
++                      if self.HistoryWindow is not None:
++                              self.HistoryWindow.deactivate()
++                              self.HistoryWindow.instance.hide()
++                      if status == 'getFeed':
++                              self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
++                      elif status == 'getSearchFeed':
++                              self.statuslist.append(( _("Fetching search entries"), _("Trying to download the Youtube search results. Please wait..." ) ))
++                      elif status == 'Error':
++                              self.statuslist.append(( _("An error occured."), _("There was an error getting the feed entries. Please try again." ) ))
++                      elif status == 'noVideos':
+                               self["key_green"].show()
+-                              self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
+-                              self["feedlist"].style = "state"
+-                              self['feedlist'].setList(self.statuslist)
+-                      else:
+-                              print "Genuine Dreambox validation passed"
+-                              if self.FirstRun == True:
+-                                      self.appendEntries = False
+-                                      myTubeService.startService()
+-                              if self.HistoryWindow is not None:
+-                                      self.HistoryWindow.deactivate()
+-                                      self.HistoryWindow.instance.hide()
+-                              if status == 'getFeed':
+-                                      self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
+-                              elif status == 'getSearchFeed':
+-                                      self.statuslist.append(( _("Fetching search entries"), _("Trying to download the Youtube search results. Please wait..." ) ))
+-                              elif status == 'Error':
+-                                      self.statuslist.append(( _("An error occured."), _("There was an error getting the feed entries. Please try again." ) ))
+-                              elif status == 'noVideos':
+-                                      self["key_green"].show()
+-                                      self.statuslist.append(( _("No videos to display"), _("Please select a standard feed or try searching for videos." ) ))
+-                              elif status == 'byPass':
+-                                      self.statuslist.append(( _("Not fetching feed entries"), _("Please enter your search term." ) ))
+-                                      self["feedlist"].style = "state"
+-                                      self['feedlist'].setList(self.statuslist)
+-                                      self.switchToConfigList()
++                              self.statuslist.append(( _("No videos to display"), _("Please select a standard feed or try searching for videos." ) ))
++                      elif status == 'byPass':
++                              self.statuslist.append(( _("Not fetching feed entries"), _("Please enter your search term." ) ))
+                               self["feedlist"].style = "state"
+                               self['feedlist'].setList(self.statuslist)
+-                              if self.FirstRun == True:
+-                                      if config.plugins.mytube.general.loadFeedOnOpen.value:
+-                                              if config.plugins.mytube.general.startFeed.value == 'hd':
+-                                                      self.FeedURL = "http://gdata.youtube.com/feeds/api/videos/-/HD"
+-                                              else:
+-                                                      self.FeedURL = self.BASE_STD_FEEDURL + str(config.plugins.mytube.general.startFeed.value)
+-                                              self.getFeed(self.FeedURL, str(config.plugins.mytube.general.startFeed.value))
+-
++                              self.switchToConfigList()
++                      self["feedlist"].style = "state"
++                      self['feedlist'].setList(self.statuslist)
++                      if self.FirstRun == True:
++                              if config.plugins.mytube.general.loadFeedOnOpen.value:
++                                      if config.plugins.mytube.general.startFeed.value == 'hd':
++                                              self.FeedURL = "http://gdata.youtube.com/feeds/api/videos/-/HD"
++                                      else:
++                                              self.FeedURL = self.BASE_STD_FEEDURL + str(config.plugins.mytube.general.startFeed.value)
++                                      self.getFeed(self.FeedURL, str(config.plugins.mytube.general.startFeed.value))
+       def handleHelpWindow(self):
+               print "[handleHelpWindow]"
+@@ -1775,17 +1728,8 @@ class MyTubePlayer(Screen, InfoBarNotifications):
+ def MyTubeMain(session, **kwargs):
+-      l2 = False
+-      l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
+-      if l2cert is None:
+-              print "l2cert not found"
+-              return
+-      
+-      l2key = validate_cert(l2cert, rootkey)
+-      if l2key is None:
+-              print "l2cert invalid"
+-              return
+       l2 = True
++      l2key = None
+       if l2:
+               session.open(MyTubePlayerMainScreen,l2key)