Ivars 5 anni fa
parent
commit
c681a82d56
2 ha cambiato i file con 501 aggiunte e 357 eliminazioni
  1. 73
    14
      playstreamproxy.py
  2. 428
    343
      project.wpr

+ 73
- 14
playstreamproxy.py Vedi File

@@ -11,6 +11,7 @@ from signal import SIGTERM
11 11
 
12 12
 from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
13 13
 from SocketServer import ThreadingMixIn
14
+import time, threading, socket, SocketServer
14 15
 
15 16
 from urllib import unquote, quote
16 17
 import urllib,urlparse
@@ -28,16 +29,20 @@ try:
28 29
 except:
29 30
     pass
30 31
 
31
-HOST_NAME = ""
32
+HOST_NAME = "0.0.0.0"
32 33
 PORT_NUMBER = 8880
33
-DEBUG = True
34
-DEBUG2 = False
35 34
 REDIRECT = True
35
+MULTITHREAD = False
36
+WORKERS = 10
37
+KEY = ""
38
+DEBUG = False
39
+DEBUG2 = False
36 40
 
37 41
 SPLIT_CHAR = "~"
38 42
 SPLIT_CODE = "%7E"
39 43
 EQ_CODE = "%3D"
40 44
 COL_CODE = "%3A"
45
+
41 46
 cunicode = lambda s: s.decode("utf8") if isinstance(s, str) else s
42 47
 cstr = lambda s: s.encode("utf8") if isinstance(s, unicode) else s
43 48
 headers2dict = lambda  h: dict([l.strip().split(": ") for l in h.strip().splitlines()])
@@ -61,14 +66,26 @@ sources = ContentSources("", cfg_file)
61 66
 config = ConfigParser.ConfigParser()
62 67
 proxy_cfg_file = os.path.join(cur_directory, "playstreamproxy.cfg")
63 68
 if not os.path.exists(proxy_cfg_file):
64
-    config.add_section("default")
65
-    config["default"]["port"] = 80
66
-    config["default"]["host"] = localhost
67
-    config["default"]["redirect"] = True
68
-    config.write(open.file(proxy_cfg_file, "w"))
69
+    config.add_section("playstreamproxy")
70
+    config.set("playstreamproxy", "debug", DEBUG)
71
+    config.set("playstreamproxy", "host", HOST_NAME)
72
+    config.set("playstreamproxy", "port", PORT_NUMBER)
73
+    config.set("playstreamproxy", "redirect", REDIRECT)
74
+    config.set("playstreamproxy", "key", KEY)
75
+    config.set("playstreamproxy", "multithread", MULTITHREAD)
76
+    config.set("playstreamproxy", "workers", WORKERS)
77
+    config.set("playstreamproxy", "wsgi", "wsgiref")
78
+    config.write(open(proxy_cfg_file, "w"))
69 79
 else:
70 80
     config.read(proxy_cfg_file)
71
-
81
+    DEBUG = config.getboolean("playstreamproxy", "debug")
82
+    HOST_NAME = config.get("playstreamproxy", "host")
83
+    PORT_NUMBER = config.getint("playstreamproxy", "port")
84
+    REDIRECT = config.getboolean("playstreamproxy", "redirect")
85
+    KEY = config.get("playstreamproxy", "key")
86
+    MULTITHREAD = config.getboolean("playstreamproxy", "multithread")
87
+    WORKERS = config.getint("playstreamproxy", "workers")
88
+    pass
72 89
 
73 90
 class StreamHandler(BaseHTTPRequestHandler):
74 91
 
@@ -91,7 +108,14 @@ class StreamHandler(BaseHTTPRequestHandler):
91 108
         """Respond to a GET request"""
92 109
         #
93 110
         print "\n\n"+40*"#"+"\nget_url: \n%s" % self.path
94
-        cmd = self.path.split("/")[1]
111
+        cmd, data, headers, qs = streamproxy_decode3(self.path)
112
+        if KEY:
113
+            key = qs["key"] if "key" in qs else ""
114
+            if key <> KEY:
115
+                print "No key provided"
116
+                #self.send_response(404)
117
+                self.write_error(404)
118
+                return
95 119
         if DEBUG:
96 120
             print "cmd=%s"%cmd
97 121
             print "Original request headers + url headers:"
@@ -101,7 +125,6 @@ class StreamHandler(BaseHTTPRequestHandler):
101 125
             if cmd == "playstream":
102 126
                 self.fetch_source( self.path)
103 127
             elif cmd in ["get_content", "get_streams", "get_info", "is_video", "options_read", "options_write"]:
104
-                cmd, data, headers, qs = streamproxy_decode3(self.path)
105 128
                 if cmd == "get_content":
106 129
                     content = sources.get_content(data)
107 130
                 elif cmd == "get_streams":
@@ -273,7 +296,7 @@ class StreamHandler(BaseHTTPRequestHandler):
273 296
 class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
274 297
     """Handle requests in a separate thread."""
275 298
 
276
-def start(host = HOST_NAME, port = PORT_NUMBER, redirect=None):
299
+def start(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
277 300
     global REDIRECT
278 301
     if redirect:
279 302
         REDIRECT = redirect
@@ -286,6 +309,37 @@ def start(host = HOST_NAME, port = PORT_NUMBER, redirect=None):
286 309
     httpd.server_close()
287 310
     print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
288 311
 
312
+def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
313
+    global REDIRECT
314
+    if redirect:
315
+        REDIRECT = redirect
316
+
317
+    print time.asctime(), "Server Starts - %s:%s" % (host, port)
318
+    addr = ('', port)
319
+    sock = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
320
+    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
321
+    sock.bind(addr)
322
+    sock.listen(5)
323
+
324
+    # Launch  listener threads.
325
+    class Thread(threading.Thread):
326
+        def __init__(self, i):
327
+            threading.Thread.__init__(self)
328
+            self.i = i
329
+            self.daemon = True
330
+            self.start()
331
+        def run(self):
332
+            httpd = HTTPServer(addr, StreamHandler, False)
333
+
334
+            # Prevent the HTTP server from re-binding every handler.
335
+            # https://stackoverflow.com/questions/46210672/
336
+            httpd.socket = sock
337
+            httpd.server_bind = self.server_close = lambda self: None
338
+
339
+            httpd.serve_forever()
340
+    [Thread(i) for i in range(10)]
341
+    time.sleep(9e5)
342
+    print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
289 343
 
290 344
 class Daemon:
291 345
     """
@@ -413,7 +467,10 @@ class Daemon:
413 467
 
414 468
 class ProxyDaemon(Daemon):
415 469
     def run(self):
416
-        start()
470
+        if MULTITHREAD:
471
+            start2()
472
+        else:
473
+            start()
417 474
 
418 475
 def print_headers(headers):
419 476
     for h in headers:
@@ -451,7 +508,9 @@ if __name__ == "__main__":
451 508
         elif "restart" == sys.argv[1]:
452 509
             daemon.restart()
453 510
         elif "manualstart" == sys.argv[1]:
454
-            start()
511
+            daemon.run()
512
+        elif "multithread" == sys.argv[1]:
513
+            start2()
455 514
         else:
456 515
             print "Unknown command"
457 516
             sys.exit(2)

+ 428
- 343
project.wpr Vedi File

@@ -82,15 +82,11 @@ debug.breakpoints = {loc('Downloader.py'): {94: (0,
82 82
                None,
83 83
                1,
84 84
                0)},
85
-                     loc('playstreamproxy.py'): {64L: (0,
85
+                     loc('playstreamproxy.py'): {182L: (0,
86 86
         None,
87 87
         1,
88 88
         0),
89
-        73L: (0,
90
-              None,
91
-              1,
92
-              0),
93
-        376L: (0,
89
+        430L: (0,
94 90
                None,
95 91
                1,
96 92
                0)},
@@ -296,7 +292,8 @@ debug.recent-run-args = {loc('ContentSources.py'): [u'config::home streams_bernu
296 292
         u'--slud'],
297 293
                          loc('kivy_test.py'): [u'https://walterebert.com/playground/video/hls/sintel-trailer.m3u8',
298 294
         u'https://dl4.sanii.co/files/2/60e13omc1cpph2/video.mp4'],
299
-                         loc('playstreamproxy.py'): [u'manualstart'],
295
+                         loc('playstreamproxy.py'): [u'manualstart',
296
+        u'multithread'],
300 297
                          loc('playstreamproxy2.py'): [u'manualstart ',
301 298
         u'manualstart cheroot',
302 299
         u'manualstart cheroot 80',
@@ -348,7 +345,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
348 345
                  'current_pages': [0,
349 346
                                    2],
350 347
                  'full-screen': False,
351
-                 'notebook_display': 'normal',
348
+                 'notebook_display': 'tabs only',
352 349
                  'notebook_percent': 0.17992831541218635,
353 350
                  'override_title': None,
354 351
                  'pagelist': [('project',
@@ -356,7 +353,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
356 353
                                0,
357 354
                                {'tree-state': {'file-sort-method': 'by name',
358 355
         'list-files-first': 0,
359
-        'tree-states': {'deep': {'expanded-nodes': [(21,)],
356
+        'tree-states': {'deep': {'expanded-nodes': [(30,)],
360 357
                                  'selected-nodes': [(0,)],
361 358
                                  'top-node': (0,)}},
362 359
         'tree-style': 'deep'}}),
@@ -918,7 +915,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
918 915
         'top-node': [('class def',
919 916
                       loc('../../../../../Python27/lib/site-packages/PIL/ImageTk.py'),
920 917
                       'BitmapImage')]},
921
-        loc('unknown:<untitled> #6'): {'column-widths': [1.0],
918
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
922 919
                                        'expanded-nodes': [],
923 920
                                        'selected-nodes': [],
924 921
                                        'top-node': None},
@@ -926,7 +923,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
926 923
                                        'expanded-nodes': [],
927 924
                                        'selected-nodes': [],
928 925
                                        'top-node': None},
929
-        loc('unknown:<untitled> #3'): {'expanded-nodes': [],
926
+        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
930 927
                                        'selected-nodes': [],
931 928
                                        'top-node': None},
932 929
         loc('unknown:<untitled> #5'): {'expanded-nodes': [],
@@ -956,10 +953,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
956 953
                                None)],
957 954
                  'primary_view_state': {'area': 'wide',
958 955
         'constraint': None,
959
-        'current_pages': [3,
956
+        'current_pages': [2,
960 957
                           0],
961 958
         'notebook_display': 'normal',
962
-        'notebook_percent': 0.2306034482758621,
959
+        'notebook_percent': 0.3663793103448276,
963 960
         'override_title': None,
964 961
         'pagelist': [('debug-breakpoints',
965 962
                       'wide',
@@ -992,7 +989,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
992 989
                                        'fRegexFlags': 42,
993 990
                                        'fReplaceText': u'xtv::',
994 991
                                        'fReverse': False,
995
-                                       'fSearchText': u'binascii',
992
+                                       'fSearchText': u'get_page_s',
996 993
                                        'fStartPos': 0,
997 994
                                        'fStyle': 'text',
998 995
                                        'fWholeWords': False,
@@ -1066,58 +1063,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1066 1063
         -1,
1067 1064
         -1),
1068 1065
                        'attrib-starts': [],
1069
-                       'first-line': 564L,
1066
+                       'first-line': 3L,
1070 1067
                        'folded-linenos': [],
1071
-                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/playstreamproxy.py': ['s'\
1072
-        'elf.path\n',
1068
+                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/playstreamproxy.py': ['c'\
1069
+        'onfig.add_section("playstreamproxy")\n',
1070
+        'config.set(section, option)\n',
1073 1071
         'config\n',
1074
-        'config.items\n',
1075
-        'config.items()\n',
1076
-        'config.sections()\n',
1077
-        'config.add_section("default")\n',
1078
-        'config.add_section("default2")\n',
1079
-        'config.set("default","port", 880)\n',
1080
-        'config.set("default2","port", 880)\n'],
1081
-                                   u'file:C:/Data/Programming/enigma2/PlayStream2/content/playstreamproxy2.py': ['s'\
1082
-        '["n"]\n',
1083
-        'requests.session\n',
1084
-        'requests.s\n',
1085
-        'request.s\n',
1086
-        'globals\n',
1087
-        'globals()\n',
1088
-        's0\n',
1089
-        's\n',
1090
-        'sources\n',
1091
-        'sources.plugins\n',
1092
-        'sources.plugins.keys()\n',
1093
-        'streamproxy_decode3(request.path)\n',
1094
-        'streamproxy_decode3(request.url)\n',
1095
-        'data\n',
1096
-        'request.remote_addr\n',
1097
-        'request.app\n',
1098
-        'request.app.config\n',
1099
-        'request.app.get\n',
1100
-        'request.environ\n',
1101
-        'bo',
1102
-        'Bottle.get_url(routename)\n',
1103
-        'bottle.url\n',
1104
-        'bottle.url()\n',
1105
-        'request.fullpath\n',
1106
-        'request.urlparts\n',
1107
-        'request.path\n',
1108
-        'urllib.spl\n',
1109
-        'url\n',
1110
-        'request.query\n',
1111
-        'request.query.allitems\n',
1112
-        'request.url\n',
1113
-        'qs\n',
1114
-        'urlp\n',
1115
-        'str(qs)\n']},
1072
+        'config["playstreamproxy"]\n',
1073
+        'config.get("playstreamproxy", "port")\n',
1074
+        'config.get("playstreamproxy", "redirect")\n']},
1116 1075
                        'launch-id': None,
1117
-                       'sel-line': 566L,
1118
-                       'sel-line-start': 30405L,
1119
-                       'selection_end': 30439L,
1120
-                       'selection_start': 30439L,
1076
+                       'sel-line': 16L,
1077
+                       'sel-line-start': 499L,
1078
+                       'selection_end': 524L,
1079
+                       'selection_start': 524L,
1121 1080
                        'zoom': 0L}),
1122 1081
                      ('debug-watch',
1123 1082
                       'wide',
@@ -1165,285 +1124,398 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1165 1124
                        'selection_end': 163L,
1166 1125
                        'selection_start': 163L,
1167 1126
                        'zoom': 0L})],
1168
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('playstreamproxy2.py'),
1169
-        {'attrib-starts': [('fetch_source',
1170
-                            75)],
1171
-         'first-line': 67L,
1172
-         'folded-linenos': [],
1173
-         'sel-line': 77L,
1174
-         'sel-line-start': 2297L,
1175
-         'selection_end': 2297L,
1176
-         'selection_start': 2297L,
1127
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('playstreamproxy.py'),
1128
+        {'attrib-starts': [('start2',
1129
+                            297)],
1130
+         'first-line': 64L,
1131
+         'folded-linenos': [66L,
1132
+                            74L,
1133
+                            83L,
1134
+                            143L,
1135
+                            155L,
1136
+                            281L,
1137
+                            329L,
1138
+                            340L,
1139
+                            453L,
1140
+                            457L,
1141
+                            461L,
1142
+                            470L,
1143
+                            476L],
1144
+         'sel-line': 326L,
1145
+         'sel-line-start': 11634L,
1146
+         'selection_end': 11652L,
1147
+         'selection_start': 11652L,
1177 1148
          'zoom': 0L},
1178
-        1553945355.792],
1149
+        1553952333.117],
1179 1150
         [loc('playstreamproxy2.py'),
1180
-         {'attrib-starts': [('start',
1181
-                             83)],
1182
-          'first-line': 152L,
1151
+         {'attrib-starts': [('set_globals',
1152
+                             65)],
1153
+          'first-line': 69L,
1183 1154
           'folded-linenos': [],
1184
-          'sel-line': 83L,
1185
-          'sel-line-start': 2451L,
1186
-          'selection_end': 2460L,
1187
-          'selection_start': 2460L,
1155
+          'sel-line': 72L,
1156
+          'sel-line-start': 2074L,
1157
+          'selection_end': 2167L,
1158
+          'selection_start': 2076L,
1188 1159
           'zoom': 0L},
1189
-         1553945376.07],
1190
-        [loc('playstreamproxy2.py'),
1160
+         1553952350.391],
1161
+        [loc('playstreamproxy.py'),
1191 1162
          {'attrib-starts': [],
1192
-          'first-line': 119L,
1193
-          'folded-linenos': [],
1194
-          'sel-line': 129L,
1195
-          'sel-line-start': 3613L,
1196
-          'selection_end': 3652L,
1197
-          'selection_start': 3652L,
1163
+          'first-line': 66L,
1164
+          'folded-linenos': [92L,
1165
+                             156L,
1166
+                             165L,
1167
+                             168L,
1168
+                             294L,
1169
+                             310L,
1170
+                             353L,
1171
+                             473L,
1172
+                             477L,
1173
+                             486L,
1174
+                             492L],
1175
+          'sel-line': 85L,
1176
+          'sel-line-start': 2762L,
1177
+          'selection_end': 2806L,
1178
+          'selection_start': 2806L,
1198 1179
           'zoom': 0L},
1199
-         1553945384.54],
1200
-        [loc('playstreamproxy2.py'),
1201
-         {'attrib-starts': [],
1202
-          'first-line': 132L,
1203
-          'folded-linenos': [],
1204
-          'sel-line': 141L,
1205
-          'sel-line-start': 4108L,
1206
-          'selection_end': 4125L,
1207
-          'selection_start': 4125L,
1180
+         1553953683.553],
1181
+        [loc('playstreamproxy.py'),
1182
+         {'attrib-starts': [('StreamHandler',
1183
+                             90),
1184
+                            ('StreamHandler.do_GET',
1185
+                             107)],
1186
+          'first-line': 236L,
1187
+          'folded-linenos': [92L,
1188
+                             157L,
1189
+                             166L,
1190
+                             169L,
1191
+                             295L,
1192
+                             311L,
1193
+                             354L,
1194
+                             474L,
1195
+                             478L,
1196
+                             487L,
1197
+                             493L],
1198
+          'sel-line': 116L,
1199
+          'sel-line-start': 3835L,
1200
+          'selection_end': 3835L,
1201
+          'selection_start': 3835L,
1208 1202
           'zoom': 0L},
1209
-         1553945397.685],
1210
-        [loc('playstreamproxy2.py'),
1211
-         {'attrib-starts': [],
1212
-          'first-line': 121L,
1213
-          'folded-linenos': [],
1214
-          'sel-line': 126L,
1215
-          'sel-line-start': 3511L,
1216
-          'selection_end': 3533L,
1217
-          'selection_start': 3529L,
1203
+         1553953805.798],
1204
+        [loc('playstreamproxy.py'),
1205
+         {'attrib-starts': [('ProxyDaemon',
1206
+                             467),
1207
+                            ('ProxyDaemon.run',
1208
+                             468)],
1209
+          'first-line': 464L,
1210
+          'folded-linenos': [92L,
1211
+                             157L,
1212
+                             166L,
1213
+                             169L,
1214
+                             295L,
1215
+                             311L,
1216
+                             354L,
1217
+                             474L,
1218
+                             478L,
1219
+                             487L,
1220
+                             493L],
1221
+          'sel-line': 472L,
1222
+          'sel-line-start': 16103L,
1223
+          'selection_end': 16103L,
1224
+          'selection_start': 16103L,
1218 1225
           'zoom': 0L},
1219
-         1553945398.834],
1220
-        [loc('playstreamproxy2.py'),
1221
-         {'attrib-starts': [],
1222
-          'first-line': 121L,
1223
-          'folded-linenos': [],
1224
-          'sel-line': 133L,
1225
-          'sel-line-start': 3825L,
1226
-          'selection_end': 3856L,
1227
-          'selection_start': 3850L,
1226
+         1553953878.87],
1227
+        [loc('playstreamproxy.py'),
1228
+         {'attrib-starts': [('ProxyDaemon',
1229
+                             467)],
1230
+          'first-line': 456L,
1231
+          'folded-linenos': [92L,
1232
+                             157L,
1233
+                             166L,
1234
+                             169L,
1235
+                             295L,
1236
+                             311L,
1237
+                             354L,
1238
+                             474L,
1239
+                             478L,
1240
+                             487L,
1241
+                             493L],
1242
+          'sel-line': 467L,
1243
+          'sel-line-start': 15993L,
1244
+          'selection_end': 16010L,
1245
+          'selection_start': 15999L,
1228 1246
           'zoom': 0L},
1229
-         1553945414.542],
1230
-        [loc('playstreamproxy2.py'),
1231
-         {'attrib-starts': [],
1232
-          'first-line': 67L,
1233
-          'folded-linenos': [],
1234
-          'sel-line': 126L,
1235
-          'sel-line-start': 3511L,
1236
-          'selection_end': 3533L,
1237
-          'selection_start': 3529L,
1247
+         1553953884.554],
1248
+        [loc('playstreamproxy.py'),
1249
+         {'attrib-starts': [('StreamHandler',
1250
+                             90)],
1251
+          'first-line': 79L,
1252
+          'folded-linenos': [92L,
1253
+                             157L,
1254
+                             166L,
1255
+                             169L,
1256
+                             295L,
1257
+                             311L,
1258
+                             354L,
1259
+                             474L,
1260
+                             478L,
1261
+                             487L,
1262
+                             493L],
1263
+          'sel-line': 90L,
1264
+          'sel-line-start': 2952L,
1265
+          'selection_end': 2971L,
1266
+          'selection_start': 2958L,
1238 1267
           'zoom': 0L},
1239
-         1553945440.581],
1240
-        [loc('playstreamproxy2.py'),
1241
-         {'attrib-starts': [('set_globals',
1242
-                             65)],
1243
-          'first-line': 106L,
1244
-          'folded-linenos': [],
1245
-          'sel-line': 69L,
1246
-          'sel-line-start': 2018L,
1247
-          'selection_end': 2042L,
1248
-          'selection_start': 2042L,
1268
+         1553953891.027],
1269
+        [loc('playstreamproxy.py'),
1270
+         {'attrib-starts': [('StreamHandler',
1271
+                             90),
1272
+                            ('StreamHandler.do_GET',
1273
+                             107)],
1274
+          'first-line': 81L,
1275
+          'folded-linenos': [92L,
1276
+                             158L,
1277
+                             167L,
1278
+                             170L,
1279
+                             296L,
1280
+                             312L,
1281
+                             355L,
1282
+                             475L,
1283
+                             479L,
1284
+                             488L,
1285
+                             494L],
1286
+          'sel-line': 112L,
1287
+          'sel-line-start': 3697L,
1288
+          'selection_end': 3712L,
1289
+          'selection_start': 3712L,
1249 1290
           'zoom': 0L},
1250
-         1553945529.378],
1291
+         1553954151.921],
1251 1292
         [loc('playstreamproxy.py'),
1252
-         {'attrib-starts': [('start',
1253
-                             266)],
1254
-          'first-line': 257L,
1255
-          'folded-linenos': [263L,
1256
-                             291L,
1257
-                             404L],
1258
-          'sel-line': 269L,
1259
-          'sel-line-start': 9462L,
1260
-          'selection_end': 9489L,
1261
-          'selection_start': 9489L,
1293
+         {'attrib-starts': [('StreamHandler',
1294
+                             90),
1295
+                            ('StreamHandler.redirect_source',
1296
+                             167)],
1297
+          'first-line': 148L,
1298
+          'folded-linenos': [92L,
1299
+                             158L,
1300
+                             170L,
1301
+                             296L,
1302
+                             312L,
1303
+                             355L,
1304
+                             475L,
1305
+                             479L,
1306
+                             488L,
1307
+                             494L],
1308
+          'sel-line': 176L,
1309
+          'sel-line-start': 6152L,
1310
+          'selection_end': 6183L,
1311
+          'selection_start': 6160L,
1262 1312
           'zoom': 0L},
1263
-         1553945817.324],
1264
-        [loc('sources/ltc.py'),
1265
-         {'attrib-starts': [('Source',
1266
-                             26),
1267
-                            ('Source.__init__',
1268
-                             28)],
1269
-          'first-line': 63L,
1270
-          'folded-linenos': [581L],
1271
-          'sel-line': 76L,
1272
-          'sel-line-start': 2969L,
1273
-          'selection_end': 2994L,
1274
-          'selection_start': 2982L,
1313
+         1553954175.121],
1314
+        [loc('playstreamproxy.py'),
1315
+         {'attrib-starts': [('StreamHandler',
1316
+                             90),
1317
+                            ('StreamHandler.do_GET',
1318
+                             107)],
1319
+          'first-line': 88L,
1320
+          'folded-linenos': [92L,
1321
+                             158L,
1322
+                             170L,
1323
+                             296L,
1324
+                             312L,
1325
+                             355L,
1326
+                             475L,
1327
+                             479L,
1328
+                             488L,
1329
+                             494L],
1330
+          'sel-line': 116L,
1331
+          'sel-line-start': 3835L,
1332
+          'selection_end': 3835L,
1333
+          'selection_start': 3835L,
1275 1334
           'zoom': 0L},
1276
-         1553945865.641],
1277
-        [loc('sources/SourceBase.py'),
1278
-         {'attrib-starts': [('SourceBase',
1279
-                             32),
1280
-                            ('SourceBase.options_read',
1281
-                             79)],
1282
-          'first-line': 80L,
1335
+         1553954227.986],
1336
+        [loc('../../../../../Python27/Lib/BaseHTTPServer.py'),
1337
+         {'attrib-starts': [('BaseHTTPRequestHandler',
1338
+                             113),
1339
+                            ('BaseHTTPRequestHandler.handle_one_request',
1340
+                             300)],
1341
+          'first-line': 318L,
1283 1342
           'folded-linenos': [],
1284
-          'sel-line': 79L,
1285
-          'sel-line-start': 2740L,
1286
-          'selection_end': 3792L,
1287
-          'selection_start': 2740L,
1343
+          'sel-line': 329L,
1344
+          'sel-line-start': 12186L,
1345
+          'selection_end': 12186L,
1346
+          'selection_start': 12186L,
1288 1347
           'zoom': 0L},
1289
-         1553945999.548],
1348
+         1553954231.612],
1290 1349
         [loc('playstreamproxy.py'),
1291
-         {'attrib-starts': [],
1292
-          'first-line': 45L,
1293
-          'folded-linenos': [65L,
1294
-                             67L,
1295
-                             82L,
1296
-                             127L,
1297
-                             139L,
1298
-                             265L,
1299
-                             268L,
1300
-                             282L,
1301
-                             293L,
1302
-                             406L,
1303
-                             414L,
1304
-                             423L],
1305
-          'sel-line': 63L,
1306
-          'sel-line-start': 1733L,
1307
-          'selection_end': 1746L,
1308
-          'selection_start': 1746L,
1350
+         {'attrib-starts': [('StreamHandler',
1351
+                             90),
1352
+                            ('StreamHandler.do_GET',
1353
+                             107)],
1354
+          'first-line': 88L,
1355
+          'folded-linenos': [92L,
1356
+                             158L,
1357
+                             170L,
1358
+                             296L,
1359
+                             312L,
1360
+                             355L,
1361
+                             475L,
1362
+                             479L,
1363
+                             488L,
1364
+                             494L],
1365
+          'sel-line': 113L,
1366
+          'sel-line-start': 3714L,
1367
+          'selection_end': 3714L,
1368
+          'selection_start': 3714L,
1309 1369
           'zoom': 0L},
1310
-         1553946296.55],
1311
-        [loc('sources/SourceBase.py'),
1312
-         {'attrib-starts': [('SourceBase',
1313
-                             32),
1314
-                            ('SourceBase.options_read',
1315
-                             79)],
1316
-          'first-line': 80L,
1370
+         1553954292.598],
1371
+        [loc('playstreamproxy2.py'),
1372
+         {'attrib-starts': [('set_globals',
1373
+                             65)],
1374
+          'first-line': 69L,
1317 1375
           'folded-linenos': [],
1318
-          'sel-line': 82L,
1319
-          'sel-line-start': 2940L,
1320
-          'selection_end': 2984L,
1321
-          'selection_start': 2940L,
1376
+          'sel-line': 72L,
1377
+          'sel-line-start': 2074L,
1378
+          'selection_end': 2167L,
1379
+          'selection_start': 2076L,
1322 1380
           'zoom': 0L},
1323
-         1553946302.596],
1381
+         1553954305.352],
1324 1382
         [loc('playstreamproxy.py'),
1325 1383
          {'attrib-starts': [],
1326
-          'first-line': 51L,
1327
-          'folded-linenos': [67L,
1328
-                             69L,
1329
-                             84L,
1330
-                             129L,
1331
-                             141L,
1332
-                             267L,
1333
-                             270L,
1334
-                             284L,
1335
-                             295L,
1336
-                             408L,
1337
-                             416L,
1338
-                             425L],
1339
-          'sel-line': 65L,
1340
-          'sel-line-start': 1840L,
1341
-          'selection_end': 1866L,
1342
-          'selection_start': 1866L,
1384
+          'first-line': 54L,
1385
+          'folded-linenos': [92L,
1386
+                             158L,
1387
+                             170L,
1388
+                             296L,
1389
+                             312L,
1390
+                             355L,
1391
+                             475L,
1392
+                             479L,
1393
+                             488L,
1394
+                             494L],
1395
+          'sel-line': 37L,
1396
+          'sel-line-start': 975L,
1397
+          'selection_end': 988L,
1398
+          'selection_start': 988L,
1343 1399
           'zoom': 0L},
1344
-         1553946941.087],
1345
-        [loc('run.py'),
1346
-         {'attrib-starts': [('Main',
1347
-                             22),
1348
-                            ('Main.show_content',
1349
-                             183)],
1350
-          'first-line': 181L,
1351
-          'folded-linenos': [],
1352
-          'sel-line': 186L,
1353
-          'sel-line-start': 7417L,
1354
-          'selection_end': 7417L,
1355
-          'selection_start': 7417L,
1400
+         1553955126.04],
1401
+        [loc('playstreamproxy.py'),
1402
+         {'attrib-starts': [('start',
1403
+                             299)],
1404
+          'first-line': 0L,
1405
+          'folded-linenos': [92L,
1406
+                             158L,
1407
+                             170L,
1408
+                             296L,
1409
+                             312L,
1410
+                             355L,
1411
+                             475L,
1412
+                             479L,
1413
+                             488L,
1414
+                             494L],
1415
+          'sel-line': 304L,
1416
+          'sel-line-start': 10972L,
1417
+          'selection_end': 11034L,
1418
+          'selection_start': 11025L,
1356 1419
           'zoom': 0L},
1357
-         1553946943.415],
1420
+         1553955308.012],
1358 1421
         [loc('playstreamproxy.py'),
1359 1422
          {'attrib-starts': [],
1360
-          'first-line': 51L,
1361
-          'folded-linenos': [68L,
1362
-                             70L,
1363
-                             85L,
1364
-                             130L,
1365
-                             142L,
1366
-                             268L,
1367
-                             271L,
1368
-                             285L,
1423
+          'first-line': 53L,
1424
+          'folded-linenos': [92L,
1425
+                             158L,
1426
+                             170L,
1369 1427
                              296L,
1370
-                             409L,
1371
-                             417L,
1372
-                             426L],
1373
-          'sel-line': 61L,
1374
-          'sel-line-start': 1691L,
1375
-          'selection_end': 1691L,
1376
-          'selection_start': 1691L,
1428
+                             312L,
1429
+                             355L,
1430
+                             475L,
1431
+                             479L,
1432
+                             488L,
1433
+                             494L],
1434
+          'sel-line': 71L,
1435
+          'sel-line-start': 2060L,
1436
+          'selection_end': 2111L,
1437
+          'selection_start': 2102L,
1377 1438
           'zoom': 0L},
1378
-         1553947010.449],
1379
-        [loc('ContentSources.py'),
1380
-         {'attrib-starts': [('ContentSources',
1381
-                             16),
1382
-                            ('ContentSources.__init__',
1383
-                             20)],
1384
-          'first-line': 16L,
1385
-          'folded-linenos': [],
1386
-          'sel-line': 29L,
1387
-          'sel-line-start': 1236L,
1388
-          'selection_end': 1236L,
1389
-          'selection_start': 1236L,
1439
+         1553955310.318],
1440
+        [loc('playstreamproxy.py'),
1441
+         {'attrib-starts': [('StreamHandler',
1442
+                             90),
1443
+                            ('StreamHandler.fetch_source',
1444
+                             181)],
1445
+          'first-line': 203L,
1446
+          'folded-linenos': [92L,
1447
+                             158L,
1448
+                             170L,
1449
+                             296L,
1450
+                             312L,
1451
+                             355L,
1452
+                             475L,
1453
+                             479L,
1454
+                             488L,
1455
+                             494L],
1456
+          'sel-line': 221L,
1457
+          'sel-line-start': 7994L,
1458
+          'selection_end': 8019L,
1459
+          'selection_start': 8011L,
1390 1460
           'zoom': 0L},
1391
-         1553947061.55],
1461
+         1553955312.213],
1392 1462
         [loc('playstreamproxy.py'),
1393
-         {'attrib-starts': [],
1394
-          'first-line': 0L,
1395
-          'folded-linenos': [66L,
1396
-                             68L,
1397
-                             83L,
1398
-                             128L,
1399
-                             140L,
1400
-                             266L,
1401
-                             269L,
1402
-                             283L,
1403
-                             294L,
1404
-                             407L,
1405
-                             415L,
1406
-                             424L],
1407
-          'sel-line': 8L,
1408
-          'sel-line-start': 215L,
1409
-          'selection_end': 230L,
1410
-          'selection_start': 222L,
1463
+         {'attrib-starts': [('StreamHandler',
1464
+                             90),
1465
+                            ('StreamHandler.fetch_source',
1466
+                             181)],
1467
+          'first-line': 206L,
1468
+          'folded-linenos': [92L,
1469
+                             158L,
1470
+                             170L,
1471
+                             296L,
1472
+                             312L,
1473
+                             355L,
1474
+                             475L,
1475
+                             479L,
1476
+                             488L,
1477
+                             494L],
1478
+          'sel-line': 221L,
1479
+          'sel-line-start': 7994L,
1480
+          'selection_end': 8021L,
1481
+          'selection_start': 8011L,
1411 1482
           'zoom': 0L},
1412
-         1553947091.271],
1483
+         1553955314.004],
1413 1484
         [loc('playstreamproxy.py'),
1414
-         {'attrib-starts': [],
1415
-          'first-line': 49L,
1416
-          'folded-linenos': [72L,
1417
-                             74L,
1418
-                             89L,
1419
-                             134L,
1420
-                             146L,
1421
-                             272L,
1422
-                             275L,
1423
-                             289L,
1424
-                             300L,
1425
-                             413L,
1426
-                             421L,
1427
-                             430L],
1428
-          'sel-line': 63L,
1429
-          'sel-line-start': 1863L,
1430
-          'selection_end': 1863L,
1431
-          'selection_start': 1863L,
1485
+         {'attrib-starts': [('StreamHandler',
1486
+                             90),
1487
+                            ('StreamHandler.get_page_ses',
1488
+                             263)],
1489
+          'first-line': 256L,
1490
+          'folded-linenos': [92L,
1491
+                             158L,
1492
+                             170L,
1493
+                             296L,
1494
+                             312L,
1495
+                             355L,
1496
+                             475L,
1497
+                             479L,
1498
+                             488L,
1499
+                             494L],
1500
+          'sel-line': 265L,
1501
+          'sel-line-start': 9507L,
1502
+          'selection_end': 9507L,
1503
+          'selection_start': 9507L,
1432 1504
           'zoom': 0L},
1433
-         1553947541.42],
1434
-        [loc('../../../../../Python27/Lib/ConfigParser.py'),
1435
-         {'attrib-starts': [('RawConfigParser',
1436
-                             230),
1437
-                            ('RawConfigParser.add_section',
1438
-                             252)],
1439
-          'first-line': 238L,
1505
+         1553955534.195],
1506
+        [loc('../../../../../Python27/Lib/_abcoll.py'),
1507
+         {'attrib-starts': [('MutableMapping',
1508
+                             492),
1509
+                            ('MutableMapping.update',
1510
+                             547)],
1511
+          'first-line': 548L,
1440 1512
           'folded-linenos': [],
1441
-          'sel-line': 260L,
1442
-          'sel-line-start': 8810L,
1443
-          'selection_end': 8810L,
1444
-          'selection_start': 8810L,
1513
+          'sel-line': 556L,
1514
+          'sel-line-start': 14832L,
1515
+          'selection_end': 14832L,
1516
+          'selection_start': 14832L,
1445 1517
           'zoom': 0L},
1446
-         1553947548.149]],
1518
+         1553955536.616]],
1447 1519
         20),
1448 1520
         'current-loc': loc('playstreamproxy.py'),
1449 1521
         'editor-state-list': [(loc('run.py'),
@@ -1460,33 +1532,31 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1460 1532
                                 'zoom': 0L}),
1461 1533
                               (loc('playstreamproxy.py'),
1462 1534
                                {'attrib-starts': [],
1463
-                                'first-line': 0L,
1464
-                                'folded-linenos': [72L,
1465
-        74L,
1466
-        89L,
1467
-        134L,
1468
-        146L,
1469
-        272L,
1470
-        275L,
1471
-        289L,
1472
-        300L,
1473
-        413L,
1474
-        421L,
1475
-        430L],
1476
-                                'sel-line': 63L,
1477
-                                'sel-line-start': 1863L,
1478
-                                'selection_end': 1863L,
1479
-                                'selection_start': 1863L,
1535
+                                'first-line': 27L,
1536
+                                'folded-linenos': [91L,
1537
+        157L,
1538
+        169L,
1539
+        295L,
1540
+        311L,
1541
+        354L,
1542
+        474L,
1543
+        478L,
1544
+        487L,
1545
+        493L],
1546
+                                'sel-line': 39L,
1547
+                                'sel-line-start': 1006L,
1548
+                                'selection_end': 1006L,
1549
+                                'selection_start': 1006L,
1480 1550
                                 'zoom': 0L}),
1481 1551
                               (loc('playstreamproxy2.py'),
1482 1552
                                {'attrib-starts': [('set_globals',
1483 1553
         65)],
1484
-                                'first-line': 106L,
1554
+                                'first-line': 69L,
1485 1555
                                 'folded-linenos': [],
1486
-                                'sel-line': 69L,
1487
-                                'sel-line-start': 2018L,
1488
-                                'selection_end': 2042L,
1489
-                                'selection_start': 2042L,
1556
+                                'sel-line': 72L,
1557
+                                'sel-line-start': 2074L,
1558
+                                'selection_end': 2167L,
1559
+                                'selection_start': 2076L,
1490 1560
                                 'zoom': 0L}),
1491 1561
                               (loc('sources/config.py'),
1492 1562
                                {'attrib-starts': [('Source',
@@ -1579,14 +1649,26 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1579 1649
         230),
1580 1650
         ('RawConfigParser.add_section',
1581 1651
          252)],
1582
-                                'first-line': 238L,
1652
+                                'first-line': 255L,
1583 1653
                                 'folded-linenos': [],
1584 1654
                                 'sel-line': 260L,
1585 1655
                                 'sel-line-start': 8810L,
1586 1656
                                 'selection_end': 8810L,
1587 1657
                                 'selection_start': 8810L,
1658
+                                'zoom': 0L}),
1659
+                              (loc('../../../../../Python27/Lib/_abcoll.py'),
1660
+                               {'attrib-starts': [('MutableMapping',
1661
+        492),
1662
+        ('MutableMapping.update',
1663
+         547)],
1664
+                                'first-line': 548L,
1665
+                                'folded-linenos': [],
1666
+                                'sel-line': 556L,
1667
+                                'sel-line-start': 14832L,
1668
+                                'selection_end': 14832L,
1669
+                                'selection_start': 14832L,
1588 1670
                                 'zoom': 0L})],
1589
-        'has-focus': False,
1671
+        'has-focus': True,
1590 1672
         'locked': False},
1591 1673
         [loc('run.py'),
1592 1674
          loc('playstreamproxy.py'),
@@ -1598,19 +1680,21 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1598 1680
          loc('bottle.py'),
1599 1681
          loc('util.py'),
1600 1682
          loc('sources/ltc.py'),
1601
-         loc('../../../../../Python27/Lib/ConfigParser.py')]),
1602
-                               'open_files': [u'daemonize.py',
1683
+         loc('../../../../../Python27/Lib/ConfigParser.py'),
1684
+         loc('../../../../../Python27/Lib/_abcoll.py')]),
1685
+                               'open_files': [u'bottle.py',
1686
+        u'daemonize.py',
1603 1687
         u'mtwsgi.py',
1604
-        u'test_url.py',
1605
-        u'bottle.py',
1688
+        u'run.py',
1606 1689
         u'sources/config.py',
1690
+        u'sources/ltc.py',
1691
+        u'test_url.py',
1607 1692
         u'util.py',
1693
+        u'../../../../../Python27/Lib/ConfigParser.py',
1608 1694
         u'playstreamproxy2.py',
1609
-        u'sources/ltc.py',
1610
-        u'run.py',
1611 1695
         u'playstreamproxy.py']},
1612 1696
         'saved_notebook_display': None,
1613
-        'split_percents': {0: 0.465893587994543},
1697
+        'split_percents': {0: 0.7858117326057299},
1614 1698
         'splits': 2,
1615 1699
         'tab_location': 'top',
1616 1700
         'user_data': {}},
@@ -1624,11 +1708,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1624 1708
                          2432,
1625 1709
                          1440)}]}
1626 1710
 guimgr.recent-documents = [loc('playstreamproxy.py'),
1711
+                           loc('../../../../../Python27/Lib/_abcoll.py'),
1712
+                           loc('playstreamproxy2.py'),
1627 1713
                            loc('../../../../../Python27/Lib/ConfigParser.py'),
1714
+                           loc('util.py'),
1628 1715
                            loc('run.py'),
1629 1716
                            loc('sources/ltc.py'),
1630
-                           loc('playstreamproxy2.py'),
1631
-                           loc('util.py'),
1632 1717
                            loc('sources/config.py'),
1633 1718
                            loc('bottle.py'),
1634 1719
                            loc('test_url.py'),
@@ -2389,7 +2474,8 @@ search.replace-history = [u'filmix.co',
2389 2474
                           u'https://replay.lsm.lv',
2390 2475
                           u'www.shortcut.lv',
2391 2476
                           u'shortcut.lv']
2392
-search.search-history = [u'binascii',
2477
+search.search-history = [u'get_page_s',
2478
+                         u'binascii',
2393 2479
                          u'main',
2394 2480
                          u'tmp',
2395 2481
                          u'options',
@@ -2407,8 +2493,7 @@ search.search-history = [u'binascii',
2407 2493
                          u'a =1',
2408 2494
                          u'live-stre',
2409 2495
                          u'ltc:',
2410
-                         u'DEBUG',
2411
-                         u'self.head']
2496
+                         u'DEBUG']
2412 2497
 testing.stored-results = (1,
2413 2498
                           [],
2414 2499
                           {})