소스 검색

izlabots context_menu

Ivars 7 년 전
부모
커밋
cc74a1290e
9개의 변경된 파일98개의 추가작업 그리고 50개의 파일을 삭제
  1. 11
    2
      addon.py
  2. 1
    1
      addon.xml
  3. 5
    2
      changelog.md
  4. 34
    0
      context_menu.py
  5. 27
    28
      project.wpr
  6. 15
    14
      readme.md
  7. BIN
      release/plugin.video.playstream-0.1.26.zip
  8. 4
    2
      resources/lib/sources/config.py
  9. 1
    1
      version.txt

+ 11
- 2
addon.py 파일 보기

@@ -20,6 +20,7 @@ for source in sources.plugins:
20 20
     sources.plugins[source].options_write(options)
21 21
 prefix = ""
22 22
 
23
+
23 24
 @plugin.route(".+" )
24 25
 def main():
25 26
     global prefix
@@ -27,6 +28,7 @@ def main():
27 28
     plugin.set_content("movies")
28 29
     data = plugin.request.url.replace(prefix,"")
29 30
     data = urllib.unquote(data)
31
+    sources.plugins["config"].read_streams()
30 32
     if not data:
31 33
         data = "config::home"
32 34
     if sources.is_video(data):
@@ -66,8 +68,15 @@ def get_list(data):
66 68
         is_playable = True if  sources.is_video(item[1]) else False
67 69
         img = item[2]
68 70
         desc = item[3].decode("utf8")
69
-        context_menu = [("Add to PlayStream favorites",
70
-                         'RunScript(special://home/addons/%s/context_menu.py,"add","%s","%s","%s","%s")'%(plugin.id, title,  data2,img, desc))]
71
+        context_menu = [
72
+            ("Add to PlayStream favorites", 'RunScript(special://home/addons/%s/context_menu.py,"add","%s","%s","%s","%s")'%(plugin.id, title,  item[1],img, desc)),
73
+            ("Delete from PlayStream favorites",
74
+                 'RunScript(special://home/addons/%s/context_menu.py,"delete","%s","%s","%s","%s")' % (
75
+                 plugin.id, title, item[1], img, desc)),
76
+            ("Download",
77
+             'RunScript(special://home/addons/%s/context_menu.py,"download","%s","%s","%s","%s")' % (
78
+                 plugin.id, title, item[1], img, desc)),
79
+        ]
71 80
         items.append({
72 81
             "label": title,
73 82
             "path": data2,

+ 1
- 1
addon.xml 파일 보기

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
-<addon version="0.1.25" id="plugin.video.playstream" name="PlayStream" provider-name="ivars777"  >
2
+<addon version="0.1.26" id="plugin.video.playstream" name="PlayStream" provider-name="ivars777"  >
3 3
   <requires>
4 4
     <import addon="xbmc.python" version="2.1.0"/>
5 5
     <import addon="script.module.requests" />

+ 5
- 2
changelog.md 파일 보기

@@ -1,5 +1,8 @@
1
-**0.1.2** (12.02.2016):
2
-- initial exprerimental version
1
+**0.1.24** (23.03.2016):
2
+- subtitles, context menu etc added
3 3
 
4 4
 **0.1.5** (14.02.2016):
5 5
 - addon settings added
6
+
7
+**0.1.2** (12.02.2016):
8
+- initial exprerimental version

+ 34
- 0
context_menu.py 파일 보기

@@ -0,0 +1,34 @@
1
+import sys, os, os.path
2
+from kodiswift import xbmc, xbmcgui, CLI_MODE
3
+from  resources.lib.sources.config import Source
4
+
5
+cfg = Source()
6
+lists = cfg.get_lists()
7
+titles = [cfg.get_title(name) for name in lists]
8
+cmd = sys.argv[1]
9
+
10
+if cmd == "add":
11
+    if not CLI_MODE:
12
+        ret = xbmcgui.Dialog().select("Select menu",titles)
13
+    else:
14
+        ret = 3
15
+    title = sys.argv[2]
16
+    img = sys.argv[3]
17
+    desc = sys.argv[4]
18
+    cfg.add_item(lists[ret],sys.argv[2:])
19
+    cfg.write_streams()
20
+
21
+elif cmd == "delete":
22
+    xbmcgui.Dialog().ok("Info","Not yet implemented!")
23
+
24
+elif cmd == "download":
25
+    xbmcgui.Dialog().ok("Info","Not yet implemented!")
26
+
27
+else:
28
+    xbmcgui.Dialog().ok("Error","Wrong command")
29
+
30
+
31
+
32
+#mode = "a" if os.path.exists("context_menu.log") else "w"
33
+#with open("context_menu.log", mode) as f:
34
+#    f.write("%s %s %s %s", sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])

+ 27
- 28
project.wpr 파일 보기

@@ -221,7 +221,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
221 221
                                {'tree-state': {'file-sort-method': 'by name',
222 222
         'list-files-first': 0,
223 223
         'tree-states': {'deep': {'expanded-nodes': [],
224
-                                 'selected-nodes': [(13,)],
224
+                                 'selected-nodes': [(11,)],
225 225
                                  'top-node': (0,)}},
226 226
         'tree-style': 'deep'}}),
227 227
                               ('snippets',
@@ -665,7 +665,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
665 665
                                None)],
666 666
                  'primary_view_state': {'area': 'wide',
667 667
         'constraint': None,
668
-        'current_pages': [2,
668
+        'current_pages': [1,
669 669
                           1],
670 670
         'notebook_display': 'normal',
671 671
         'notebook_percent': 0.45990566037735847,
@@ -1040,14 +1040,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1040 1040
                                   'selection_end': 655L,
1041 1041
                                   'selection_start': 655L}),
1042 1042
                                 (loc('addon.py'),
1043
-                                 {'attrib-starts': [('get_list',
1044
-        58)],
1045
-                                  'first-line': 100L,
1043
+                                 {'attrib-starts': [],
1044
+                                  'first-line': 4L,
1046 1045
                                   'folded-linenos': [],
1047
-                                  'sel-line': 69L,
1048
-                                  'sel-line-start': 2614L,
1049
-                                  'selection_end': 2720L,
1050
-                                  'selection_start': 2720L}),
1046
+                                  'sel-line': 9L,
1047
+                                  'sel-line-start': 276L,
1048
+                                  'selection_end': 276L,
1049
+                                  'selection_start': 276L}),
1051 1050
                                 (loc('changelog.md'),
1052 1051
                                  {'attrib-starts': [],
1053 1052
                                   'first-line': 0L,
@@ -1447,7 +1446,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1447 1446
         u'resources/lib/sources/ustvnow.py',
1448 1447
         u'addon.py']},
1449 1448
         'saved_notebook_display': None,
1450
-        'split_percents': {0: 0.4442211055276382},
1449
+        'split_percents': {0: 0.7909547738693468},
1451 1450
         'splits': 2,
1452 1451
         'tab_location': 'top',
1453 1452
         'user_data': {}},
@@ -1868,6 +1867,24 @@ guimgr.visual-state = {loc('config.py'): {'attrib-starts': [],
1868 1867
         'sel-line-start': 12403,
1869 1868
         'selection_end': 12403,
1870 1869
         'selection_start': 12403},
1870
+                       loc('../../../../Python27/Lib/genericpath.py'): {'att'\
1871
+        'rib-starts': [('_splitext',
1872
+                        92)],
1873
+        'first-line': 99L,
1874
+        'folded-linenos': [],
1875
+        'sel-line': 109L,
1876
+        'sel-line-start': 3211L,
1877
+        'selection_end': 3211L,
1878
+        'selection_start': 3211L},
1879
+                       loc('../../../../Python27/Lib/ntpath.py'): {'attrib-s'\
1880
+        'tarts': [('splitext',
1881
+                   198)],
1882
+        'first-line': 182L,
1883
+        'folded-linenos': [],
1884
+        'sel-line': 199L,
1885
+        'sel-line-start': 7089L,
1886
+        'selection_end': 7089L,
1887
+        'selection_start': 7089L},
1871 1888
                        loc('../../../../Python27/Lib/site-packages/xbmcswift2/cli/app.py'): {'a'\
1872 1889
         'ttrib-starts': [('once',
1873 1890
                           146)],
@@ -1893,24 +1910,6 @@ guimgr.visual-state = {loc('config.py'): {'attrib-starts': [],
1893 1910
         'sel-line-start': 29,
1894 1911
         'selection_end': 36,
1895 1912
         'selection_start': 36},
1896
-                       loc('../../../../Python27/lib/genericpath.py'): {'att'\
1897
-        'rib-starts': [('_splitext',
1898
-                        92)],
1899
-        'first-line': 99L,
1900
-        'folded-linenos': [],
1901
-        'sel-line': 109L,
1902
-        'sel-line-start': 3211L,
1903
-        'selection_end': 3211L,
1904
-        'selection_start': 3211L},
1905
-                       loc('../../../../Python27/lib/ntpath.py'): {'attrib-s'\
1906
-        'tarts': [('splitext',
1907
-                   198)],
1908
-        'first-line': 182L,
1909
-        'folded-linenos': [],
1910
-        'sel-line': 199L,
1911
-        'sel-line-start': 7089L,
1912
-        'selection_end': 7089L,
1913
-        'selection_start': 7089L},
1914 1913
                        loc('../../../../Python27/lib/site-packages/kodiswift/listitem.py'): {'a'\
1915 1914
         'ttrib-starts': [('ListItem',
1916 1915
                           20),

+ 15
- 14
readme.md 파일 보기

@@ -5,20 +5,21 @@ Kodi plugin to to play various online streams (mostly Latvian).
5 5
 Stream sources are in  subfolder "resources/lib/sources", and can be added/customized
6 6
 Currently implemented:
7 7
 - Main menu and manual stream definition in sources/streams.cfg file
8
-- **replay.lsm.lv** media portal content (Latvian TV)
9
-- **skaties.lv** media portal content (MTG media portal Latvian version), other countries MTG contents are available through customizing main menu (country=xx)
10
-- **lattelecom.tv(shortcut.lv)** media portal content
11
-- **play24.lv** media portal content
12
-- **viaplay.lv**
13
-- **cinemalive.tv**
14
-- **movieplace.lv**
15
-- **dom.tv**
16
-- **BBC iPlayer**
17
-- **Euronews**
18
-- **filmon.tv** media portal content
19
-- **ustvnow.tv**
20
-- **serialguru.ru**
21
-- **filmix.net**
8
+- **replay.lsm.lv** - Latvian TV live streams and archive (Latvian)
9
+- **skaties.lv** - skaties.lv streams (Latvian LNT, TV3, TV3+, TV6, TV2)
10
+- **lattelecom.tv(shortcut.lv)** - live, archive and video (Latvian, English, Russian), account required
11
+- **play24.lv** - RigaTV24 live and archive (Latvian)
12
+- **viaplay.lv** - video streams (partly working, only non-DRM - Latvian, Russian)
13
+- **cinemalive.tv** - movies and series in Latvian (partly working)
14
+- **movieplace.lv** - movies and series in Latvian (partly working)
15
+- **dom.tv** - live and archive of Latvian and Russion TV channels, registration required
16
+- **BBC iPlayer** - BBC live and archive, UK IP address (VPN) required
17
+- **Euronews** - Euronews live and archive
18
+- **filmon.tv** - media portal content
19
+- **ustvnow.tv** - USA live TV (only SD), registration required
20
+- **filmix.net** - movies and series in Russian
21
+- **serialguru.ru** - movies and series in Russian (partly working)
22
+
22 23
 
23 24
 ---
24 25
 Copyright (c) 2016 ivars777 (ivars777@gmail.com)

BIN
release/plugin.video.playstream-0.1.26.zip 파일 보기


+ 4
- 2
resources/lib/sources/config.py 파일 보기

@@ -40,11 +40,13 @@ class Source(SourceBase):
40 40
                 self.lists[name] = []
41 41
             else:
42 42
                 if line[0] in ("#"): continue
43
-                items = tuple(line.strip().split("|"))
43
+                items = line.strip().split("|")
44 44
                 if not items[0]: continue
45 45
                 if len(items)==1:
46 46
                     self.titles[name] = items[0]
47 47
                 else:
48
+                    if len(items) == 4:
49
+                        items[3] = items[3].replace("\\n","\n")
48 50
                     self.lists[name].append(items)
49 51
 
50 52
     def write_streams(self):
@@ -52,7 +54,7 @@ class Source(SourceBase):
52 54
         for l in self.lists.keys():
53 55
             f.write("[%s]\n"%l)
54 56
             for item in self.lists[l]:
55
-                f.write("%s|%s|%s|%s\n"%(item[0],item[1],item[2],item[3]))
57
+                f.write("%s|%s|%s|%s\n"%(item[0].replace("\n",""),item[1],item[2],item[3].replace("\n","\\n")))
56 58
             f.write("\n")
57 59
         f.close()
58 60
 

+ 1
- 1
version.txt 파일 보기

@@ -1 +1 @@
1
-0.1.25
1
+0.1.26