Skip to content

Commit

Permalink
Don't error on geoblocked content (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts authored Sep 18, 2019
1 parent d4776a2 commit ab4edab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions resources/lib/vtmgostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __init__(self):
def get_stream(self, stream_type, stream_id):
# We begin with asking vtm about the stream info.
stream_info = self._get_stream_info(stream_type, stream_id)
if stream_info is None:
return None # No stream available (i.e. geo-blocked)

# Extract the anvato stream from our stream_info.
anvato_info = self._extract_anvato_stream_from_stream_info(stream_info)
Expand Down Expand Up @@ -136,6 +138,7 @@ def _get_stream_info(self, strtype, stream_id):
proxies=proxies)

if response.status_code == 403:
logger.error('Error %s in _get_stream_info.', response.status_code)
show_ok_dialog(heading='HTTP 403 Forbidden', message=localize(30704)) # Geo-blocked
return None
if response.status_code != 200:
Expand Down
2 changes: 0 additions & 2 deletions test/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from __future__ import absolute_import, division, print_function, unicode_literals

import os
import unittest
from resources.lib import plugin

Expand Down Expand Up @@ -105,7 +104,6 @@ def test_tvguide_menu(self):
self.assertEqual(addon.url_for(plugin.show_tvguide_detail, channel='vtm', date='today'), 'plugin://plugin.video.vtm.go/tvguide/vtm/today')

# Play Live TV: '/play/livetv/<channel>'
@unittest.skipIf(os.environ.get('TRAVIS') == 'true', 'Skipping this test on Travis CI.')
def test_play_livetv(self):
plugin.run(['plugin://plugin.video.vtm.go/play/livetv/ea826456-6b19-4612-8969-864d1c818347?.pvr', '0', ''])
self.assertEqual(
Expand Down

0 comments on commit ab4edab

Please sign in to comment.