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,18 +822,18 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
822 822
         'top-node': [('generic attribute',
823 823
                       loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
824 824
                       'ADAPTIVE')]},
825
-        loc('unknown:<untitled> #6'): {'column-widths': [1.0],
825
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
826 826
                                        'expanded-nodes': [],
827 827
                                        'selected-nodes': [],
828 828
                                        'top-node': None},
829
-        loc('unknown:<untitled> #3'): {'expanded-nodes': [],
829
+        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
830 830
                                        'selected-nodes': [],
831 831
                                        'top-node': None},
832
-        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
833
-                                       'expanded-nodes': [],
832
+        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
834 833
                                        'selected-nodes': [],
835 834
                                        'top-node': None},
836
-        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
835
+        loc('unknown:<untitled> #5'): {'column-widths': [1.0],
836
+                                       'expanded-nodes': [],
837 837
                                        'selected-nodes': [],
838 838
                                        'top-node': None}},
839 839
                                 'browse_mode': u'Current Module',
@@ -970,18 +970,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
970 970
         -1,
971 971
         -1),
972 972
                        'attrib-starts': [],
973
-                       'first-line': 10L,
973
+                       'first-line': 21L,
974 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 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 987
                        'zoom': 0L}),
986 988
                      ('debug-watch',
987 989
                       'wide',
@@ -1034,66 +1036,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1034 1036
                             31),
1035 1037
                            ('Source.get_content',
1036 1038
                             56)],
1037
-         'first-line': 133L,
1039
+         'first-line': 146L,
1038 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 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 1047
         [loc('sources/filmix.py'),
1098 1048
          {'attrib-starts': [('Source',
1099 1049
                              31),
@@ -1448,9 +1398,81 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1448 1398
           'selection_end': 26927L,
1449 1399
           'selection_start': 26926L,
1450 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 1474
         20),
1453
-        'current-loc': loc('sources/ltc.py'),
1475
+        'current-loc': loc('sources/replay.py'),
1454 1476
         'editor-state-list': [(loc('run.py'),
1455 1477
                                {'attrib-starts': [('Main',
1456 1478
         22),
@@ -1505,16 +1527,16 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1505 1527
         31),
1506 1528
         ('Source.get_streams',
1507 1529
          220)],
1508
-                                'first-line': 263L,
1530
+                                'first-line': 356L,
1509 1531
                                 'folded-linenos': [70L,
1510 1532
         89L,
1511 1533
         143L,
1512 1534
         166L,
1513 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 1540
                                 'zoom': 0L}),
1519 1541
                               (loc('sources/lmt.py'),
1520 1542
                                {'attrib-starts': [('Source',
@@ -1581,8 +1603,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1581 1603
                                 'sel-line-start': 7404L,
1582 1604
                                 'selection_end': 7404L,
1583 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 1618
                                 'zoom': 0L})],
1585
-        'has-focus': True,
1619
+        'has-focus': False,
1586 1620
         'locked': False},
1587 1621
         [loc('run.py'),
1588 1622
          loc('util.py'),
@@ -1593,17 +1627,18 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1593 1627
          loc('sources/config.py'),
1594 1628
          loc('changelog.md'),
1595 1629
          loc('sources/filmix.py'),
1596
-         loc('sources/filmas.py')]),
1630
+         loc('sources/filmas.py'),
1631
+         loc('sources/SourceBase.py')]),
1597 1632
                                'open_files': [u'changelog.md',
1598 1633
         u'run.py',
1599 1634
         u'sources/config.py',
1600 1635
         u'sources/euronews.py',
1601
-        u'sources/lmt.py',
1602
-        u'util.py',
1603 1636
         u'sources/filmas.py',
1604
-        u'sources/replay.py',
1605 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 1642
         'saved_notebook_display': None,
1608 1643
         'split_percents': {0: 0.47474747474747475},
1609 1644
         'splits': 2,
@@ -1618,11 +1653,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1618 1653
                          91,
1619 1654
                          2455,
1620 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 1660
                            loc('sources/filmix.py'),
1623
-                           loc('sources/replay.py'),
1624 1661
                            loc('sources/filmas.py'),
1625
-                           loc('util.py'),
1626 1662
                            loc('run.py'),
1627 1663
                            loc('sources/lmt.py'),
1628 1664
                            loc('changelog.md'),

+ 3
- 1
sources/replay.py View File

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