task-vuplus-enigma2
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-enigma2 / enigma2 / enigma2-plugins / vuplus / enigma2_plugins_mytube_tpm.patch
1 diff --git a/mytube/src/plugin.py b/mytube/src/plugin.py
2 index d6fbe85..93b54c1 100755
3 --- a/mytube/src/plugin.py
4 +++ b/mytube/src/plugin.py
5 @@ -385,44 +385,10 @@ class MyTubePlayerMainScreen(Screen, ConfigListScreen):
6                 current = self["config"].getCurrent()
7                 if current[1].help_window.instance is not None:
8                         current[1].help_window.instance.hide()
9 -
10 -               l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
11 -               if l3cert is None or l3cert is "":
12 -                       self["videoactions"].setEnabled(False)
13 -                       self["searchactions"].setEnabled(False)
14 -                       self["config_actions"].setEnabled(False)
15 -                       self["historyactions"].setEnabled(False)
16 -                       self["statusactions"].setEnabled(True)
17 -                       self.hideSuggestions()
18 -                       self.statuslist = []
19 -                       self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
20 -                       self["feedlist"].style = "state"
21 -                       self['feedlist'].setList(self.statuslist)
22 -                       return
23 -
24 -               self.l3key = validate_cert(l3cert, self.l2key)
25 -               if self.l3key is None:
26 -                       print "l3cert invalid"
27 -                       return
28 -               rnd = get_rnd()
29 -               if rnd is None:
30 -                       print "random error"
31 -                       return
32 -
33 -               val = etpm.challenge(rnd)
34 -               result = decrypt_block(val, self.l3key)
35 -
36 -               self.statuslist = []
37 -               if result[80:88] == rnd:
38 -                       self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
39 -                       self["feedlist"].style = "state"
40 -                       self['feedlist'].setList(self.statuslist)
41 -                       self.Timer.start(200)
42 -               else:
43 -                       self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
44 -                       self["feedlist"].style = "state"
45 -                       self['feedlist'].setList(self.statuslist)               
46 -       
47 +               self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
48 +               self["feedlist"].style = "state"
49 +               self['feedlist'].setList(self.statuslist)
50 +               self.Timer.start(200)
51         def TimerFire(self):
52                 self.Timer.stop()
53                 if config.plugins.mytube.general.loadFeedOnOpen.value:
54 @@ -453,49 +419,36 @@ class MyTubePlayerMainScreen(Screen, ConfigListScreen):
55                         self.statuslist = []
56                         self.hideSuggestions()
57                         result = None
58 -                       if self.l3key is not None:
59 -                               rnd = get_rnd()
60 -                               if rnd is None:
61 -                                       return
62 -                               val = etpm.challenge(rnd)
63 -                               result = decrypt_block(val, self.l3key)
64 -                       if not result or result[80:88] != rnd:
65 +                       print "Genuine Dreambox validation passed"
66 +                       if self.FirstRun == True:
67 +                               self.appendEntries = False
68 +                               myTubeService.startService()
69 +                       if self.HistoryWindow is not None:
70 +                               self.HistoryWindow.deactivate()
71 +                               self.HistoryWindow.instance.hide()
72 +                       if status == 'getFeed':
73 +                               self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
74 +                       elif status == 'getSearchFeed':
75 +                               self.statuslist.append(( _("Fetching search entries"), _("Trying to download the Youtube search results. Please wait..." ) ))
76 +                       elif status == 'Error':
77 +                               self.statuslist.append(( _("An error occured."), _("There was an error getting the feed entries. Please try again." ) ))
78 +                       elif status == 'noVideos':
79                                 self["key_green"].show()
80 -                               self.statuslist.append(( _("Genuine Dreambox validation failed!"), _("Verify your Dreambox authenticity by running the genuine dreambox plugin!" ) ))
81 -                               self["feedlist"].style = "state"
82 -                               self['feedlist'].setList(self.statuslist)
83 -                       else:
84 -                               print "Genuine Dreambox validation passed"
85 -                               if self.FirstRun == True:
86 -                                       self.appendEntries = False
87 -                                       myTubeService.startService()
88 -                               if self.HistoryWindow is not None:
89 -                                       self.HistoryWindow.deactivate()
90 -                                       self.HistoryWindow.instance.hide()
91 -                               if status == 'getFeed':
92 -                                       self.statuslist.append(( _("Fetching feed entries"), _("Trying to download the Youtube feed entries. Please wait..." ) ))
93 -                               elif status == 'getSearchFeed':
94 -                                       self.statuslist.append(( _("Fetching search entries"), _("Trying to download the Youtube search results. Please wait..." ) ))
95 -                               elif status == 'Error':
96 -                                       self.statuslist.append(( _("An error occured."), _("There was an error getting the feed entries. Please try again." ) ))
97 -                               elif status == 'noVideos':
98 -                                       self["key_green"].show()
99 -                                       self.statuslist.append(( _("No videos to display"), _("Please select a standard feed or try searching for videos." ) ))
100 -                               elif status == 'byPass':
101 -                                       self.statuslist.append(( _("Not fetching feed entries"), _("Please enter your search term." ) ))
102 -                                       self["feedlist"].style = "state"
103 -                                       self['feedlist'].setList(self.statuslist)
104 -                                       self.switchToConfigList()
105 +                               self.statuslist.append(( _("No videos to display"), _("Please select a standard feed or try searching for videos." ) ))
106 +                       elif status == 'byPass':
107 +                               self.statuslist.append(( _("Not fetching feed entries"), _("Please enter your search term." ) ))
108                                 self["feedlist"].style = "state"
109                                 self['feedlist'].setList(self.statuslist)
110 -                               if self.FirstRun == True:
111 -                                       if config.plugins.mytube.general.loadFeedOnOpen.value:
112 -                                               if config.plugins.mytube.general.startFeed.value == 'hd':
113 -                                                       self.FeedURL = "http://gdata.youtube.com/feeds/api/videos/-/HD"
114 -                                               else:
115 -                                                       self.FeedURL = self.BASE_STD_FEEDURL + str(config.plugins.mytube.general.startFeed.value)
116 -                                               self.getFeed(self.FeedURL, str(config.plugins.mytube.general.startFeed.value))
117 -
118 +                               self.switchToConfigList()
119 +                       self["feedlist"].style = "state"
120 +                       self['feedlist'].setList(self.statuslist)
121 +                       if self.FirstRun == True:
122 +                               if config.plugins.mytube.general.loadFeedOnOpen.value:
123 +                                       if config.plugins.mytube.general.startFeed.value == 'hd':
124 +                                               self.FeedURL = "http://gdata.youtube.com/feeds/api/videos/-/HD"
125 +                                       else:
126 +                                               self.FeedURL = self.BASE_STD_FEEDURL + str(config.plugins.mytube.general.startFeed.value)
127 +                                       self.getFeed(self.FeedURL, str(config.plugins.mytube.general.startFeed.value))
128  
129         def handleHelpWindow(self):
130                 print "[handleHelpWindow]"
131 @@ -1775,17 +1728,8 @@ class MyTubePlayer(Screen, InfoBarNotifications):
132  
133  
134  def MyTubeMain(session, **kwargs):
135 -       l2 = False
136 -       l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
137 -       if l2cert is None:
138 -               print "l2cert not found"
139 -               return
140 -       
141 -       l2key = validate_cert(l2cert, rootkey)
142 -       if l2key is None:
143 -               print "l2cert invalid"
144 -               return
145         l2 = True
146 +       l2key = None
147         if l2:
148                 session.open(MyTubePlayerMainScreen,l2key)
149