Quellcode durchsuchen

iztīīriti faili

Ivars vor 8 Jahren
Ursprung
Commit
12061cc262
28 geänderte Dateien mit 0 neuen und 14436 gelöschten Zeilen
  1. 0
    233
      ChoiceBox.py
  2. 0
    4836
      PlayStream.wpu
  3. BIN
      PlayStream0.png
  4. BIN
      PlayStream2.png
  5. 0
    0
      Tubular Bells
  6. BIN
      aaa.mp4
  7. 0
    43
      filmix_decode.py
  8. 0
    40
      filmix_decode2.py
  9. 0
    226
      iptvplayer.py
  10. 0
    1141
      iptvtools.py
  11. 0
    247
      ltc_api.py
  12. 0
    264
      playstreamproxy0.py
  13. 0
    5
      sniplets.py
  14. 0
    5
      streams.ini
  15. 0
    12
      test.bat
  16. BIN
      test.mp4
  17. 0
    76
      test10.py
  18. 0
    61
      test11.py
  19. 0
    200
      test7.py
  20. 0
    13
      test8.py
  21. 0
    72
      test9.py
  22. 0
    6
      test_m3u8.py
  23. 0
    24
      test_sources.py
  24. 0
    79
      ttaf.py
  25. 0
    80
      ttaf2srt.py
  26. 0
    6197
      urlparser.py
  27. 0
    546
      urlparserhelper.py
  28. 0
    30
      walterebert.com.crt

+ 0
- 233
ChoiceBox.py Datei anzeigen

@@ -1,233 +0,0 @@
1
-from Screens.Screen import Screen
2
-from Components.ActionMap import NumberActionMap
3
-from Components.Label import Label
4
-from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
5
-from Components.Sources.StaticText import StaticText
6
-from Components.Pixmap import Pixmap
7
-import enigma
8
-
9
-class ChoiceBox2(Screen):
10
-    skin =  """
11
-<screen name="ChoiceBox2" position="center,center" size="720,480" title="ChoiceBox" zPosition="5">
12
-    <widget name="text" position="0,0" size="720,0" font="Regular;30"/>
13
-    <widget name="list" font="Regular;22" position="10,10" size="710,460" scrollbarMode="showOnDemand" enableWrapAround="1"/>
14
-    <applet type="onLayoutFinish">
15
-            self["list"].instance.setItemHeight(25)
16
-    </applet>
17
-
18
-</screen>
19
-"""
20
-    #<applet type="onLayoutFinish">
21
-    #self.autoResize()
22
-    #</applet>
23
-    
24
-    def __init__(self, session, title="", list=None, keys=None, selection=0, skin_name=None, text=""):
25
-        Screen.__init__(self, session)        
26
-        #self.setTitle(_("Choice Box"))
27
-        if not list: list = []
28
-        if not skin_name: skin_name = []
29
-        #if isinstance(skin_name, str):
30
-        #	skin_name = [skin_name]
31
-        #self.skinName = skin_name + ["ChoiceBox"]
32
-        self["text"] = Label()
33
-        self.var = ""
34
-
35
-        if title:
36
-            title = _(title)
37
-            if len(title) < 55 and title.find('\n') == -1:
38
-                Screen.setTitle(self, title)
39
-            elif title.find('\n') != -1:
40
-                temptext = title.split('\n')
41
-                if len(temptext[0]) < 55:
42
-                    Screen.setTitle(self, temptext[0])
43
-                    count = 2
44
-                    labeltext = ""
45
-                    while len(temptext) >= count:
46
-                        if labeltext:
47
-                            labeltext += '\n'
48
-                        labeltext = labeltext + temptext[count-1]
49
-                        count += 1
50
-                        print 'count',count
51
-                    self["text"].setText(labeltext)
52
-                else:
53
-                    self["text"] = Label(title)
54
-            else:
55
-                self["text"] = Label(title)
56
-        elif text:
57
-            self["text"] = Label(_(text))
58
-        self.list = []
59
-        self.summarylist = []
60
-        if keys is None:
61
-            self.__keys = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red", "green", "yellow", "blue" ] + (len(list) - 10) * [""]
62
-        else:
63
-            self.__keys = keys + (len(list) - len(keys)) * [""]
64
-
65
-        self.keymap = {}
66
-        pos = 0
67
-        for x in list:
68
-            strpos = str(self.__keys[pos])
69
-            self.list.append(ChoiceEntryComponent(key = strpos, text = x))
70
-            if self.__keys[pos] != "":
71
-                self.keymap[self.__keys[pos]] = list[pos]
72
-            self.summarylist.append((self.__keys[pos], x[0]))
73
-            pos += 1
74
-        self["list"] = ChoiceList(list = self.list, selection = selection)
75
-        self["summary_list"] = StaticText()
76
-        self["summary_selection"] = StaticText()
77
-        self.updateSummary(selection)
78
-
79
-        self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"],
80
-                                          {
81
-                                              "ok": self.go,
82
-                                              "1": self.keyNumberGlobal,
83
-                                              "2": self.keyNumberGlobal,
84
-                                              "3": self.keyNumberGlobal,
85
-                                              "4": self.keyNumberGlobal,
86
-                                              "5": self.keyNumberGlobal,
87
-                                              "6": self.keyNumberGlobal,
88
-                                              "7": self.keyNumberGlobal,
89
-                                              "8": self.keyNumberGlobal,
90
-                                              "9": self.keyNumberGlobal,
91
-                                              "0": self.keyNumberGlobal,
92
-                                              "red": self.keyRed,
93
-                                              "green": self.keyGreen,
94
-                                              "yellow": self.keyYellow,
95
-                                              "blue": self.keyBlue,
96
-                                              "up": self.up,
97
-                                              "down": self.down,
98
-                                              "left": self.left,
99
-                                              "right": self.right
100
-                                              }, -1)
101
-
102
-        self["cancelaction"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"],
103
-                                               {
104
-                                                   "back": self.cancel,
105
-                                                   }, -1)
106
-        #self.onShown.append(self.onshow)
107
-
108
-    def autoResize(self):
109
-        desktop_w = enigma.getDesktop(0).size().width()
110
-        desktop_h = enigma.getDesktop(0).size().height()
111
-        count = len(self.list)
112
-        itemheight = self["list"].getItemHeight()
113
-        if count > 15:
114
-            count = 15
115
-        if not self["text"].text:
116
-            # move list
117
-            textsize = (520, 0)
118
-            listsize = (520, itemheight*count)
119
-            self["list"].instance.move(enigma.ePoint(0, 0))
120
-            self["list"].instance.resize(enigma.eSize(*listsize))
121
-        else:
122
-            textsize = self["text"].getSize()
123
-            if textsize[0] < textsize[1]:
124
-                textsize = (textsize[1],textsize[0]+10)
125
-            if textsize[0] > 520:
126
-                textsize = (textsize[0], textsize[1]+itemheight)
127
-            else:
128
-                textsize = (520, textsize[1]+itemheight)
129
-            listsize = (textsize[0], itemheight*count)
130
-            # resize label
131
-            self["text"].instance.resize(enigma.eSize(*textsize))
132
-            self["text"].instance.move(enigma.ePoint(10, 10))
133
-            # move list
134
-            self["list"].instance.move(enigma.ePoint(0, textsize[1]))
135
-            self["list"].instance.resize(enigma.eSize(*listsize))
136
-
137
-        wsizex = textsize[0]
138
-        wsizey = textsize[1]+listsize[1]
139
-        wsize = (wsizex, wsizey)
140
-        self.instance.resize(enigma.eSize(*wsize))
141
-
142
-        # center window
143
-        self.instance.move(enigma.ePoint((desktop_w-wsizex)/2, (desktop_h-wsizey)/2))
144
-
145
-    def left(self):
146
-        if len(self["list"].list) > 0:
147
-            while 1:
148
-                self["list"].instance.moveSelection(self["list"].instance.pageUp)
149
-                self.updateSummary(self["list"].l.getCurrentSelectionIndex())
150
-                if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0:
151
-                    break
152
-
153
-    def right(self):
154
-        if len(self["list"].list) > 0:
155
-            while 1:
156
-                self["list"].instance.moveSelection(self["list"].instance.pageDown)
157
-                self.updateSummary(self["list"].l.getCurrentSelectionIndex())
158
-                if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0:
159
-                    break
160
-
161
-    def up(self):
162
-        if len(self["list"].list) > 0:
163
-            while 1:
164
-                self["list"].instance.moveSelection(self["list"].instance.moveUp)
165
-                self.updateSummary(self["list"].l.getCurrentSelectionIndex())
166
-                if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0:
167
-                    break
168
-
169
-    def down(self):
170
-        if len(self["list"].list) > 0:
171
-            while 1:
172
-                self["list"].instance.moveSelection(self["list"].instance.moveDown)
173
-                self.updateSummary(self["list"].l.getCurrentSelectionIndex())
174
-                if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == len(self["list"].list) - 1:
175
-                    break
176
-
177
-    # runs a number shortcut
178
-    def keyNumberGlobal(self, number):
179
-        self.goKey(str(number))
180
-
181
-    # runs the current selected entry
182
-    def go(self):
183
-        cursel = self["list"].l.getCurrentSelection()
184
-        if cursel:
185
-            self.goEntry(cursel[0])
186
-        else:
187
-            self.cancel()
188
-
189
-    # runs a specific entry
190
-    def goEntry(self, entry):
191
-        if entry and len(entry) > 3 and isinstance(entry[1], str) and entry[1] == "CALLFUNC":
192
-            arg = entry[3]
193
-            entry[2](arg)
194
-        elif entry and len(entry) > 2 and isinstance(entry[1], str) and entry[1] == "CALLFUNC":
195
-            entry[2](None)
196
-        else:
197
-            self.close(entry)
198
-
199
-    # lookups a key in the keymap, then runs it
200
-    def goKey(self, key):
201
-        if self.keymap.has_key(key):
202
-            entry = self.keymap[key]
203
-            self.goEntry(entry)
204
-
205
-    # runs a color shortcut
206
-    def keyRed(self):
207
-        self.goKey("red")
208
-
209
-    def keyGreen(self):
210
-        self.goKey("green")
211
-
212
-    def keyYellow(self):
213
-        self.goKey("yellow")
214
-
215
-    def keyBlue(self):
216
-        self.goKey("blue")
217
-
218
-    def updateSummary(self, curpos=0):
219
-        pos = 0
220
-        summarytext = ""
221
-        for entry in self.summarylist:
222
-            if curpos-2 < pos < curpos+5:
223
-                if pos == curpos:
224
-                    summarytext += ">"
225
-                    self["summary_selection"].setText(entry[1])
226
-                else:
227
-                    summarytext += entry[0]
228
-                summarytext += ' ' + entry[1] + '\n'
229
-            pos += 1
230
-        self["summary_list"].setText(summarytext)
231
-
232
-    def cancel(self):
233
-        self.close(None)

+ 0
- 4836
PlayStream.wpu
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


BIN
PlayStream0.png Datei anzeigen


BIN
PlayStream2.png Datei anzeigen


+ 0
- 0
Tubular Bells Datei anzeigen


BIN
aaa.mp4 Datei anzeigen


+ 0
- 43
filmix_decode.py Datei anzeigen

@@ -1,43 +0,0 @@
1
-import base64
2
-
3
-def DecodeUppodTextHash( data ):
4
-    hash = "0123456789WGXMHRUZID=NQVBLihbzaclmepsJxdftioYkngryTwuvihv7ec41D6GpBtXx3QJRiN5WwMf=ihngU08IuldVHosTmZz9kYL2bayE"
5
-    data = DecodeUppod_tr(data, "r", "A")
6
-    data = data.replace("\n", "")
7
-    hash = hash.split('ih')
8
-
9
-    if data.endswith('!'):
10
-        data = data[:-1]
11
-        taba = hash[3]
12
-        tabb = hash[2]
13
-    else:
14
-        taba = hash[1]
15
-        tabb = hash[0]
16
-
17
-    i = 0;
18
-    while i < len(taba):
19
-        data = data.replace(tabb[i], "__"   )
20
-        data = data.replace(taba[i], tabb[i])
21
-        data = data.replace("__"   , taba[i])
22
-        i += 1
23
-
24
-    result = base64.b64decode(data)
25
-    return result
26
-
27
-def DecodeUppod_tr(data, ch1, ch2):
28
-    if data[:-1].endswith(ch1) and data[2]==ch2:
29
-        srev = data[::-1]  # revers string
30
-        try:
31
-            loc3 = int(float(srev[-2:]) / 2) # get number at end of string
32
-        except ValueError:
33
-            return data
34
-        srev = srev[2:-3] # get string between ch1 and ch2
35
-        if loc3 < len(srev):
36
-            i = loc3
37
-            while i < len(srev):
38
-                srev = srev[:i] + srev[i+1:] # remove char at index i
39
-                i += loc3
40
-        data = srev + "!"
41
-    return data
42
-
43
-print(DecodeUppodTextHash('XRHzQZe3yv7s2iJgQx687awzQWkvy1bvyv2350Jlf0ts2jAz2WtG5W5LfmJl5jQL502z5i5sfZtMDj23a0A0y0Uj2xkT5mcl5MUWfjcz2j5G5mElOmtGOm5n5mJYOitLyWD47j6GPk44yCl0fjb7'))

+ 0
- 40
filmix_decode2.py Datei anzeigen

@@ -1,40 +0,0 @@
1
-import base64
2
-import re
3
-from collections import OrderedDict
4
-import sys
5
-
6
-def decode_uppod_text( text): 
7
-    Client_codec_a = ["l", "u", "T", "D", "Q", "H", "0", "3", "G", "1", "f", "M", "p", "U", "a", "I", "6", "k", "d", "s", "b", "W", "5", "e", "y", "="]
8
-    Client_codec_b = ["w", "g", "i", "Z", "c", "R", "z", "v", "x", "n", "N", "2", "8", "J", "X", "t", "9", "V", "7", "4", "B", "m", "Y", "o", "L", "h"]    
9
-    text = text.replace("\n", "").strip()
10
-    for i in range(len(Client_codec_a)):
11
-        char1 = Client_codec_b[i]
12
-        char2 = Client_codec_a[i]
13
-        text = text.replace(char1, "___")
14
-        text = text.replace(char2, char1)
15
-        text = text.replace("___", char2)
16
-    result = base64.b64decode(text)
17
-    print result
18
-    return result
19
-
20
-def get_streams(url0):
21
-    res = re.search("\[([\d,]+)]",url0).group(1)
22
-    streams=[]
23
-    for res in res.split(","):
24
-        if not res: continue
25
-        url=re.sub("\[[\d,]+]",res,url0)
26
-        streams.append((res,url))
27
-    return streams
28
-
29
-if len(sys.argv)>1:
30
-    text=sys.argv[1]
31
-else:
32
-    text = """
33
-XRHzQZe3yMD8Bxn8oCYgDac3Qxl350Jlf0ts2jAz2WtG5W5LfmJl5jQL502z5i5sfZtMDj237aA3cm7wB1H0yW6WywftSJk2HCYzoRch
34
-"""
35
-url = decode_uppod_text(text)
36
-m=re.search("http://.+?\[.+?\].+",url)
37
-if m:
38
-    streams = get_streams(url)
39
-    for s in streams: print s[0],s[1]
40
-    

+ 0
- 226
iptvplayer.py Datei anzeigen

@@ -1,226 +0,0 @@
1
-from Screens.Screen import Screen
2
-from Screens.InfoBarGenerics import InfoBarSeek, InfoBarAudioSelection, InfoBarNotifications, InfoBarSubtitleSupport, InfoBarShowHide
3
-   
4
-
5
-from Screens.HelpMenu import HelpableScreen
6
-from Components.ActionMap import HelpableActionMap
7
-from Components.config import config
8
-from Components.AVSwitch import eAVSwitch
9
-from Screens.ChoiceBox import ChoiceBox
10
-from Components.ServiceEventTracker import ServiceEventTracker
11
-from enigma import iPlayableService, eTimer
12
-from iptvtools import printDBG, printExc, eConnectCallback
13
-
14
-class customMoviePlayer(InfoBarShowHide, InfoBarSeek, InfoBarAudioSelection, InfoBarSubtitleSupport, HelpableScreen, InfoBarNotifications, Screen):
15
-
16
-    STATE_IDLE = 0
17
-    STATE_PLAYING = 1
18
-    STATE_PAUSED = 2
19
-    ENABLE_RESUME_SUPPORT = True
20
-    ALLOW_SUSPEND = True
21
-    
22
-        
23
-    def __init__(self, session, service, lastPosition=None, bugEOFworkaround=0):
24
-        Screen.__init__(self, session)
25
-        self.skinName = "MoviePlayer"
26
-        
27
-        self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
28
-            {
29
-                iPlayableService.evEOF: self.__evEOF,
30
-                iPlayableService.evSOF: self.__evEOF,
31
-            })
32
-        
33
-        self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
34
-            {
35
-                "leavePlayer": (self.leavePlayer, _("leave movie player...")),
36
-            }, -5)
37
-        
38
-        for x in HelpableScreen, InfoBarShowHide, InfoBarSeek, InfoBarAudioSelection, InfoBarSubtitleSupport, InfoBarNotifications:
39
-            x.__init__(self)
40
-            
41
-        # InfoBarServiceNotifications
42
-                    
43
-        self.onClose.append(self.__onClose)
44
-        self.mainTimer = eTimer()
45
-        self.mainTimer_conn = eConnectCallback(self.mainTimer.timeout, self.timerCallBack)
46
-        self.mainTimer.start(1000)
47
-        self.bugEOFworkaround = bugEOFworkaround
48
-        
49
-        self.session.nav.playService(service)
50
-        if lastPosition != None and (lastPosition / 90000) > 10:
51
-            self.position = 0
52
-            self.lastPosition = lastPosition
53
-            self.doSeekToLastPosition = True
54
-        else:
55
-            self.position = 0  
56
-            self.lastPosition = 0
57
-            self.doSeekToLastPosition = False
58
-        self.waitForSeekToLastPosition = 0
59
-        self.stopTimeFix = 0
60
-
61
-        self.returning = False
62
-        self.aspectratiomode = "1"
63
-        self.isClosing = False
64
-        
65
-    def getPosition(self):
66
-        time = 0
67
-        length = 0
68
-        service = self.session.nav.getCurrentService()
69
-        seek = service and service.seek()
70
-        if seek != None:
71
-            r = seek.getLength()
72
-            if not r[0]:
73
-                length = r[1]
74
-            r = seek.getPlayPosition()
75
-            if not r[0]:
76
-                time = r[1] #float(float(r[1]) / float(90000))
77
-        return time, length
78
-        
79
-    def doSeekRelative(self, pts):
80
-        printDBG("doSeekRelative pts[%r]" % pts)
81
-        InfoBarSeek.doSeekRelative(self, pts)
82
-        self.waitForSeekToLastPosition = -1
83
-    
84
-    def timerCallBack(self):
85
-        try:
86
-            position, length = self.getPosition()
87
-            if self.doSeekToLastPosition and self.seekstate == self.SEEK_STATE_PLAY:
88
-                printDBG("timerCallBack doSeekToLastPosition[%r]" % self.lastPosition)
89
-                # not sure why but riginal MP doSeek method does nothing, so I use on seeking only doSeekRelative
90
-                self.doSeekRelative(self.lastPosition - position)
91
-                self.doSeekToLastPosition = False
92
-                self.stopTimeFix  = 0
93
-                self.lastPosition = 0
94
-                return
95
-                
96
-            if -1 == self.waitForSeekToLastPosition:
97
-                if position > 0:
98
-                    self.waitForSeekToLastPosition = position
99
-                printDBG('________waitForSeekToLastPosition position[%r]' % (position) )
100
-                return
101
-            printDBG('________timerCallBack position [%r], length[%r], seekstate[%r]' % (position, length, self.seekstate) )
102
-            if self.waitForSeekToLastPosition > 0 and self.waitForSeekToLastPosition >= position: return
103
-            self.waitForSeekToLastPosition = 0
104
-            if self.bugEOFworkaround == 0 or position == 0 or self.seekstate != self.SEEK_STATE_PLAY: return #== self.SEEK_STATE_PAUSE: return
105
-            self.lastPosition = position
106
-        except:
107
-            printExc()
108
-            return
109
-
110
-        if position != self.position:
111
-            self.position = position
112
-            self.stopTimeFix  = 0
113
-        else:
114
-            self.stopTimeFix += 1
115
-        if self.stopTimeFix >= self.bugEOFworkaround:
116
-            self.mainTimer.stop()
117
-            self.leavePlayer(True)
118
-    
119
-    def aspectChange(self):
120
-        printDBG("Aspect Ratio [%r]" % self.aspectratiomode)
121
-        if self.aspectratiomode == "1": #letterbox
122
-            eAVSwitch.getInstance().setAspectRatio(0)
123
-            self.aspectratiomode = "2"
124
-            return
125
-        elif self.aspectratiomode == "2": #nonlinear
126
-            self.aspectratiomode = "3"
127
-        elif self.aspectratiomode == "3": #nonlinear
128
-            eAVSwitch.getInstance().setAspectRatio(2)
129
-            self.aspectratiomode = "4"
130
-        elif self.aspectratiomode == "4": #panscan
131
-            eAVSwitch.getInstance().setAspectRatio(3)
132
-            self.aspectratiomode = "1"
133
-            
134
-    def pauseBeforeClose(self):
135
-        printDBG("pauseBeforeClose")
136
-        service = self.session.nav.getCurrentService()
137
-        if service is None:
138
-            printDBG("No Service found")
139
-            return False
140
-        pauseable = service.pause()
141
-        if pauseable is None:
142
-            printDBG("not pauseable.")
143
-        else:
144
-            printDBG("pausable")
145
-            pauseable.pause()
146
-        return True
147
-        
148
-    def leavePlayer(self, endFile=False):
149
-        printDBG("customMoviePlayer.leavePlayer isClosing[%r], endFile[%r]" % (self.isClosing, endFile))
150
-        if False == self.isClosing:
151
-            self.pauseBeforeClose()
152
-            #self.session.nav.playService(None)
153
-            if endFile:
154
-                self._doClose(1)
155
-            else:
156
-                self._doClose(0)
157
-
158
-    def doEofInternal(self, playing):
159
-        printDBG( "--- eofint movieplayer ---" )
160
-        self.leavePlayer(True)
161
-        
162
-    def _doClose(self, sts):
163
-        printDBG("_doClose sts[%r], lastPosition[%r]" % (sts, self.lastPosition) )
164
-        try:
165
-            self.hide()
166
-            self.isClosing = True
167
-            self.onShow = []
168
-            self.onHide = []
169
-            self.hideTimer.stop()
170
-        except:
171
-            printExc(customMoviePlayer._doClose)
172
-        self.close(sts, self.lastPosition)
173
-        
174
-    def __evEOF(self):
175
-        printDBG( "evEOF=%d" % iPlayableService.evEOF)
176
-        self.leavePlayer(True)
177
-        
178
-    def __onClose(self):
179
-        printDBG("customMoviePlayer.__onClose")
180
-        self.mainTimer.stop()
181
-        self.mainTimer_conn = None
182
-        self.onClose.remove(self.__onClose)
183
-        
184
-    def show(self):
185
-        if False == self.isClosing:
186
-            Screen.show(self)
187
-        else:
188
-            printExc("customMoviePlayer.show")
189
-            
190
-    def doShow(self):
191
-        if False == self.isClosing:
192
-            InfoBarShowHide.doShow(self)
193
-        else:
194
-            printExc("customMoviePlayer.doShow")
195
-    
196
-    def openEventView(self, *args, **kwargs):
197
-        pass
198
-        
199
-#####################################################
200
-# movie player by j00zek
201
-#####################################################
202
-from Screens.InfoBar import MoviePlayer as standardMoviePlayer
203
-from enigma import eServiceReference
204
-
205
-class IPTVStandardMoviePlayer(standardMoviePlayer):
206
-    def __init__(self, session, uri, title):
207
-        self.session = session
208
-        self.WithoutStopClose = True
209
-        #if '://' not in uri: uri = 'file://' + uri
210
-        fileRef = eServiceReference(4097,0,uri)
211
-        fileRef.setName (title)
212
-
213
-        standardMoviePlayer.__init__(self, self.session, fileRef)
214
-        self.skinName = "MoviePlayer"
215
-        standardMoviePlayer.skinName = "MoviePlayer"
216
-
217
-
218
-class IPTVMiniMoviePlayer(customMoviePlayer):
219
-    def __init__(self, session, uri, title, lastPosition=None, bugEOFworkaround=0):
220
-        self.session = session
221
-        self.WithoutStopClose = True
222
-        #if '://' not in uri: uri = 'file://' + uri
223
-        fileRef = eServiceReference(4097,0,uri)
224
-        fileRef.setName (title)
225
-        customMoviePlayer.__init__(self, self.session, fileRef, lastPosition, bugEOFworkaround)
226
-#####################################################

+ 0
- 1141
iptvtools.py
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 247
ltc_api.py Datei anzeigen

@@ -1,247 +0,0 @@
1
-# coding: utf-8
2
-import sys, os, os.path, re, sys
3
-import urllib,urllib2
4
-from xml.sax.saxutils import unescape,escape
5
-from urllib import quote, unquote
6
-
7
-user_agent = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; da-dk) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3"
8
-headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
9
-
10
-########################################################################
11
-class LattelecomTV(object):
12
-    """www.lattelecom.tv video server handling object"""
13
-
14
-    #----------------------------------------------------------------------
15
-    def __init__(self):
16
-        self.name = "ltc"
17
-        self.title = "lattelecom.tv"
18
-        self.headers = headers2dict("""
19
-Host: m.lattelecom.tv
20
-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile Safari/600.1.4
21
-Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
22
-Accept-Language: en-US,en;q=0.5
23
-DNT: 1
24
-Connection: keep-alive""")
25
-
26
-
27
-    #----------------------------------------------------------------------
28
-    def login(self,user,password):
29
-        """Login in to site, create session cookies"""
30
-        url0 = "https://m.lattelecom.tv"
31
-        class NoRedirectHandler(urllib2.HTTPRedirectHandler):
32
-            def http_error_302(self, req, fp, code, msg, headers):
33
-                infourl = urllib.addinfourl(fp, headers, req.get_full_url())
34
-                infourl.status = code
35
-                infourl.code = code
36
-                return infourl
37
-            http_error_300 = http_error_302
38
-            http_error_301 = http_error_302
39
-            http_error_303 = http_error_302
40
-            http_error_307 = http_error_302
41
-
42
-        # Dabūjam sesijas id un url_gif, kas redirektējas uz auth_url
43
-        headers = headers2dict("""
44
-Host: m.lattelecom.tv
45
-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile Safari/600.1.4
46
-Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
47
-Accept-Language: en-US,en;q=0.5
48
-DNT: 1
49
-Connection: keep-alive
50
-    """)
51
-        response = urllib2.urlopen(urllib2.Request(url0+"/authorization", headers=headers))
52
-        session_id = response.headers["set-cookie"].split(";")[0]
53
-        html = response.read()
54
-        url_gif = url0 + re.search('(/auth/\d+.gif)', html).group(1)
55
-
56
-        # Dabūtjam auth_url
57
-        headers = headers2dict("""
58
-Host: m.lattelecom.tv
59
-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile Safari/600.1.4
60
-Accept: image/png,image/*;q=0.8,*/*;q=0.5
61
-Accept-Language: en-US,en;q=0.5
62
-Accept-Encoding: gzip, deflate
63
-DNT: 1
64
-Referer: https://m.lattelecom.tv/authorization
65
-Connection: keep-alive
66
-    """)
67
-        headers["Cookie"] = session_id
68
-        urllib2.install_opener(urllib2.build_opener(NoRedirectHandler()))
69
-        response = urllib2.urlopen(urllib2.Request(url_gif, headers=headers))
70
-        if response.code == 302:
71
-            url_auth = response.headers["location"]
72
-        else:
73
-            self.error = u"auth.gif nenostrādāja"
74
-            #raise u"auth.gif nenostrādāja"
75
-            return False
76
-
77
-        # Pierakstāmies iekš auth.lattelecom.lv
78
-        headers = headers2dict("""
79
-            Host: auth.lattelecom.lv
80
-            User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
81
-            Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
82
-            Accept-Language: en-US,en;q=0.5
83
-            Accept-Encoding: gzip, deflate
84
-            DNT: 1
85
-            Referer: http://m.lattelecom.tv/authorization
86
-            Connection: keep-alive
87
-        """)
88
-        response = urllib2.urlopen(urllib2.Request(url_auth, headers=headers))
89
-        if not response.code == 302:
90
-            self.error = u"pierakstīšanās auth.lattelecom.lv nenostrādāja"
91
-            return False
92
-            #raise "pierakstīšanās auth.lattelecom.lv nenostrādāja"
93
-
94
-        # nolasām auth_gif
95
-    ##    headers = headers2dict("""
96
-    ##        Host: m.lattelecom.tv
97
-    ##        User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
98
-    ##        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
99
-    ##        Accept-Language: en-US,en;q=0.5
100
-    ##        Accept-Encoding: gzip, deflate
101
-    ##        DNT: 1
102
-    ##        Referer: http://m.lattelecom.tv/authorization
103
-    ##    """)
104
-    ##    headers["Cookie"] = session_id
105
-    ##    response = urllib2.urlopen(urllib2.Request(url_gif, headers=headers))
106
-    ##    if not response.code == 200:
107
-    ##        raise u"kļūda lasot auth_gif"
108
-
109
-        # Mēģinam ielogoties
110
-        headers = headers2dict("""
111
-Host: m.lattelecom.tv
112
-User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
113
-Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
114
-Accept-Language: en-US,en;q=0.5
115
-Accept-Encoding: deflate
116
-DNT: 1
117
-Referer: http://m.lattelecom.tv/authorization
118
-Connection: keep-alive
119
-Content-Type: application/x-www-form-urlencoded""")
120
-        headers["Cookie"] = session_id
121
-        data = "login=yes&email=%s&passw=%s"%(user,password)
122
-        req = urllib2.Request(url0+"/authorization", data, headers)
123
-        response = urllib2.urlopen(req)
124
-        #with open("auth.htm","w") as f: f.write(response.read())
125
-        if not response.code == 302:
126
-            self.error = u"kļūda ielogojoties"
127
-            #raise u"kļūda ielogojoties"
128
-            return False
129
-        mobtv = response.headers["set-cookie"].split(";")[0]
130
-        if not mobtv.split("=")[0]=="mobtv_cache":
131
-            #raise "nav mobtv cookie!"
132
-            self.error = "nav mobtv cookie!"
133
-            return False
134
-
135
-        # atveram /account
136
-    ##    headers = headers2dict("""
137
-    ##        Host: m.lattelecom.tv
138
-    ##        User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
139
-    ##        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
140
-    ##        Accept-Language: en-US,en;q=0.5
141
-    ##        Accept-Encoding: deflate
142
-    ##        DNT: 1
143
-    ##        Referer: http://m.lattelecom.tv/authorization
144
-    ##        Connection: keep-alive    """)
145
-    ##    headers["Cookie"] = "%s; %s"%(session_id,mobtv)
146
-    ##    response = urllib2.urlopen(urllib2.Request(url0+"/account", headers=headers))
147
-    ##    if not response.code == 302:
148
-    ##        raise u"kļūda atverot /account"
149
-
150
-        # atveram /profils
151
-    ##    headers = headers2dict("""
152
-    ##        Host: m.lattelecom.tv
153
-    ##        User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
154
-    ##        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
155
-    ##        Accept-Language: en-US,en;q=0.5
156
-    ##        Accept-Encoding: deflate
157
-    ##        DNT: 1
158
-    ##        Referer: http://m.lattelecom.tv/authorization
159
-    ##        Connection: keep-alive
160
-    ##    """)
161
-    ##    headers["Cookie"] = "%s; %s"%(session_id,mobtv)
162
-    ##    response = urllib2.urlopen(urllib2.Request(url0+"/profils", headers=headers))
163
-    ##    if not response.code == 200:
164
-    ##        raise u"kļūda atverot /profils"
165
-    ##    with open("profils.htm","w") as f: f.write(response.read())
166
-
167
-        self.mobtv_cache = mobtv
168
-        self.session_id = session_id
169
-        self.error = ""
170
-        return True
171
-
172
-    #----------------------------------------------------------------------
173
-    def get_tv_channels(self,):
174
-        """Get tv channels list"""
175
-        url = "https://m.lattelecom.tv/tiesraide"
176
-        response = urllib2.urlopen(urllib2.Request(url, headers=self.headers))
177
-        html =  response.read()
178
-        channels = re.findall(r'(?si)data-url="/tiesraide/(.*?)"><div title="(.*?)" class="channel-placeholder" style="width: 131px; height: 131px; background-image:url\(/media/imse/105x105s/channels/(.*?)\)', html)
179
-        for i in range(len(channels)):
180
-            channels[i]=[channels[i][0],channels[i][1],"https://m.lattelecom.tv/media/imse/100x100s/channels/"+channels[i][2]]
181
-        return channels
182
-
183
-    #----------------------------------------------------------------------
184
-    def get_tv_url(self,video_id):
185
-        """Get m3u8 url for given live tv channel"""
186
-        url = "https://m.lattelecom.tv/tiesraide/%s"%video_id
187
-        headers = self.headers
188
-        headers["Cookie"] = "%s; %s; _hjIncludedInSample=0; MobBitr=1; MobRentBitr=hq; MobRentLang=lv;"%(self.session_id,self.mobtv_cache)
189
-        response = urllib2.urlopen(urllib2.Request(url, headers=headers))
190
-        html = response.read()
191
-        m3u8 = re.search('x-mpegURL" src="(.*?)"', html).group(1) if "x-mpegURL" in html else ""
192
-        return unescape(m3u8)
193
-
194
-    #----------------------------------------------------------------------
195
-    def get_noma_url(self,video_id,quality="hq",language="lv"):
196
-        """Get m3u8 url for given rental video"""
197
-        url = "https://m.lattelecom.tv/free_origin?show_origin=1&type=4&video_url=%s&bitrate=%s&lng=%s"%(video_id,quality,language)
198
-        headers = self.headers
199
-        headers["Cookie"] = "%s; %s; MobRentBitr=%s; MobBitr=1; MobRentLang=%s"%(self.session_id,self.mobtv_cache,quality,language)
200
-        response = urllib2.urlopen(urllib2.Request(url, headers=headers))
201
-        m3u8 = response.read()
202
-        return unescape(m3u8)
203
-
204
-    #----------------------------------------------------------------------
205
-    def get_arhivs_url(self,video_id):
206
-        """Get m3u8 url for given archive video"""
207
-        url = "https://m.lattelecom.tv/free_origin?show_origin=1&type=arhivs&event_id=%s&bitrate=mhq"%video_id
208
-        headers = self.headers
209
-        headers["Cookie"] = "%s; %s; MobBitr=1; "%(self.session_id,self.mobtv_cache)
210
-        response = urllib2.urlopen(urllib2.Request(url, headers=headers))
211
-        m3u8 = response.read()
212
-        return unescape(m3u8)
213
-
214
-def create_bouquet(ltc,fname,bname):
215
-    import codecs
216
-    import enigma2_api
217
-    e2 = enigma2_api.DBServices()
218
-    e2.create_bouqet(self.name, self.title)
219
-    with open(fname,"w") as f:
220
-        f.write("#NAME %s\n"%bname)
221
-        channels = ltc.get_tv_channels()
222
-        for i,(ch,title,picon_url) in enumerate(channels):
223
-            url=ltc.get_tv_url(ch)
224
-            print title #, url, picon_url
225
-            sref = "1:0:1:%i:777:777:0:0:0:0:"%i
226
-            #sref = e2.get_service_by_name(title.lower())
227
-            #if sref:
228
-            #    sref = sref[0]["sref"]
229
-            f.write("#SERVICE %s%s:%s\n"%(sref,quote(url),title))
230
-            f.write("#DESCRIPTION %s\n"%title)
231
-            pass
232
-
233
-if __name__ == "__main__":
234
-    #sys.exit(main(sys.argv))
235
-    #import enigma2_api
236
-    #e2 = enigma2_api.DBServices()
237
-    ltc = LattelecomTV()
238
-    if not ltc.login("ivars777","kaskade7"):
239
-        print "Error during login"
240
-        sys.exit()
241
-    else:
242
-        print 'Logged in'
243
-    service_path = "enigma2" if sys.platform=="win32" else "/etc/enigma2"
244
-    create_bouquet(ltc, os.path.join(service_path,"userbouquet.ltc.tv"), "lattelecom.tv")
245
-
246
-
247
-

+ 0
- 264
playstreamproxy0.py Datei anzeigen

@@ -1,264 +0,0 @@
1
-#!/usr/bin/python
2
-
3
-""" Livestreamer Deamon """
4
-
5
-import os
6
-import sys
7
-import time
8
-import atexit
9
-import re
10
-
11
-from signal import SIGTERM
12
-
13
-from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
14
-from SocketServer import ThreadingMixIn
15
-#from livestreamer import Livestreamer
16
-from urllib import unquote, quote
17
-import urllib,urlparse
18
-import requests
19
-from requests.packages.urllib3.exceptions import InsecureRequestWarning
20
-requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
21
-
22
-
23
-HOST_NAME = ""
24
-PORT_NUMBER = 88
25
-LIVESTREAMER = None
26
-
27
-headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
28
-sessions = {}
29
-
30
-class StreamHandler(BaseHTTPRequestHandler):
31
-
32
-    def do_HEAD(self):
33
-        self.send_response(200)
34
-        self.send_header("Server", "StreamProxy")
35
-        self.send_header("Content-type", "text/html")
36
-        self.end_headers()
37
-
38
-    def do_GET(self):
39
-        """Respond to a GET request."""
40
-        #self.send_header("Connection", "keep-alive")
41
-        #Content-Type: video/mp4
42
-        #self.end_headers()
43
-        # http://localhost:88/hls?u=url.com/aaa/bbb.m3u8&h=headers&d=data
44
-        # http://localhost:88/http://walterebert.com/playground/video/hls/ts/480x270.m3u8?token=xxxx|User-Agent=Enigma2|Cookie=xxxxx
45
-        p = self.path.split("~")
46
-        url = urllib.unquote(p[0][1:])
47
-        headers = headers2dict("""
48
-        User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
49
-        """)
50
-        
51
-        if len(p)>1:
52
-            for h in p[1:]:
53
-                headers[h.split("=")[0]]=urllib.unquote(h.split("=")[1])
54
-        #self.fetch_offline(self.wfile)
55
-        try:
56
-            self.fetch_url(self.wfile, url, headers)
57
-        except Exception as e:
58
-            print "Got Exception: ", str(e)
59
-        
60
-    def fetch_offline(self,wfile):
61
-        self.send_response(200)
62
-        self.send_header("Server", "StreamProxy")
63
-        self.send_header("Content-type", "video/mp4")
64
-        self.end_headers()
65
-        self.wfile.write(open("offline.mp4", "rb").read())
66
-        self.wfile.close()
67
-        
68
-    
69
-    def fetch_url(self, wfile, url, headers):
70
-        self.log_message("fetch_url: %s", url)
71
-        #self.log_message("headers: %s", headers)
72
-        
73
-        
74
-        base_url = "/".join(url.split("/")[0:-1])
75
-        if base_url not in sessions:
76
-            sessions[base_url] = requests.Session()
77
-        sessions[base_url].headers.update(headers)
78
-        #print "request headers: ",sessions[base_url].headers        
79
-        r = sessions[base_url].get(url, stream=True,verify=False)
80
-        self.send_response(int(r.status_code))
81
-        self.send_header("Content-Type",r.headers["Content-Type"])
82
-        for h in r.headers:
83
-            if h in ("Content-Type","Server","Set-Cookie"):continue
84
-            self.send_header(h, r.headers[h])
85
-            #print h,"=",r.headers[h]
86
-        self.end_headers()
87
-        if r.status_code == 200:
88
-            for chunk in r.iter_content(4096):
89
-                try:
90
-                    wfile.write(chunk) 
91
-                except Exception as e:
92
-                    print "Exception: ", str(e)
93
-                    pass
94
-                #print ".",
95
-            #self.wfile.close()
96
-            #print "  url streaming finished"
97
-            
98
-        else:
99
-            self.send_response(200)
100
-  
101
-class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
102
-    """Handle requests in a separate thread."""
103
-
104
-def start():
105
-    #global LIVESTREAMER
106
-    #LIVESTREAMER = Livestreamer()
107
-    httpd = ThreadedHTTPServer((HOST_NAME, PORT_NUMBER), StreamHandler)
108
-    print time.asctime(), "Server Starts - %s:%s" % (HOST_NAME, PORT_NUMBER)
109
-    try:
110
-        httpd.serve_forever()
111
-    except KeyboardInterrupt:
112
-        pass
113
-    httpd.server_close()
114
-    print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
115
-
116
-
117
-class Daemon:
118
-    """
119
-    A generic daemon class.
120
-    Usage: subclass the Daemon class and override the run() method
121
-    """
122
-    def __init__(self, pidfile, stdin="/dev/null", stdout="/dev/null", stderr="/dev/null"):
123
-        self.stdin = stdin
124
-        self.stdout = stdout
125
-        self.stderr = stderr
126
-        self.pidfile = pidfile
127
-
128
-    def daemonize(self):
129
-        """
130
-        do the UNIX double-fork magic, see Stevens' "Advanced 
131
-        Programming in the UNIX Environment" for details (ISBN 0201563177)
132
-        http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
133
-        """
134
-        try: 
135
-            pid = os.fork() 
136
-            if pid > 0:
137
-                # exit first parent
138
-                sys.exit(0) 
139
-        except OSError, e: 
140
-            sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror))
141
-            sys.exit(1)
142
-
143
-        # decouple from parent environment
144
-        os.chdir("/") 
145
-        os.setsid() 
146
-        os.umask(0) 
147
-
148
-        # do second fork
149
-        try: 
150
-            pid = os.fork() 
151
-            if pid > 0:
152
-                # exit from second parent
153
-                sys.exit(0) 
154
-        except OSError, e: 
155
-            sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror))
156
-            sys.exit(1) 
157
-
158
-        # redirect standard file descriptors
159
-        sys.stdout.flush()
160
-        sys.stderr.flush()
161
-        si = file(self.stdin, "r")
162
-        so = file(self.stdout, "a+")
163
-        se = file(self.stderr, "a+", 0)
164
-        os.dup2(si.fileno(), sys.stdin.fileno())
165
-        os.dup2(so.fileno(), sys.stdout.fileno())
166
-        os.dup2(se.fileno(), sys.stderr.fileno())
167
-
168
-        # write pidfile
169
-        atexit.register(self.delpid)
170
-        pid = str(os.getpid())
171
-        file(self.pidfile,"w+").write("%s\n" % pid)
172
-
173
-    def delpid(self):
174
-        os.remove(self.pidfile)
175
-
176
-    def start(self):
177
-        """
178
-        Start the daemon
179
-        """
180
-        # Check for a pidfile to see if the daemon already runs
181
-        try:
182
-            pf = file(self.pidfile,"r")
183
-            pid = int(pf.read().strip())
184
-            pf.close()
185
-        except IOError:
186
-            pid = None
187
-
188
-        if pid:
189
-            message = "pidfile %s already exist. Daemon already running?\n"
190
-            sys.stderr.write(message % self.pidfile)
191
-            sys.exit(1)
192
-
193
-        # Start the daemon
194
-        self.daemonize()
195
-        self.run()
196
-
197
-    def stop(self):
198
-        """
199
-        Stop the daemon
200
-        """
201
-        # Get the pid from the pidfile
202
-        try:
203
-            pf = file(self.pidfile,"r")
204
-            pid = int(pf.read().strip())
205
-            pf.close()
206
-        except IOError:
207
-            pid = None
208
-
209
-        if not pid:
210
-            message = "pidfile %s does not exist. Daemon not running?\n"
211
-            sys.stderr.write(message % self.pidfile)
212
-            return # not an error in a restart
213
-
214
-        # Try killing the daemon process	
215
-        try:
216
-            while 1:
217
-                os.kill(pid, SIGTERM)
218
-                time.sleep(0.1)
219
-        except OSError, err:
220
-            err = str(err)
221
-            if err.find("No such process") > 0:
222
-                if os.path.exists(self.pidfile):
223
-                    os.remove(self.pidfile)
224
-            else:
225
-                print str(err)
226
-                sys.exit(1)
227
-
228
-    def restart(self):
229
-        """
230
-        Restart the daemon
231
-        """
232
-        self.stop()
233
-        self.start()
234
-
235
-    def run(self):
236
-        """
237
-        You should override this method when you subclass Daemon. It will be called after the process has been
238
-        daemonized by start() or restart().
239
-        """
240
-
241
-
242
-class ProxyDaemon(Daemon):
243
-    def run(self):
244
-        start()
245
-
246
-if __name__ == "__main__":
247
-    daemon = ProxyDaemon("/var/run/streamproxy.pid")
248
-    if len(sys.argv) == 2:
249
-        if "start" == sys.argv[1]:
250
-            daemon.start()
251
-        elif "stop" == sys.argv[1]:
252
-            daemon.stop()
253
-        elif "restart" == sys.argv[1]:
254
-            daemon.restart()
255
-        elif "manualstart" == sys.argv[1]:
256
-            start()
257
-        else:
258
-            print "Unknown command"
259
-            sys.exit(2)
260
-        sys.exit(0)
261
-    else:
262
-        print "usage: %s start|stop|restart|manualstart" % sys.argv[0]
263
-        sys.exit(2)
264
-

+ 0
- 5
sniplets.py Datei anzeigen

@@ -1,5 +0,0 @@
1
-self.slideTimer = eTimer()
2
-self.slideTimer_conn = self.slideTimer.timeout.connect(self.slidePic)
3
-
4
-self.timer = eTimer()
5
-self.timer.callback.append(self.blink)

+ 0
- 5
streams.ini Datei anzeigen

@@ -1,5 +0,0 @@
1
-[home]
2
-LTV1=http://streamltv.cloudy.services/ltv/LTV02.smil/playlist.m3u8|picons/latvia1.png|Latvijas televīzijas 1.kanāls
3
-LTV2=http://streamltv.cloudy.services/ltv/LTV01.smil/playlist.m3u8|picons/latvia7.png|Latvijas televīzijas 2.kanāls
4
-LR1=http://muste.radio.org.lv/shoutcast/mp4:lr1a.stream/playlist.m3u8|picons/lr_1_lv.png|Latvijas radio 1.kanāls
5
-#http://muste.radio.org.lv/shoutcast/mp4:lr5a.stream/playlist.m3u8

+ 0
- 12
test.bat Datei anzeigen

@@ -1,12 +0,0 @@
1
-
2
-(
3
-echo Description: 
4
-echo Architecture: all
5
-echo Section: 
6
-echo Priority: optional
7
-echo Maintainer: ivars777@gmail.com
8
-echo Homepage:
9
-echo Depends: python-json
10
-echo Source:
11
-) >control
12
-cat control

BIN
test.mp4 Datei anzeigen


+ 0
- 76
test10.py Datei anzeigen

@@ -1,76 +0,0 @@
1
-import os, sys
2
-import Tkinter as tkinter
3
-
4
-import gi
5
-gi.require_version('Gst', '1.0')
6
-gi.require_version('GstVideo', '1.0')
7
-#gi.require_version('GdkX11', '3.0')
8
-from gi.repository import Gst, GObject, GstVideo
9
-
10
-
11
-def on_sync_message(bus, message, frame_id):
12
-    if not message.get_structure() is None:
13
-        print "sync: "+message.get_structure().get_name()
14
-        if message.get_structure().get_name() == 'prepare-window-handle':
15
-            display_frame = message.src
16
-            display_frame.set_property('force-aspect-ratio', True)
17
-            display_frame.set_window_handle(frame_id)
18
-            
19
-def on_message(bus,message):
20
-    t = message.type
21
-    print "message: "+str(message.type)
22
-    if t == Gst.MessageType.EOS:
23
-        self.player.set_state(Gst.State.NULL)
24
-    elif t == Gst.MessageType.ERROR:
25
-        err, debug = message.parse_error()
26
-        print "Error: %s" % err, debug
27
-        self.player.set_state(Gst.State.NULL)
28
-    
29
-
30
-window = tkinter.Tk()
31
-window.title('')
32
-window.geometry('500x400')
33
-
34
-GObject.threads_init()
35
-Gst.init(None)
36
-
37
-# can aslo use display_frame = tkinter.Frame(window)
38
-display_frame = tkinter.Canvas(window, bg='#030')
39
-display_frame.pack(side=tkinter.TOP,expand=tkinter.YES,fill=tkinter.BOTH)
40
-frame_id = display_frame.winfo_id()
41
-
42
-#player = Gst.ElementFactory.make('playbin', None)
43
-##filepath = os.path.realpath('test.mp4')
44
-#filepath2 = "file:///" + filepath.replace('\\', '/').replace(':', '|')
45
-#player.set_property('uri', filepath2)
46
-cmd = 'souphttpsrc ssl-strict=false location="http://walterebert.com/playground/video/hls/ts/480x270.m3u8" ! decodebin! autovideosink'
47
-player = Gst.parse_launch(cmd)
48
-source = player.get_child_by_name('souphttpsrc0')
49
-pass
50
-#player = Gst.Pipeline("player")
51
-#source = Gst.ElementFactory.make("souphttpsrc", "source")
52
-#source.set_property("location","http://walterebert.com/playground/video/hls/ts/480x270.m3u8")
53
-#decodebin = Gst.ElementFactory.make("decodebin", "decodebin")
54
-#output = Gst.ElementFactory.make("autovideosink", "output")
55
-#player.add(source)
56
-#player.add(decodebin)
57
-#player.add(output)
58
-#source.link(decodebin)
59
-#decodebin.link(output)
60
-
61
-VideoCrop = Gst.ElementFactory.make('videocrop', 'VideoCrop')
62
-VideoCrop.set_property('top', 100)
63
-VideoCrop.set_property('bottom', 100)
64
-VideoCrop.set_property('left', 50)
65
-VideoCrop.set_property('right', 150)
66
-#player.set_property('video-filter', VideoCrop)
67
-
68
-bus = player.get_bus()
69
-bus.add_signal_watch()
70
-bus.enable_sync_message_emission()
71
-bus.connect("message", on_message)
72
-bus.connect('sync-message::element', on_sync_message, frame_id)
73
-
74
-
75
-player.set_state(Gst.State.PLAYING)
76
-window.mainloop()

+ 0
- 61
test11.py Datei anzeigen

@@ -1,61 +0,0 @@
1
-import sys
2
-import os
3
-
4
-if sys.version_info[0] < 3:
5
-    import Tkinter as tkinter
6
-else:
7
-    import tkinter
8
-
9
-import gi
10
-gi.require_version('Gst', '1.0')
11
-from gi.repository import Gst, GObject
12
-
13
-# Needed for set_window_handle():
14
-gi.require_version('GstVideo', '1.0')
15
-from gi.repository import GstVideo
16
-
17
-def set_frame_handle(bus, message, frame_id):
18
-    if not message.get_structure() is None:
19
-        if message.get_structure().get_name() == 'prepare-window-handle':
20
-            display_frame = message.src
21
-            display_frame.set_property('force-aspect-ratio', True)
22
-            display_frame.set_window_handle(frame_id)
23
-
24
-NUMBER_OF_FRAMES = 8 # with more frames than arguments, videos are repeated
25
-relative_height = 1 / float(NUMBER_OF_FRAMES)
26
-
27
-# Only argument number checked, not validity.
28
-number_of_file_names_given = len(sys.argv) - 1
29
-if number_of_file_names_given < 1:
30
-    print('Give at least one video file name.')
31
-    sys.exit()
32
-if number_of_file_names_given < NUMBER_OF_FRAMES:
33
-    print('Up to', NUMBER_OF_FRAMES, 'video file names can be given.')
34
-file_names = list()
35
-for index in range(number_of_file_names_given):
36
-    file_names.append(sys.argv[index + 1])
37
-
38
-window = tkinter.Tk()
39
-window.title("Multiple videos in a column using Tk and GStreamer 1.0")
40
-window.geometry('480x960')
41
-
42
-Gst.init(None)
43
-GObject.threads_init()
44
-
45
-for number in range(NUMBER_OF_FRAMES):
46
-    display_frame = tkinter.Frame(window, bg='')
47
-    relative_y = number * relative_height
48
-    display_frame.place(relx = 0, rely = relative_y,
49
-            anchor = tkinter.NW, relwidth = 1, relheight = relative_height)
50
-    frame_id = display_frame.winfo_id()
51
-
52
-    player = Gst.ElementFactory.make('playbin', None)
53
-    fullname = os.path.abspath(file_names[number % len(file_names)])
54
-    player.set_property('uri', fullname)
55
-    player.set_state(Gst.State.PLAYING)
56
-
57
-    bus = player.get_bus()
58
-    bus.enable_sync_message_emission()
59
-    bus.connect('sync-message::element', set_frame_handle, frame_id)
60
-
61
-window.mainloop()

+ 0
- 200
test7.py
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 13
test8.py Datei anzeigen

@@ -1,13 +0,0 @@
1
-#import gi
2
-#import server.hqqresolver as resolver
3
-#import server.openload as resolver
4
-import resolver
5
-url = "http://hqq.tv/player/embed_player.php?vid=235238210241210222228241233208212245&autoplay=no"
6
-url = "http://hqq.tv/player/embed_player.php?vid=243221241234244238208213206212211231&autoplay=no"
7
-#url = "http://hqq.tv/player/embed_player.php?vid=208231211231207221227243206206221244&autoplay=no"
8
-#url = "https://openload.co/embed/TMthIdpy4PI/"
9
-url = "http://hqq.tv/player/embed_player.php?vid=S86NN57WO655&autoplay=no"
10
-url = "https://openload.co/embed/-TLf8Zqdwf8/"
11
-r= resolver.resolve(url)
12
-print r[0]["url"]
13
-pass

+ 0
- 72
test9.py Datei anzeigen

@@ -1,72 +0,0 @@
1
-import sys, os
2
-import gi
3
-gi.require_version('Gst', '1.0')
4
-gi.require_version('Gtk', '3.0')
5
-gi.require_version('GdkX11', '3.0')
6
-gi.require_version('GstVideo', '1.0')
7
-from gi.repository import Gst, GObject, Gtk
8
-
9
-# Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
10
-from gi.repository import GdkX11, GstVideo
11
-
12
-class GTK_Main(object):
13
-
14
-    def __init__(self):
15
-        window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
16
-        window.set_title("Video-Player")
17
-        window.set_default_size(500, 400)
18
-        window.connect("destroy", Gtk.main_quit, "WM destroy")
19
-        vbox = Gtk.VBox()
20
-        window.add(vbox)
21
-        hbox = Gtk.HBox()
22
-        vbox.pack_start(hbox, False, False, 0)
23
-        self.entry = Gtk.Entry()
24
-        hbox.add(self.entry)
25
-        self.button = Gtk.Button("Start")
26
-        hbox.pack_start(self.button, False, False, 0)
27
-        self.button.connect("clicked", self.start_stop)
28
-        self.movie_window = Gtk.DrawingArea()
29
-        vbox.add(self.movie_window)
30
-        window.show_all()
31
-
32
-        self.player = Gst.ElementFactory.make("playbin", "player")
33
-        bus = self.player.get_bus()
34
-        bus.add_signal_watch()
35
-        bus.enable_sync_message_emission()
36
-        bus.connect("message", self.on_message)
37
-        bus.connect("sync-message::element", self.on_sync_message)
38
-
39
-    def start_stop(self, w):
40
-        if self.button.get_label() == "Start":
41
-            filepath = self.entry.get_text().strip()
42
-            if os.path.isfile(filepath):
43
-                filepath = os.path.realpath(filepath)
44
-                self.button.set_label("Stop")
45
-                self.player.set_property("uri", filepath)
46
-                self.player.set_state(Gst.State.PLAYING)
47
-            else:
48
-                self.player.set_state(Gst.State.NULL)
49
-                self.button.set_label("Start")
50
-
51
-    def on_message(self, bus, message):
52
-        t = message.type
53
-        if t == Gst.MessageType.EOS:
54
-            self.player.set_state(Gst.State.NULL)
55
-            self.button.set_label("Start")
56
-        elif t == Gst.MessageType.ERROR:
57
-            self.player.set_state(Gst.State.NULL)
58
-            err, debug = message.parse_error()
59
-            print "Error: %s" % err, debug
60
-            self.button.set_label("Start")
61
-
62
-    def on_sync_message(self, bus, message):
63
-        if message.get_structure().get_name() == 'prepare-window-handle':
64
-            imagesink = message.src
65
-            imagesink.set_property("force-aspect-ratio", True)
66
-            imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
67
-
68
-
69
-GObject.threads_init()
70
-Gst.init(None)        
71
-GTK_Main()
72
-Gtk.main()

+ 0
- 6
test_m3u8.py Datei anzeigen

@@ -1,6 +0,0 @@
1
-import m3u8
2
-url = "http://s.ltv.lv:1935/vod/mp4:_definst_/d/f/8aaa2675.mp4/playlist.m3u8?safwerwfasendtime=1465773436&safwerwfasstarttime=1465764577&safwerwfashash=LjQlOFFfDOHdXXMncuzhi_XfDLNOJ764NSLM_vS9Xqw="
3
-url = "http://player.tvnet.lv/stream/amlst:60441/playlist.m3u8"
4
-m3u8_obj = m3u8.load(url)
5
-print m3u8_obj.segments
6
-print m3u8_obj.target_duration

+ 0
- 24
test_sources.py Datei anzeigen

@@ -1,24 +0,0 @@
1
-from Tkinter import *
2
-
3
-class App:
4
-
5
-    def __init__(self, master):
6
-
7
-        self.frame = Frame(master,width=1015,height=550)
8
-        self.frame.pack()
9
-
10
-        self.b_red = Button(self.frame, text="Back", fg="red", command=self.frame.quit, height = 30, width = 148)
11
-        self.b_red.place(x=110,y=500)
12
-
13
-        self.b_green = Button(self.frame, text="Select", fg="green",command=self.say_hi,height = 30, width = 148)
14
-        self.b_green.place(x=370,y=500)
15
-
16
-    def say_hi(self):
17
-        print "hi there, everyone!"
18
-
19
-root = Tk()
20
-root.geometry("1015x550")
21
-
22
-app = App(root)
23
-
24
-root.mainloop()

+ 0
- 79
ttaf.py Datei anzeigen

@@ -1,79 +0,0 @@
1
-#!/usr/bin/env python3
2
-
3
-"""
4
-Usage:
5
-ttaf2srt subtitlefilettafinput.xml > output.srt
6
-
7
-From https://github.com/haraldF/ttaf2srt
8
-edited for 'SWR - Pälzisch im Abgang' subtitles
9
-www.swr.de/paelzisch-im-abgang/
10
-and 'Tatort' subtitles.
11
-"""
12
-"""
13
-From https://github.com/haraldF/ttaf2srt
14
-
15
-ttaf2srt
16
-
17
-Simple python script to convert ttaf subtitles to srt subtitles.
18
-Note - only tested on German 'Tatort' subtitles.
19
-Note2 - if using vlc or mplayer, make sure to specify 'utf8' as encoding, otherwise, special characters will not render correctly.
20
-"""
21
-import sys
22
-from xml.dom import minidom
23
-
24
-def dumpText(item):
25
-    for child in item.childNodes:
26
-        if child.nodeType == child.TEXT_NODE:
27
-            print(child.nodeValue, end="")
28
-        elif child.nodeType == child.ELEMENT_NODE:
29
-            if child.nodeName == "tt:br":
30
-                print()
31
-            elif child.nodeName == "tt:span":
32
-                print("<font color=\"" + styles[child.getAttribute("style")] + "\">", end="")
33
-                dumpText(child)
34
-                print("</font>", end="")
35
-            else:
36
-                print("Unknown Node: " + child.nodeName, file=sys.stderr)
37
-
38
-def dumpHeader(item, subCount):
39
-    print(subCount)
40
-    begin = item.getAttribute("begin")
41
-    end = item.getAttribute("end")
42
-    # ### this is a silly hack - for some reason, my ttaf files all start at hour 10? Resetting
43
-    # the hour makes it work again
44
-    begin = '0' + begin[1:]
45
-    end = '0' + end[1:]
46
-    print(begin + " --> " + end)
47
-
48
-def parseStyles(styles):
49
-    result = {}
50
-    for style in styles:
51
-        result[style.getAttribute('xml:id')] = style.getAttribute('tts:color')
52
-    return result
53
-
54
-def ttaf2srt(fname):
55
-	with open(fname) as f:
56
-		xmldoc = f.read().replace('\n', ' ').replace('\r', '')
57
-	xmldoc = minidom.parseString(xmldoc)
58
-
59
-	header = xmldoc.getElementsByTagName('tt:head')
60
-	if len(header):
61
-		styling = header[0].getElementsByTagName('tt:styling')
62
-		if len(styling):
63
-			styles = parseStyles(styling[0].getElementsByTagName('tt:style'))
64
-
65
-	body = xmldoc.getElementsByTagName('tt:body')
66
-	itemlist = body[0].getElementsByTagName('tt:p') 
67
-	subCount = 0
68
-
69
-	for item in itemlist:
70
-		if item.hasAttribute('xml:id'):
71
-			dumpHeader(item, subCount)
72
-			subCount += 1
73
-			color = styles[item.getAttribute("style")]
74
-			if color:
75
-				print("<font color=\"" + color + "\">", end="")
76
-			dumpText(item)
77
-			if color:
78
-				print("</font>", end="")
79
-			print("\n")

+ 0
- 80
ttaf2srt.py Datei anzeigen

@@ -1,80 +0,0 @@
1
-#!/usr/bin/env python3
2
-
3
-"""
4
-Usage:
5
-ttaf2srt subtitlefilettafinput.xml > output.srt
6
-
7
-From https://github.com/haraldF/ttaf2srt
8
-edited for 'SWR - Palzisch im Abgang' subtitles
9
-www.swr.de/paelzisch-im-abgang/
10
-and 'Tatort' subtitles.
11
-"""
12
-"""
13
-From https://github.com/haraldF/ttaf2srt
14
-
15
-ttaf2srt
16
-
17
-Simple python script to convert ttaf subtitles to srt subtitles.
18
-Note - only tested on German 'Tatort' subtitles.
19
-Note2 - if using vlc or mplayer, make sure to specify 'utf8' as encoding, otherwise, special characters will not render correctly.
20
-"""
21
-import sys
22
-from xml.dom import minidom
23
-
24
-def dumpText(item):
25
-    for child in item.childNodes:
26
-        if child.nodeType == child.TEXT_NODE:
27
-            print(child.nodeValue, end="")
28
-        elif child.nodeType == child.ELEMENT_NODE:
29
-            if child.nodeName == "tt:br":
30
-                print()
31
-            elif child.nodeName == "tt:span":
32
-                print("<font color=\"" + styles[child.getAttribute("style")] + "\">", end="")
33
-                dumpText(child)
34
-                print("</font>", end="")
35
-            else:
36
-                print("Unknown Node: " + child.nodeName, file=sys.stderr)
37
-
38
-def dumpHeader(item, subCount):
39
-    print(subCount)
40
-    begin = item.getAttribute("begin")
41
-    end = item.getAttribute("end")
42
-    # ### this is a silly hack - for some reason, my ttaf files all start at hour 10? Resetting
43
-    # the hour makes it work again
44
-    begin = '0' + begin[1:]
45
-    end = '0' + end[1:]
46
-    print(begin + " --> " + end)
47
-
48
-def parseStyles(styles):
49
-    result = {}
50
-    for style in styles:
51
-        result[style.getAttribute('xml:id')] = style.getAttribute('tts:color')
52
-    return result
53
-
54
-with open(sys.argv[1]) as f:
55
-    xmldoc = f.read().replace('\n', ' ').replace('\r', '')
56
-xmldoc = minidom.parseString(xmldoc)
57
-
58
-header = xmldoc.getElementsByTagName('tt:head')
59
-if len(header):
60
-    styling = header[0].getElementsByTagName('tt:styling')
61
-    if len(styling):
62
-        styles = parseStyles(styling[0].getElementsByTagName('tt:style'))
63
-
64
-body = xmldoc.getElementsByTagName('tt:body')
65
-
66
-itemlist = body[0].getElementsByTagName('tt:p') 
67
-
68
-subCount = 0
69
-
70
-for item in itemlist:
71
-    if item.hasAttribute('xml:id'):
72
-        dumpHeader(item, subCount)
73
-        subCount += 1
74
-        color = styles[item.getAttribute("style")]
75
-        if color:
76
-            print("<font color=\"" + color + "\">", end="")
77
-        dumpText(item)
78
-        if color:
79
-            print("</font>", end="")
80
-        print("\n")

+ 0
- 6197
urlparser.py
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 546
urlparserhelper.py Datei anzeigen

@@ -1,546 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-
3
-###################################################
4
-# LOCAL import
5
-###################################################
6
-from Plugins.Extensions.IPTVPlayer.tools.iptvtools import printDBG, printExc
7
-from Plugins.Extensions.IPTVPlayer.tools.iptvtypes import strwithmeta
8
-from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper, common
9
-from Plugins.Extensions.IPTVPlayer.libs import m3u8
10
-###################################################
11
-# FOREIGN import
12
-###################################################
13
-from binascii import hexlify
14
-import re
15
-import time
16
-import string
17
-import codecs
18
-import urllib
19
-###################################################
20
-try:
21
-    from hashlib import md5
22
-    def hex_md5(e):
23
-        return md5(e).hexdigest()
24
-except:
25
-    from Plugins.Extensions.IPTVPlayer.libs.crypto.hash.md5Hash import MD5 as md5
26
-    def hex_md5(e):
27
-        hashAlg = MD5()
28
-        return hexlify(hashAlg(e))
29
-
30
-def int2base(x, base):
31
-    digs = string.digits + string.lowercase
32
-    if x < 0: sign = -1
33
-    elif x==0: return '0'
34
-    else: sign = 1
35
-    x *= sign
36
-    digits = []
37
-    while x:
38
-        digits.append(digs[x % base])
39
-        x /= base
40
-    if sign < 0:
41
-        digits.append('-')
42
-    digits.reverse()
43
-    return ''.join(digits)
44
-    
45
-def JS_toString(x, base):
46
-    return int2base(x, base)
47
-
48
-# returns timestamp in milliseconds
49
-def JS_DateValueOf():
50
-    return time.time()*1000
51
-    
52
-def JS_FromCharCode(*args): 
53
-    return ''.join(map(unichr, args))
54
-    
55
-def unicode_escape(s):
56
-    decoder = codecs.getdecoder('unicode_escape')
57
-    return re.sub(r'\\u[0-9a-fA-F]{4,}', lambda m: decoder(m.group(0))[0], s).encode('utf-8')
58
-
59
-def drdX_fx(e):
60
-    t = {}
61
-    n = 0
62
-    r = 0
63
-    i = []
64
-    s = ""
65
-    o = JS_FromCharCode
66
-    u = [[65, 91], [97, 123], [48, 58], [43, 44], [47, 48]]
67
-    
68
-    for z in range(len(u)):
69
-        n = u[z][0]
70
-        while n < u[z][1]:
71
-            i.append(o(n))
72
-            n += 1
73
-    n = 0
74
-    while n < 64:
75
-        t[i[n]] = n
76
-        n += 1
77
-        
78
-    n = 0
79
-    while n < len(e):
80
-        a = 0
81
-        f = 0
82
-        l = 0
83
-        c = 0
84
-        h = e[n:n+72]
85
-        while l < len(h):
86
-            f = t[h[l]]
87
-            a = (a << 6) + f
88
-            c += 6
89
-            while c >= 8:
90
-                c -= 8
91
-                s += o((a >> c) % 256)
92
-            l += 1
93
-        
94
-        n += 72
95
-    return s
96
-
97
-
98
-    
99
-####################################################
100
-# myobfuscate.com 
101
-####################################################
102
-def MYOBFUSCATECOM_OIO(data, _0lllOI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", enc=''):
103
-    i = 0;
104
-    while i < len(data):
105
-        h1 = _0lllOI.find(data[i]);
106
-        h2 = _0lllOI.find(data[i+1]);
107
-        h3 = _0lllOI.find(data[i+2]);
108
-        h4 = _0lllOI.find(data[i+3]);
109
-        i += 4;
110
-        bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
111
-        o1 = bits >> 16 & 0xff;
112
-        o2 = bits >> 8 & 0xff;
113
-        o3 = bits & 0xff;
114
-        if h3 == 64:
115
-            enc += chr(o1);
116
-        else:
117
-            if h4 == 64:
118
-                enc += chr(o1) + chr(o2);
119
-            else:
120
-                enc += chr(o1) + chr(o2) + chr(o3);
121
-    return enc
122
-
123
-def MYOBFUSCATECOM_0ll(string, baseRet=''):
124
-    ret = baseRet
125
-    i = len(string) - 1
126
-    while i >= 0:
127
-        ret += string[i]
128
-        i -= 1
129
-    return ret
130
-    
131
-def VIDEOMEGA_decryptPlayerParams(p, a, c, k, e, d):
132
-    def e1(c):
133
-        return JS_toString(c, 36)
134
-        return ret
135
-    def k1(matchobj):
136
-        return d[matchobj.group(0)]
137
-    def e2(t=None):
138
-        return '\\w+'
139
-    e = e1
140
-    if True:
141
-        while c != 0:
142
-            c -= 1
143
-            tmp1 = e(c)
144
-            d[tmp1] = k[c]
145
-            if '' == d[tmp1]: 
146
-                d[tmp1] = e(c)
147
-        c = 1
148
-        k = [k1]
149
-        e = e2
150
-    while c != 0:
151
-        c -= 1
152
-        if k[c]:
153
-            reg = '\\b' + e(c) + '\\b'
154
-            p = re.sub(reg, k[c], p)
155
-    return p
156
-            
157
-def SAWLIVETV_decryptPlayerParams(p, a, c, k, e, d):
158
-    def e1(c):
159
-        if c < a:
160
-            ret = ''
161
-        else:
162
-            ret = e(c / a)
163
-        c = c % a
164
-        if c > 35:
165
-            ret += chr(c+29)
166
-        else:
167
-            ret += JS_toString(c, 36)
168
-        return ret
169
-    def k1(matchobj):
170
-        return d[matchobj.group(0)]
171
-    def e2(t=None):
172
-        return '\\w+'
173
-    e = e1
174
-    if True:
175
-        while c != 0:
176
-            c -= 1
177
-            tmp1 = e(c)
178
-            d[tmp1] = k[c]
179
-            if '' == d[tmp1]: 
180
-                d[tmp1] = e(c)
181
-        c = 1
182
-        k = [k1]
183
-        e = e2
184
-    while c != 0:
185
-        c -= 1
186
-        if k[c]:
187
-            reg = '\\b' + e(c) + '\\b'
188
-            p = re.sub(reg, k[c], p)
189
-    return p
190
-
191
-def OPENLOADIO_decryptPlayerParams(p, a, c, k, e, d):
192
-    def e1(c):
193
-        return c
194
-    def e2(t=None):
195
-        return '\\w+'
196
-    def k1(matchobj):
197
-        return d[int(matchobj.group(0))]
198
-    e = e1
199
-    if True:
200
-        while c != 0:
201
-            c -= 1
202
-            d[c] = k[c]
203
-            if c < len(k):
204
-                d[c] = k[c]
205
-            else:
206
-                d[c] = c
207
-        c = 1
208
-        k = [k1]
209
-        e = e2
210
-    while c != 0:
211
-        c -= 1
212
-        if k[c]:
213
-            reg = '\\b' + e(c) + '\\b'
214
-            p = re.sub(reg, k[c], p)
215
-    return p
216
-
217
-def TEAMCASTPL_decryptPlayerParams(p, a, c, k, e=None, d=None):
218
-    def e1(c):
219
-        if c < a:
220
-            ret = ''
221
-        else:
222
-            ret = e(c / a)
223
-        c = c % a
224
-        if c > 35:
225
-            ret += chr(c+29)
226
-        else:
227
-            ret += JS_toString(c, 36)
228
-        return ret
229
-    e = e1
230
-    while c != 0:
231
-        c -= 1
232
-        if k[c]:
233
-            reg = '\\b' + e(c) + '\\b'
234
-            p = re.sub(reg, k[c], p)
235
-    return p
236
-
237
-###############################################################################
238
-# VIDUP.ME HELPER FUNCTIONS
239
-###############################################################################
240
-# there is problem in exec when this functions are class methods
241
-# sub (even static) or functions
242
-# Code example:
243
-#<div id="player_code" style="height:100% ; width:100%; visibility:none;"><span id='flvplayer'></span>
244
-#<script type='text/javascript' src='http://vidup.me/player/jwplayer.js'></script>
245
-#<script type='text/javascript'>eval(function(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c]);return p}('1l(\'1k\').1j({\'1i\':\'/7/7.1h\',a:"0://g.f.e.c:1g/d/1f/1e.1d",1c:"0",\'1b\':\'9\',\'1a\':\'19\',\'18\':\'h%\',\'17\':\'h%\',\'16\':\'15\',\'14\':\'13\',\'12\':\'11\',\'10\':\'0://g.f.e.c/i/z/6.y\',\'b\':\'0://5.4/7/b.x\',\'w\':\'v\',\'2.a\':\'0://5.4/u/t.s\',\'2.8\':\'0://5.4/6\',\'2.r\':\'q\',\'2.p\':\'o\',\'2.n\':\'9-m\',\'l\':{\'k-1\':{\'8\':\'0://5.4/6\'},\'j-3\':{}}});',36,58,'http||logo||me|vidup|yx616ubt7l82|player|link|bottom|file|skin|187||116|39|84|100||timeslidertooltipplugin|fbit|plugins|right|position|false|hide|_blank|linktarget|png|logoheader|images|000000|screencolor|zip|jpg|00049|image|always|allowscriptaccess|true|allowfullscreen|7022|duration|height|width|transparent|wmode|controlbar|provider|flv|video|zesaswuvnsv27kymojykzci5bbll4pqkmqipzoez4eakqgfaacm7fbqf|182|swf|flashplayer|setup|flvplayer|jwplayer'.split('|')))
246
-#</script>
247
-#<br></div>
248
-#
249
-#       
250
-def getParamsTouple(code, type=1, r1=False, r2=False ):
251
-    mark1Tab = ["}(", "}\r\n(", "}\n(", "}\r("]
252
-    mark2 = "))"
253
-    
254
-    for mark1 in mark1Tab:
255
-        if r1:
256
-            idx1 = code.rfind(mark1)
257
-        else:
258
-            idx1 = code.find(mark1)
259
-        if idx1 > -1: break
260
-    
261
-    if -1 == idx1: return ''
262
-    idx1 += len(mark1)
263
-    if r2:
264
-        idx2 = code.rfind(mark2, idx1)
265
-    else:
266
-        idx2 = code.find(mark2, idx1)
267
-    if -1 == idx2: return ''
268
-    idx2 += type
269
-    return code[idx1:idx2]
270
- 
271
-def unpackJSPlayerParams(code, decryptionFun, type=1, r1=False, r2=False):
272
-    printDBG('unpackJSPlayerParams')
273
-    code = getParamsTouple(code, type, r1, r2)
274
-    return unpackJS(code, decryptionFun)
275
-    
276
-def unpackJS(data, decryptionFun, addCode=''):
277
-    paramsCode = addCode
278
-    paramsCode += 'paramsTouple = (' + data + ')'
279
-    try:
280
-        paramsAlgoObj = compile(paramsCode, '', 'exec')
281
-    except:
282
-        printExc('unpackJS compile algo code EXCEPTION')
283
-        return ''
284
-    vGlobals = {"__builtins__": None, 'string': string, 'decodeURIComponent':urllib.unquote, 'unescape':urllib.unquote}
285
-    vLocals = { 'paramsTouple': None }
286
-
287
-    try:
288
-        exec( paramsAlgoObj, vGlobals, vLocals )
289
-    except:
290
-        printExc('unpackJS exec code EXCEPTION')
291
-        return ''
292
-    # decrypt JS Player params
293
-    try:
294
-        return decryptionFun(*vLocals['paramsTouple'])
295
-    except:
296
-        printExc('decryptPlayerParams EXCEPTION')
297
-    return ''
298
-    
299
-def VIDUPME_decryptPlayerParams(p=None, a=None, c=None, k=None, e=None, d=None):
300
-    while c > 0:
301
-        c -= 1
302
-        if k[c]:
303
-            p = re.sub('\\b'+ int2base(c, a) +'\\b', k[c], p)
304
-    return p
305
-    
306
-###############################################################################
307
-
308
-
309
-###############################################################################
310
-# VIDEOWEED HELPER FUNCTIONS
311
-###############################################################################
312
-def VIDEOWEED_decryptPlayerParams(w, i, s, e):
313
-    lIll = 0
314
-    ll1I = 0
315
-    Il1l = 0
316
-    ll1l = []
317
-    l1lI = []
318
-    while True:
319
-        if lIll < 5: l1lI.append(w[lIll])
320
-        elif lIll < len(w): ll1l.append(w[lIll])
321
-        lIll += 1
322
-        if ll1I < 5: l1lI.append(i[ll1I])
323
-        elif ll1I < len(i): ll1l.append(i[ll1I])
324
-        ll1I += 1
325
-        if Il1l < 5: l1lI.append(s[Il1l])
326
-        elif Il1l < len(s): ll1l.append(s[Il1l])
327
-        Il1l += 1
328
-        if len(w) + len(i) + len(s) + len(e) == len(ll1l) + len(l1lI) + len(e): break
329
-
330
-    lI1l = ''.join(ll1l)
331
-    I1lI = ''.join(l1lI)
332
-    ll1I = 0
333
-    l1ll = []
334
-
335
-    lIll = 0
336
-    while lIll < len(ll1l):
337
-        ll11 = -1;
338
-        if ord(I1lI[ll1I]) % 2: ll11 = 1
339
-        l1ll.append( JS_FromCharCode( int( lI1l[lIll:lIll+2], 36 ) - ll11 ) )
340
-        ll1I += 1;
341
-        if ll1I >= len(l1lI): ll1I = 0
342
-
343
-        lIll += 2
344
-    return ''.join(l1ll)
345
-
346
-def VIDEOWEED_decryptPlayerParams2(w, i, s=None, e=None):
347
-    s = 0
348
-    while s < len(w):
349
-        i += JS_FromCharCode(int(w[s:s+2], 36))
350
-        s += 2
351
-    return i
352
-
353
-def VIDEOWEED_unpackJSPlayerParams(code):
354
-    sts, code = CParsingHelper.rgetDataBeetwenMarkers(code, 'eval(function', '</script>')
355
-    if not sts: return ''
356
-    while True:
357
-        mark1 = "}("
358
-        mark2 = "));"
359
-        idx1 = code.rfind(mark1)
360
-        if -1 == idx1: return ''
361
-        idx1 += len(mark1)
362
-        idx2 = code.rfind(mark2, idx1)
363
-        if -1 == idx2: return ''
364
-        #idx2 += 1
365
-        
366
-        paramsCode = 'paramsTouple = (' + code[idx1:idx2] + ')'
367
-        paramsAlgoObj = compile(paramsCode, '', 'exec')
368
-        try:
369
-            paramsAlgoObj = compile(paramsCode, '', 'exec')
370
-        except:
371
-            printDBG('unpackJSPlayerParams compile algo code EXCEPTION')
372
-            return ''
373
-        vGlobals = {"__builtins__": None, 'string': string}
374
-        vLocals = { 'paramsTouple': None }
375
-        try:
376
-            exec( paramsAlgoObj, vGlobals, vLocals )
377
-        except:
378
-            printDBG('unpackJSPlayerParams exec code EXCEPTION')
379
-            return ''
380
-        # decrypt JS Player params
381
-        code = VIDEOWEED_decryptPlayerParams(*vLocals['paramsTouple'])
382
-        try:
383
-            code = VIDEOWEED_decryptPlayerParams(*vLocals['paramsTouple'])
384
-            if -1 == code.find('eval'):
385
-                return code
386
-        except:
387
-            printDBG('decryptPlayerParams EXCEPTION')
388
-            return ''
389
-    return ''
390
-    
391
-    
392
-def pythonUnescape(data):
393
-    sourceCode = "retData = '''%s'''" % data
394
-    try:
395
-        code = compile(sourceCode, '', 'exec')
396
-    except:
397
-        printExc('pythonUnescape compile algo code EXCEPTION')
398
-        return ''
399
-    vGlobals = {"__builtins__": None, 'string': string}
400
-    vLocals = { 'paramsTouple': None }
401
-    try:
402
-        exec( code, vGlobals, vLocals )
403
-    except:
404
-        printExc('pythonUnescape exec code EXCEPTION')
405
-        return ''
406
-    return vLocals['retData']
407
-    
408
-###############################################################################
409
-
410
-class captchaParser:
411
-    def __init__(self):
412
-        pass
413
-
414
-    def textCaptcha(self, data):
415
-        strTab = []
416
-        valTab = []
417
-        match = re.compile("padding-(.+?):(.+?)px;padding-top:.+?px;'>(.+?)<").findall(data)
418
-        if len(match) > 0:
419
-            for i in range(len(match)):
420
-                value = match[i]
421
-                strTab.append(value[2])
422
-                strTab.append(int(value[1]))
423
-                valTab.append(strTab)
424
-                strTab = []
425
-                if match[i][0] == 'left':
426
-                    valTab.sort(key=lambda x: x[1], reverse=False)
427
-                else:
428
-                    valTab.sort(key=lambda x: x[1], reverse=True)
429
-        return valTab
430
-
431
-    def reCaptcha(self, data):
432
-        pass
433
-    
434
-################################################################################
435
-
436
-def decorateUrl(url, metaParams={}):
437
-    retUrl = strwithmeta( url )
438
-    retUrl.meta.update(metaParams)
439
-    urlLower = url.lower()
440
-    if 'iptv_proto' not in retUrl.meta:
441
-        if urlLower.startswith('merge://'):
442
-            retUrl.meta['iptv_proto'] = 'merge'
443
-        elif urlLower.split('?')[0].endswith('.m3u8'):
444
-            retUrl.meta['iptv_proto'] = 'm3u8'
445
-        elif urlLower.split('?')[0].endswith('.f4m'):
446
-            retUrl.meta['iptv_proto'] = 'f4m'
447
-        elif urlLower.startswith('rtmp'):
448
-            retUrl.meta['iptv_proto'] = 'rtmp'
449
-        elif urlLower.startswith('https'):
450
-            retUrl.meta['iptv_proto'] = 'https'
451
-        elif urlLower.startswith('http'):
452
-            retUrl.meta['iptv_proto'] = 'http'
453
-        elif urlLower.startswith('file'):
454
-            retUrl.meta['iptv_proto'] = 'file'
455
-        elif urlLower.startswith('rtsp'):
456
-            retUrl.meta['iptv_proto'] = 'rtsp'
457
-        elif urlLower.startswith('mms'):
458
-            retUrl.meta['iptv_proto'] = 'mms'
459
-        elif urlLower.startswith('mmsh'):
460
-            retUrl.meta['iptv_proto'] = 'mmsh'
461
-        elif 'protocol=hls' in url.lower():
462
-            retUrl.meta['iptv_proto'] = 'm3u8'
463
-    return retUrl
464
-
465
-def getDirectM3U8Playlist(M3U8Url, checkExt=True, variantCheck=True, cookieParams={}):
466
-    if checkExt and not M3U8Url.split('?')[0].endswith('.m3u8'):
467
-        return []
468
-        
469
-    cm = common()
470
-    meta = strwithmeta(M3U8Url).meta
471
-    params, postData = cm.getParamsFromUrlWithMeta(M3U8Url)
472
-    params.update(cookieParams)
473
-    
474
-    retPlaylists = []
475
-    try:
476
-        finallM3U8Url = meta.get('iptv_m3u8_custom_base_link', '') 
477
-        if '' == finallM3U8Url:
478
-            params['return_data'] = False
479
-            sts, response = cm.getPage(M3U8Url, params, postData)
480
-            finallM3U8Url = response.geturl()
481
-            data = response.read().strip()
482
-            response.close()
483
-        else:
484
-            sts, data = cm.getPage(M3U8Url, params, postData)
485
-            data = data.strip()
486
-            
487
-        m3u8Obj = m3u8.inits(data, finallM3U8Url)
488
-        if m3u8Obj.is_variant:
489
-            for playlist in m3u8Obj.playlists:
490
-                item = {}
491
-                if not variantCheck or playlist.absolute_uri.split('?')[-1].endswith('.m3u8'):
492
-                    meta.update({'iptv_proto':'m3u8', 'iptv_bitrate':playlist.stream_info.bandwidth})
493
-                    item['url'] = strwithmeta(playlist.absolute_uri, meta)
494
-                else:
495
-                    meta.pop('iptv_proto', None)
496
-                    item['url'] = decorateUrl(playlist.absolute_uri, meta)
497
-                
498
-                item['bitrate'] = playlist.stream_info.bandwidth
499
-                if None != playlist.stream_info.resolution:
500
-                    item['with'] = playlist.stream_info.resolution[0]
501
-                    item['heigth'] = playlist.stream_info.resolution[1]
502
-                else:
503
-                    item['with'] = 0
504
-                    item['heigth'] = 0
505
-                item['codec'] = playlist.stream_info.codecs
506
-                item['name']  = "bitrate: %s res: %dx%d kodek: %s" % ( item['bitrate'], \
507
-                                                                        item['with'],    \
508
-                                                                        item['heigth'],  \
509
-                                                                        item['codec'] )
510
-                retPlaylists.append(item)
511
-        else:
512
-            item = {'name':'m3u8', 'url':M3U8Url, 'codec':'unknown', 'with':0, 'heigth':0, 'bitrate':'unknown'}
513
-            retPlaylists.append(item)
514
-    except:
515
-        printExc()
516
-    return retPlaylists
517
-    
518
-def getF4MLinksWithMeta(manifestUrl, checkExt=True):
519
-    if checkExt and not manifestUrl.split('?')[0].endswith('.f4m'):
520
-        return []
521
-        
522
-    cm = common()
523
-    headerParams, postData = cm.getParamsFromUrlWithMeta(manifestUrl)
524
-    
525
-    retPlaylists = []
526
-    sts, data = cm.getPage(manifestUrl, headerParams, postData)
527
-    if sts:
528
-        liveStreamDetected = False
529
-        if 'live' == CParsingHelper.getDataBeetwenMarkers('<streamType>', '</streamType>', False):
530
-            liveStreamDetected = True
531
-        bitrates = re.compile('bitrate="([0-9]+?)"').findall(data)
532
-        for item in bitrates:
533
-            link = strwithmeta(manifestUrl, {'iptv_proto':'f4m', 'iptv_bitrate':item})
534
-            if liveStreamDetected:
535
-                link.meta['iptv_livestream'] = True
536
-            retPlaylists.append({'name':'[f4m/hds] bitrate[%s]' % item, 'url':link})
537
-        
538
-        if 0 == len(retPlaylists):
539
-            link = strwithmeta(manifestUrl, {'iptv_proto':'f4m'})
540
-            if liveStreamDetected:
541
-                link.meta['iptv_livestream'] = True
542
-            retPlaylists.append({'name':'[f4m/hds]', 'url':link})
543
-    return retPlaylists
544
-    
545
-    
546
-

+ 0
- 30
walterebert.com.crt Datei anzeigen

@@ -1,30 +0,0 @@
1
------BEGIN CERTIFICATE-----
2
-MIIFFzCCA/+gAwIBAgISAwZctZXXoekeHeevKOm4kRjaMA0GCSqGSIb3DQEBCwUA
3
-MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
4
-ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xNjEwMjkxMTIzMDBaFw0x
5
-NzAxMjcxMTIzMDBaMBoxGDAWBgNVBAMTD3dhbHRlcmViZXJ0LmNvbTCCASIwDQYJ
6
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBALPgl5ptMDbg7fHCmdeGnybf2MashwPJ
7
-EIWbxHo2XYMjRItwY0DMz7t0qfO1GWB4zRxU18u3I/2jE4Ef+frhEmTQqLciFlvM
8
-xl5eouiGKpPFdgb79AP1XslhBYB6h/trhjluavvEo8uRbNTxddg3JBUUyKVt2p/v
9
-nHR2fyE4Z96kRlZoa6s7beEREJMByiQiE8qioC/OO7+pvQXUngMYvdjqXNd9MVuZ
10
-XhiTzzf9iKq6yM04l28AU/S1tEvEPrp+POtzRTwOQWqKHP0+gnugkuz0NdlDHj8g
11
-BnLt3KpHmPS10HDZC1N2mI5gnJ96jyTXUfiK4WqGKYmZ/lmWYfxle08CAwEAAaOC
12
-AiUwggIhMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB
13
-BQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUns1mR+Y1t5rFRuzRE1hG6n4E
14
-KI0wHwYDVR0jBBgwFoAUqEpqYwR93brm0Tm3pkVl7/Oo7KEwcAYIKwYBBQUHAQEE
15
-ZDBiMC8GCCsGAQUFBzABhiNodHRwOi8vb2NzcC5pbnQteDMubGV0c2VuY3J5cHQu
16
-b3JnLzAvBggrBgEFBQcwAoYjaHR0cDovL2NlcnQuaW50LXgzLmxldHNlbmNyeXB0
17
-Lm9yZy8wLwYDVR0RBCgwJoIPd2FsdGVyZWJlcnQuY29tghN3d3cud2FsdGVyZWJl
18
-cnQuY29tMIH+BgNVHSAEgfYwgfMwCAYGZ4EMAQIBMIHmBgsrBgEEAYLfEwEBATCB
19
-1jAmBggrBgEFBQcCARYaaHR0cDovL2Nwcy5sZXRzZW5jcnlwdC5vcmcwgasGCCsG
20
-AQUFBwICMIGeDIGbVGhpcyBDZXJ0aWZpY2F0ZSBtYXkgb25seSBiZSByZWxpZWQg
21
-dXBvbiBieSBSZWx5aW5nIFBhcnRpZXMgYW5kIG9ubHkgaW4gYWNjb3JkYW5jZSB3
22
-aXRoIHRoZSBDZXJ0aWZpY2F0ZSBQb2xpY3kgZm91bmQgYXQgaHR0cHM6Ly9sZXRz
23
-ZW5jcnlwdC5vcmcvcmVwb3NpdG9yeS8wDQYJKoZIhvcNAQELBQADggEBAHXnXs1f
24
-msSVpQesaKSRyvHqDY/NHcZFAQ61fG+EoIo+pxP5Ol+aV8qVNxzd1N+WmmvKqT9U
25
-xBTzvhGJnjYVP5NC2xMnltPyWOu8fhZqW73F9J+EB5TuLKtREMcCxTTocja4NgHI
26
-cz40hp4q1AZi8nCJEjq6kkETFRRFqoQpZxayuMupJ0r2wPAVIgus/Ez2Tm5N/rxL
27
-uXA5i9GCtSx3xEoT5OCNgT3hYgFo2iYk/c4kWW1p4igf0Y7y9Mig2ytsL9OEqXVu
28
-KPcRIorI9kn01DL44UDWCSi0/tITWX2KkgtxeaCgg3kx9r/BrO4/vKeB098DHLHi
29
-sMFiMWEyh6uZYbA=
30
------END CERTIFICATE-----