Skip to content

Commit

Permalink
Display a specific message, when TVP server doesn't allow playing cha…
Browse files Browse the repository at this point in the history
…nnel
  • Loading branch information
thomas-ernest committed Sep 29, 2023
1 parent 56f9c33 commit 36c6356
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resources/lib/channels/pl/tvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ def _get_live_stream_url(live_id):
except Exception:
return None

live_stream_status = live_streams.get('status', None)
if live_stream_status is not None and live_stream_status != 'OK':
return live_stream_status

live_stream_url = None
if live_streams.get('formats', None) is not None:
for stream_format in live_streams.get('formats'):
Expand All @@ -165,5 +169,8 @@ def get_live_url(plugin, item_id, **kwargs):
if live_stream_url is None:
plugin.notify('INFO', plugin.localize(30716))
return False
if not live_stream_url.startswith('http'):
plugin.notify('INFO', plugin.localize(30891))
return False

return live_stream_url
1 change: 1 addition & 0 deletions resources/lib/channels/pl/tvpabc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'tvpabc2': 'https://krainaabc.tvp.pl/sess/TVPlayer2/api.php?@method=getTvpConfig&@callback=__anthill_jsonp_401__&corsHost=krainaabc.tvp.pl&id=57181933'
}


@Resolver.register
def get_live_url(plugin, item_id, **kwargs):
resp = urlquick.get(URL_LIVE[item_id],
Expand Down

0 comments on commit 36c6356

Please sign in to comment.