Browse Source

replay salabots

Ivars 6 years ago
parent
commit
295fa30b92
2 changed files with 128 additions and 90 deletions
  1. 125
    89
      project.wpr
  2. 3
    1
      sources/replay.py

+ 125
- 89
project.wpr View File

822
         'top-node': [('generic attribute',
822
         'top-node': [('generic attribute',
823
                       loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
823
                       loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
824
                       'ADAPTIVE')]},
824
                       'ADAPTIVE')]},
825
-        loc('unknown:<untitled> #6'): {'column-widths': [1.0],
825
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
826
                                        'expanded-nodes': [],
826
                                        'expanded-nodes': [],
827
                                        'selected-nodes': [],
827
                                        'selected-nodes': [],
828
                                        'top-node': None},
828
                                        'top-node': None},
829
-        loc('unknown:<untitled> #3'): {'expanded-nodes': [],
829
+        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
830
                                        'selected-nodes': [],
830
                                        'selected-nodes': [],
831
                                        'top-node': None},
831
                                        'top-node': None},
832
-        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
833
-                                       'expanded-nodes': [],
832
+        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
834
                                        'selected-nodes': [],
833
                                        'selected-nodes': [],
835
                                        'top-node': None},
834
                                        'top-node': None},
836
-        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
835
+        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
836
+                                       'expanded-nodes': [],
837
                                        'selected-nodes': [],
837
                                        'selected-nodes': [],
838
                                        'top-node': None}},
838
                                        'top-node': None}},
839
                                 'browse_mode': u'Current Module',
839
                                 'browse_mode': u'Current Module',
970
         -1,
970
         -1,
971
         -1),
971
         -1),
972
                        'attrib-starts': [],
972
                        'attrib-starts': [],
973
-                       'first-line': 10L,
973
+                       'first-line': 21L,
974
                        'folded-linenos': [],
974
                        'folded-linenos': [],
975
-                       'history': {u'file:C:/Data/Programming/Kodi/plugin.video.playstream/resources/lib/content/sources/replay.py': ['h'\
976
-        'eaders\n',
977
-        'url\n',
978
-        'print url\n',
979
-        'print\n']},
975
+                       'history': {u'file:C:/Data/Programming/Kodi/plugin.video.playstream/resources/lib/content/sources/replay.py': ['d'\
976
+        'ata\n',
977
+        'url3\n',
978
+        'headers\n',
979
+        'raise \n',
980
+        'ex\n',
981
+        'm.group(1)\n']},
980
                        'launch-id': None,
982
                        'launch-id': None,
981
-                       'sel-line': 19L,
982
-                       'sel-line-start': 688L,
983
-                       'selection_end': 688L,
984
-                       'selection_start': 688L,
983
+                       'sel-line': 26L,
984
+                       'sel-line-start': 1810L,
985
+                       'selection_end': 1810L,
986
+                       'selection_start': 1810L,
985
                        'zoom': 0L}),
987
                        'zoom': 0L}),
986
                      ('debug-watch',
988
                      ('debug-watch',
987
                       'wide',
989
                       'wide',
1034
                             31),
1036
                             31),
1035
                            ('Source.get_content',
1037
                            ('Source.get_content',
1036
                             56)],
1038
                             56)],
1037
-         'first-line': 133L,
1039
+         'first-line': 146L,
1038
          'folded-linenos': [],
1040
          'folded-linenos': [],
1039
-         'sel-line': 138L,
1040
-         'sel-line-start': 5619L,
1041
-         'selection_end': 5654L,
1042
-         'selection_start': 5652L,
1041
+         'sel-line': 154L,
1042
+         'sel-line-start': 6516L,
1043
+         'selection_end': 6565L,
1044
+         'selection_start': 6560L,
1043
          'zoom': 0L},
1045
          'zoom': 0L},
1044
-        1530209521.984],
1045
-        [loc('sources/filmix.py'),
1046
-         {'attrib-starts': [('Source',
1047
-                             31),
1048
-                            ('Source.get_content',
1049
-                             56)],
1050
-          'first-line': 133L,
1051
-          'folded-linenos': [],
1052
-          'sel-line': 138L,
1053
-          'sel-line-start': 5619L,
1054
-          'selection_end': 5646L,
1055
-          'selection_start': 5645L,
1056
-          'zoom': 0L},
1057
-         1530209524.614],
1058
-        [loc('sources/filmix.py'),
1059
-         {'attrib-starts': [('Source',
1060
-                             31),
1061
-                            ('Source.get_content',
1062
-                             56)],
1063
-          'first-line': 140L,
1064
-          'folded-linenos': [],
1065
-          'sel-line': 148L,
1066
-          'sel-line-start': 6116L,
1067
-          'selection_end': 6145L,
1068
-          'selection_start': 6140L,
1069
-          'zoom': 0L},
1070
-         1530209531.547],
1071
-        [loc('sources/filmix.py'),
1072
-         {'attrib-starts': [('Source',
1073
-                             31),
1074
-                            ('Source.get_content',
1075
-                             56)],
1076
-          'first-line': 140L,
1077
-          'folded-linenos': [],
1078
-          'sel-line': 148L,
1079
-          'sel-line-start': 6116L,
1080
-          'selection_end': 6153L,
1081
-          'selection_start': 6148L,
1082
-          'zoom': 0L},
1083
-         1530209532.105],
1084
-        [loc('sources/filmix.py'),
1085
-         {'attrib-starts': [('Source',
1086
-                             31),
1087
-                            ('Source.get_content',
1088
-                             56)],
1089
-          'first-line': 146L,
1090
-          'folded-linenos': [],
1091
-          'sel-line': 154L,
1092
-          'sel-line-start': 6516L,
1093
-          'selection_end': 6565L,
1094
-          'selection_start': 6560L,
1095
-          'zoom': 0L},
1096
-         1530209535.89],
1046
+        1530209535.89],
1097
         [loc('sources/filmix.py'),
1047
         [loc('sources/filmix.py'),
1098
          {'attrib-starts': [('Source',
1048
          {'attrib-starts': [('Source',
1099
                              31),
1049
                              31),
1448
           'selection_end': 26927L,
1398
           'selection_end': 26927L,
1449
           'selection_start': 26926L,
1399
           'selection_start': 26926L,
1450
           'zoom': 0L},
1400
           'zoom': 0L},
1451
-         1530209984.345]],
1401
+         1530209984.345],
1402
+        [loc('sources/ltc.py'),
1403
+         {'attrib-starts': [('Source',
1404
+                             26),
1405
+                            ('Source.get_info2',
1406
+                             930)],
1407
+          'first-line': 934L,
1408
+          'folded-linenos': [132L,
1409
+                             161L,
1410
+                             221L,
1411
+                             232L,
1412
+                             258L,
1413
+                             277L,
1414
+                             296L,
1415
+                             320L,
1416
+                             350L,
1417
+                             351L,
1418
+                             399L,
1419
+                             412L,
1420
+                             532L],
1421
+          'sel-line': 944L,
1422
+          'sel-line-start': 48949L,
1423
+          'selection_end': 48949L,
1424
+          'selection_start': 48949L,
1425
+          'zoom': 0L},
1426
+         1530474479.645],
1427
+        [loc('sources/replay.py'),
1428
+         {'attrib-starts': [('Source',
1429
+                             31),
1430
+                            ('Source.get_streams',
1431
+                             220)],
1432
+          'first-line': 263L,
1433
+          'folded-linenos': [70L,
1434
+                             89L,
1435
+                             143L,
1436
+                             166L,
1437
+                             284L],
1438
+          'sel-line': 268L,
1439
+          'sel-line-start': 13506L,
1440
+          'selection_end': 13506L,
1441
+          'selection_start': 13506L,
1442
+          'zoom': 0L},
1443
+         1530474598.565],
1444
+        [loc('sources/replay.py'),
1445
+         {'attrib-starts': [('Source',
1446
+                             31),
1447
+                            ('Source.get_streams',
1448
+                             220)],
1449
+          'first-line': 353L,
1450
+          'folded-linenos': [70L,
1451
+                             89L,
1452
+                             143L,
1453
+                             166L,
1454
+                             284L],
1455
+          'sel-line': 363L,
1456
+          'sel-line-start': 18452L,
1457
+          'selection_end': 18452L,
1458
+          'selection_start': 18452L,
1459
+          'zoom': 0L},
1460
+         1530474985.762],
1461
+        [loc('sources/SourceBase.py'),
1462
+         {'attrib-starts': [('SourceBase',
1463
+                             32),
1464
+                            ('SourceBase._http_request',
1465
+                             118)],
1466
+          'first-line': 120L,
1467
+          'folded-linenos': [],
1468
+          'sel-line': 128L,
1469
+          'sel-line-start': 4807L,
1470
+          'selection_end': 4807L,
1471
+          'selection_start': 4807L,
1472
+          'zoom': 0L},
1473
+         1530475063.84]],
1452
         20),
1474
         20),
1453
-        'current-loc': loc('sources/ltc.py'),
1475
+        'current-loc': loc('sources/replay.py'),
1454
         'editor-state-list': [(loc('run.py'),
1476
         'editor-state-list': [(loc('run.py'),
1455
                                {'attrib-starts': [('Main',
1477
                                {'attrib-starts': [('Main',
1456
         22),
1478
         22),
1505
         31),
1527
         31),
1506
         ('Source.get_streams',
1528
         ('Source.get_streams',
1507
          220)],
1529
          220)],
1508
-                                'first-line': 263L,
1530
+                                'first-line': 356L,
1509
                                 'folded-linenos': [70L,
1531
                                 'folded-linenos': [70L,
1510
         89L,
1532
         89L,
1511
         143L,
1533
         143L,
1512
         166L,
1534
         166L,
1513
         284L],
1535
         284L],
1514
-                                'sel-line': 268L,
1515
-                                'sel-line-start': 13506L,
1516
-                                'selection_end': 13506L,
1517
-                                'selection_start': 13506L,
1536
+                                'sel-line': 363L,
1537
+                                'sel-line-start': 18441L,
1538
+                                'selection_end': 18441L,
1539
+                                'selection_start': 18441L,
1518
                                 'zoom': 0L}),
1540
                                 'zoom': 0L}),
1519
                               (loc('sources/lmt.py'),
1541
                               (loc('sources/lmt.py'),
1520
                                {'attrib-starts': [('Source',
1542
                                {'attrib-starts': [('Source',
1581
                                 'sel-line-start': 7404L,
1603
                                 'sel-line-start': 7404L,
1582
                                 'selection_end': 7404L,
1604
                                 'selection_end': 7404L,
1583
                                 'selection_start': 7404L,
1605
                                 'selection_start': 7404L,
1606
+                                'zoom': 0L}),
1607
+                              (loc('sources/SourceBase.py'),
1608
+                               {'attrib-starts': [('SourceBase',
1609
+        32),
1610
+        ('SourceBase._http_request',
1611
+         118)],
1612
+                                'first-line': 120L,
1613
+                                'folded-linenos': [],
1614
+                                'sel-line': 128L,
1615
+                                'sel-line-start': 4807L,
1616
+                                'selection_end': 4807L,
1617
+                                'selection_start': 4807L,
1584
                                 'zoom': 0L})],
1618
                                 'zoom': 0L})],
1585
-        'has-focus': True,
1619
+        'has-focus': False,
1586
         'locked': False},
1620
         'locked': False},
1587
         [loc('run.py'),
1621
         [loc('run.py'),
1588
          loc('util.py'),
1622
          loc('util.py'),
1593
          loc('sources/config.py'),
1627
          loc('sources/config.py'),
1594
          loc('changelog.md'),
1628
          loc('changelog.md'),
1595
          loc('sources/filmix.py'),
1629
          loc('sources/filmix.py'),
1596
-         loc('sources/filmas.py')]),
1630
+         loc('sources/filmas.py'),
1631
+         loc('sources/SourceBase.py')]),
1597
                                'open_files': [u'changelog.md',
1632
                                'open_files': [u'changelog.md',
1598
         u'run.py',
1633
         u'run.py',
1599
         u'sources/config.py',
1634
         u'sources/config.py',
1600
         u'sources/euronews.py',
1635
         u'sources/euronews.py',
1601
-        u'sources/lmt.py',
1602
-        u'util.py',
1603
         u'sources/filmas.py',
1636
         u'sources/filmas.py',
1604
-        u'sources/replay.py',
1605
         u'sources/filmix.py',
1637
         u'sources/filmix.py',
1606
-        u'sources/ltc.py']},
1638
+        u'sources/lmt.py',
1639
+        u'util.py',
1640
+        u'sources/ltc.py',
1641
+        u'sources/replay.py']},
1607
         'saved_notebook_display': None,
1642
         'saved_notebook_display': None,
1608
         'split_percents': {0: 0.47474747474747475},
1643
         'split_percents': {0: 0.47474747474747475},
1609
         'splits': 2,
1644
         'splits': 2,
1618
                          91,
1653
                          91,
1619
                          2455,
1654
                          2455,
1620
                          1462)}]}
1655
                          1462)}]}
1621
-guimgr.recent-documents = [loc('sources/ltc.py'),
1656
+guimgr.recent-documents = [loc('sources/replay.py'),
1657
+                           loc('sources/SourceBase.py'),
1658
+                           loc('sources/ltc.py'),
1659
+                           loc('util.py'),
1622
                            loc('sources/filmix.py'),
1660
                            loc('sources/filmix.py'),
1623
-                           loc('sources/replay.py'),
1624
                            loc('sources/filmas.py'),
1661
                            loc('sources/filmas.py'),
1625
-                           loc('util.py'),
1626
                            loc('run.py'),
1662
                            loc('run.py'),
1627
                            loc('sources/lmt.py'),
1663
                            loc('sources/lmt.py'),
1628
                            loc('changelog.md'),
1664
                            loc('changelog.md'),

+ 3
- 1
sources/replay.py View File

359
                 m = re.search('<div class="video-player">.+?<iframe src="([^"]+)', r2, re.DOTALL)
359
                 m = re.search('<div class="video-player">.+?<iframe src="([^"]+)', r2, re.DOTALL)
360
                 if not m:
360
                 if not m:
361
                     raise Exception("No stream found")
361
                     raise Exception("No stream found")
362
-                url3 = "https:" + m.group(1)
362
+                url3 = m.group(1)
363
                 headers["Referer"] = url2
363
                 headers["Referer"] = url2
364
                 r3 = self._http_request(url3, headers=headers)
364
                 r3 = self._http_request(url3, headers=headers)
365
+                if not r3:
366
+                    raise Exception("No stream found")
365
                 m = re.search(r"src: '([^']+)',\s+?type: 'application/x-mpegurl'", r3, re.DOTALL)
367
                 m = re.search(r"src: '([^']+)',\s+?type: 'application/x-mpegurl'", r3, re.DOTALL)
366
                 if not m:
368
                 if not m:
367
                     raise Exception("No stream found")
369
                     raise Exception("No stream found")