Skip to content

Commit 8377661

Browse files
authored
Merge pull request #4699 from rickeylohia/plugin.video.stalkervod.v1.2.0
[plugin.video.stalkervod] v1.2.0
2 parents 18eb6c1 + 265f739 commit 8377661

File tree

8 files changed

+129
-66
lines changed

8 files changed

+129
-66
lines changed

plugin.video.stalkervod/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ Ability to use Portal Favorite option for both VOD and TV Channels
88
Add support for UpNext addon.
99

1010
v1.1.0 (2025-07-26)
11-
- Add search to directory listing for TV and VOD
11+
- Add search to directory listing for TV and VOD
12+
13+
v1.2.0 (2025-08-06)
14+
- Fix TV stream issue for portal with use_http_tmp_link and use_load_balancing as false

plugin.video.stalkervod/addon.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.stalkervod" name="Stalker VOD Client" version="1.1.0" provider-name="rickey">
2+
<addon id="plugin.video.stalkervod" name="Stalker VOD Client" version="1.2.0" provider-name="rickey">
33
<requires>
44
<import addon="xbmc.python" version="3.0.1"/>
55
<import addon="script.module.requests" version="2.27.1"/>
@@ -33,6 +33,9 @@ Add support for UpNext addon.
3333

3434
v1.1.0 (2025-07-26)
3535
- Add search to directory listing for TV and VOD
36+
37+
v1.2.0 (2025-08-06)
38+
- Fix TV stream issue for portal with use_http_tmp_link and use_load_balancing as false
3639
</news>
3740
</extension>
3841
</addon>

plugin.video.stalkervod/lib/addon.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ def __play_video(params):
4646
xbmcplugin.setResolvedUrl(G.get_handle(), True, listitem=play_item)
4747

4848
@staticmethod
49-
def __play_tv(cmd):
49+
def __play_tv(params):
5050
"""Play TV Channel"""
51-
Logger.debug('Play TV {}'.format(cmd))
52-
stream_url = Api.get_tv_stream_url(cmd)
51+
Logger.debug('Play TV {}'.format(params))
52+
stream_url = Api.get_tv_stream_url(params)
5353
play_item = xbmcgui.ListItem(path=stream_url)
5454
xbmcplugin.setResolvedUrl(G.get_handle(), True, listitem=play_item)
5555

5656
@staticmethod
5757
def __list_tv_genres():
58-
"""List TV channel genres"""
58+
"""List the TV channel genres"""
5959
Logger.debug('List TV Genres')
6060
xbmcplugin.setPluginCategory(G.get_handle(), 'TV CHANNELS')
6161
xbmcplugin.setContent(G.get_handle(), 'videos')
6262
list_item = xbmcgui.ListItem(label='TV FAVORITES')
6363
url = G.get_plugin_url({'action': 'tv_favorites', 'page': 1, 'update_listing': False})
6464
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
6565

66-
# Add search option
67-
list_item = xbmcgui.ListItem(label='SEARCH')
66+
# Add a search option
67+
list_item = xbmcgui.ListItem(label='TV SEARCH')
6868
list_item.setArt({'thumb': G.get_custom_thumb_path('search.png')})
6969
url = G.get_plugin_url({'action': 'tv_search', 'fav': 0, 'isContextMenuSearch': False})
7070
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
@@ -93,8 +93,8 @@ def __list_vod_categories():
9393
url = G.get_plugin_url({'action': 'vod_favorites', 'page': 1, 'update_listing': False})
9494
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
9595

96-
# Add search option
97-
list_item = xbmcgui.ListItem(label='SEARCH')
96+
# Add a search option
97+
list_item = xbmcgui.ListItem(label='VOD SEARCH')
9898
list_item.setArt({'thumb': G.get_custom_thumb_path('search.png')})
9999
url = G.get_plugin_url({'action': 'vod_search', 'fav': 0, 'isContextMenuSearch': False})
100100
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
@@ -122,8 +122,8 @@ def __list_series_categories():
122122
url = G.get_plugin_url({'action': 'series_favorites', 'page': 1, 'update_listing': False})
123123
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
124124

125-
# Add search option
126-
list_item = xbmcgui.ListItem(label='SEARCH')
125+
# Add a search option
126+
list_item = xbmcgui.ListItem(label='SERIES SEARCH')
127127
list_item.setArt({'thumb': G.get_custom_thumb_path('search.png')})
128128
url = G.get_plugin_url({'action': 'series_search', 'fav': 0, 'isContextMenuSearch': False})
129129
xbmcplugin.addDirectoryItem(G.get_handle(), url, list_item, True)
@@ -142,7 +142,7 @@ def __list_series_categories():
142142

143143
@staticmethod
144144
def __list_channels(params):
145-
"""List TV Channels"""
145+
"""List the TV Channels"""
146146
Logger.debug('List Channels {}'.format(params))
147147
search_term = params.get('search_term', '')
148148
page = params['page']
@@ -173,7 +173,7 @@ def __create_tv_listing(videos, params):
173173
list_item.addContextMenuItems([('Add to favorites', f'RunPlugin({url}, False)')])
174174
if 'logo' in video:
175175
list_item.setArt({'icon': video['logo'], 'thumb': video['logo'], 'clearlogo': video['logo']})
176-
url = G.get_plugin_url({'action': 'tv_play', 'cmd': video['cmd']})
176+
url = G.get_plugin_url({'action': 'tv_play', 'cmd': video['cmd'], 'use_http_tmp_link': video.get('use_http_tmp_link', 0), 'use_load_balancing': video.get('use_load_balancing', 0)})
177177
directory_items.append((url, list_item, False))
178178
total_items = get_int_value(videos, 'total_items')
179179
if total_items > item_count:
@@ -446,10 +446,10 @@ def __search_vod(self, params):
446446
"""Search for videos"""
447447
Logger.debug('Search VOD {}'.format(params))
448448

449-
# If category is missing, show category selection popup
449+
# If the category is missing, show the category selection popup
450450
if not params.get('category'):
451451
categories = Api.get_vod_categories()
452-
selected_category = ask_for_category_selection(categories, 'VOD')
452+
selected_category = ask_for_category_selection(categories, 'VOD Category')
453453
if not selected_category:
454454
# User cancelled category selection - end directory properly
455455
xbmcplugin.endOfDirectory(G.get_handle(), succeeded=False, updateListing=False, cacheToDisc=False)
@@ -474,10 +474,10 @@ def __search_vod(self, params):
474474
def __search_series(params):
475475
"""Search for videos"""
476476

477-
# If category is missing, show category selection popup
477+
# If the category is missing, show the category selection popup
478478
if not params.get('category'):
479479
categories = Api.get_series_categories()
480-
selected_category = ask_for_category_selection(categories, 'Series')
480+
selected_category = ask_for_category_selection(categories, 'Series Category')
481481
if not selected_category:
482482
# User cancelled category selection - end directory properly
483483
xbmcplugin.endOfDirectory(G.get_handle(), succeeded=False, updateListing=False, cacheToDisc=False)
@@ -497,10 +497,10 @@ def __search_series(params):
497497
def __search_tv(self, params):
498498
"""Search for videos"""
499499

500-
# If category is missing, show category selection popup
500+
# If the category is missing, show the category selection popup
501501
if not params.get('category'):
502502
genres = Api.get_tv_genres()
503-
selected_genre = ask_for_category_selection(genres, 'TV')
503+
selected_genre = ask_for_category_selection(genres, 'TV Genre')
504504
if not selected_genre:
505505
# User cancelled category selection - end directory properly
506506
xbmcplugin.endOfDirectory(G.get_handle(), succeeded=False, updateListing=False, cacheToDisc=False)
@@ -569,7 +569,7 @@ def router(self, param_string):
569569
elif params['action'] == 'play':
570570
self.__play_video(params)
571571
elif params['action'] == 'tv_play':
572-
self.__play_tv(params['cmd'])
572+
self.__play_tv(params)
573573
elif params['action'] == 'vod_search':
574574
self.__search_vod(params)
575575
elif params['action'] == 'series_search':

plugin.video.stalkervod/lib/api.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .globals import G
1010
from .auth import Auth
1111
from .loggers import Logger
12+
from .utils import get_int_value
1213

1314

1415
class Api:
@@ -199,11 +200,14 @@ def __get_vod_stream_url_video_id(video_id, series):
199200
)
200201

201202
@staticmethod
202-
def get_tv_stream_url(cmd):
203+
def get_tv_stream_url(params):
203204
"""Get TV Channel stream url"""
204-
cmd = Api.__call_stalker_portal(
205-
{'type': 'itv', 'action': 'create_link', 'cmd': cmd}
206-
)['js']['cmd']
205+
if bool(get_int_value(params, 'use_http_tmp_link')) or bool(get_int_value(params, 'use_load_balancing')):
206+
cmd = Api.__call_stalker_portal(
207+
{'type': 'itv', 'action': 'create_link', 'cmd': params['cmd']}
208+
)['js']['cmd']
209+
else:
210+
cmd = params['cmd']
207211
if cmd.find(' ') != -1:
208212
cmd = cmd[(cmd.find(' ') + 1):]
209213
return cmd

plugin.video.stalkervod/lib/globals.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def init_globals(self):
5353
self.addon_config.url = sys.argv[0]
5454
if self.__is_addd_on_first_run:
5555
Logger.debug("First run, loading global variables")
56+
57+
# Initialize addon info
5658
self.addon_config.addon_id = self.__addon.getAddonInfo('id')
5759
self.addon_config.name = self.__addon.getAddonInfo('name')
5860
self.addon_config.addon_data_path = self.__addon.getAddonInfo('path')
@@ -61,6 +63,8 @@ def init_globals(self):
6163
xbmcvfs.mkdirs(token_path)
6264
self.addon_config.token_path = token_path
6365
self.addon_config.handle = int(sys.argv[1])
66+
67+
# Init Portal settings
6468
self.portal_config.mac_cookie = 'mac=' + self.__addon.getSetting('mac_address')
6569
self.portal_config.device_id = self.__addon.getSetting('device_id')
6670
self.portal_config.device_id_2 = self.__addon.getSetting('device_id_2')

plugin.video.stalkervod/lib/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def ask_for_category_selection(categories, content_type):
2323

2424
category_titles = [category['title'] for category in categories]
2525
dialog = xbmcgui.Dialog()
26-
selected_index = dialog.select(f'Select {content_type} Category', category_titles)
26+
selected_index = dialog.select(f'Select {content_type}', category_titles)
2727

2828
if selected_index >= 0:
2929
return categories[selected_index]
@@ -78,7 +78,7 @@ def jsonrpc(**kwargs):
7878

7979

8080
def to_unicode(text, encoding='utf-8', errors='strict'):
81-
"""Force text to unicode"""
81+
"""Force text to Unicode"""
8282
if isinstance(text, bytes):
8383
return text.decode(encoding, errors=errors)
8484
return text

plugin.video.stalkervod/resources/language/resource.language.en_gb/strings.po

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,48 @@ msgstr ""
1818

1919
msgctxt "#32001"
2020
msgid "Portal"
21-
msgstr ""
21+
msgstr "Portal"
2222

2323
msgctxt "#32002"
2424
msgid "Server Address (ex. http://xyz:888/c/ or http://xyz:888/stalker_portal/c/)"
25-
msgstr ""
25+
msgstr "Server Address (ex. http://xyz:888/c/ or http://xyz:888/stalker_portal/c/)"
2626

2727
msgctxt "#32003"
2828
msgid "Server"
29-
msgstr ""
29+
msgstr "Server"
3030

3131
msgctxt "#32004"
32-
msgid "Client"
33-
msgstr ""
32+
msgid "Server default context path /server/load.php"
33+
msgstr "Server default context path /server/load.php"
3434

3535
msgctxt "#32005"
36-
msgid "MAC Address"
37-
msgstr ""
36+
msgid "Use /portal.php as context path"
37+
msgstr "Use /portal.php as context path"
3838

3939
msgctxt "#32006"
40-
msgid "Advanced"
41-
msgstr ""
40+
msgid "Client"
41+
msgstr "Client"
4242

4343
msgctxt "#32007"
44-
msgid "Serial Number"
45-
msgstr ""
44+
msgid "MAC Address"
45+
msgstr "MAC Address"
4646

4747
msgctxt "#32008"
48-
msgid "Device ID"
49-
msgstr ""
48+
msgid "Advanced"
49+
msgstr "Advanced"
5050

5151
msgctxt "#32009"
52-
msgid "Device ID 2"
53-
msgstr ""
52+
msgid "Serial Number"
53+
msgstr "Serial Number"
5454

5555
msgctxt "#32010"
56-
msgid "Signature"
57-
msgstr ""
56+
msgid "Device ID"
57+
msgstr "Device ID"
5858

5959
msgctxt "#32011"
60-
msgid "Server default context path /server/load.php"
61-
msgstr ""
60+
msgid "Device ID 2"
61+
msgstr "Device ID 2"
6262

6363
msgctxt "#32012"
64-
msgid "Use /portal.php as context path"
65-
msgstr ""
64+
msgid "Signature"
65+
msgstr "Signature"
Lines changed: 67 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,68 @@
11
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2-
<settings>
3-
<category label="32001">
4-
<setting label="32002" type="lsep"/>
5-
<setting label="32003" type="text" id="server_address" default=""/>
6-
<setting type="sep"/>
7-
<setting label="32011" type="lsep"/>
8-
<setting label="32012" type="bool" id="alternative_context_path" default="false"/>
9-
<setting type="sep"/>
10-
<setting label="32004" type="lsep"/>
11-
<setting label="32005" type="text" id="mac_address" default=""/>
12-
<setting type="sep"/>
13-
<setting label="32006" type="lsep"/>
14-
<setting label="32007" type="text" id="serial_number" default=""/>
15-
<setting label="32008" type="text" id="device_id" default=""/>
16-
<setting label="32009" type="text" id="device_id_2" default=""/>
17-
<setting label="32010" type="text" id="signature" default=""/>
18-
</category>
19-
</settings>
2+
<settings version="1">
3+
<section id="plugin.video.stalkervod">
4+
<category id="portal" label="32001" help="">
5+
<group id="server" label="32002">
6+
<setting id="server_address" type="string" label="32003" help="">
7+
<level>0</level>
8+
<constraints>
9+
<allowempty>true</allowempty>
10+
</constraints>
11+
<control type="edit" format="string" />
12+
</setting>
13+
</group>
14+
15+
<group id="context" label="32004">
16+
<setting id="alternative_context_path" type="boolean" label="32005" help="">
17+
<level>0</level>
18+
<default>false</default>
19+
<control type="toggle" />
20+
</setting>
21+
</group>
22+
23+
<group id="device_info" label="32006">
24+
<setting id="mac_address" type="string" label="32007" help="">
25+
<level>0</level>
26+
<constraints>
27+
<allowempty>true</allowempty>
28+
</constraints>
29+
<control type="edit" format="string" />
30+
</setting>
31+
</group>
32+
33+
<group id="device_ids" label="32008">
34+
<setting id="serial_number" type="string" label="32009" help="">
35+
<level>0</level>
36+
<constraints>
37+
<allowempty>true</allowempty>
38+
</constraints>
39+
<control type="edit" format="string" />
40+
</setting>
41+
42+
<setting id="device_id" type="string" label="32010" help="">
43+
<level>0</level>
44+
<constraints>
45+
<allowempty>true</allowempty>
46+
</constraints>
47+
<control type="edit" format="string" />
48+
</setting>
49+
50+
<setting id="device_id_2" type="string" label="32011" help="">
51+
<level>0</level>
52+
<constraints>
53+
<allowempty>true</allowempty>
54+
</constraints>
55+
<control type="edit" format="string" />
56+
</setting>
57+
58+
<setting id="signature" type="string" label="32012" help="">
59+
<level>0</level>
60+
<constraints>
61+
<allowempty>true</allowempty>
62+
</constraints>
63+
<control type="edit" format="string" />
64+
</setting>
65+
</group>
66+
</category>
67+
</section>
68+
</settings>

0 commit comments

Comments
 (0)