Skip to content

Commit

Permalink
[BO - TVUMSA] Add channel
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygilles authored and joaopa00 committed May 9, 2024
1 parent 8326f30 commit d27dbf4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
31 changes: 31 additions & 0 deletions resources/lib/channels/bo/tvumsa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2024, JimmyGilles
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)

# This file is part of Catch-up TV & More

from __future__ import unicode_literals

import re

import urlquick
# noinspection PyUnresolvedReferences
from codequick import Resolver, Route
# noinspection PyUnresolvedReferences
from codequick.utils import urljoin_partial

from resources.lib import resolver_proxy, web_utils

URL_ROOT = 'https://tvu.umsa.bo/'
url_constructor = urljoin_partial(URL_ROOT)
URL_LIVE = url_constructor('en-vivo')

GENERIC_HEADERS = {"User-Agent": web_utils.get_random_ua()}


@Resolver.register
def get_live_url(plugin, item_id, **kwargs):
resp = urlquick.get(URL_LIVE, headers=GENERIC_HEADERS, max_age=-1)
video_url = re.compile(r'file\:\"(.*?)\"').findall(resp.text)[0]

return resolver_proxy.get_stream_with_quality(plugin, video_url=video_url)
9 changes: 9 additions & 0 deletions resources/lib/skeletons/bo_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,13 @@
'enabled': True,
'order': 3
},
'tvumsa': {
'resolver': '/resources/lib/channels/bo/tvumsa:get_live_url',
'label': 'TVU La Paz',
'thumb': 'channels/bo/tvumsa.png',
'fanart': 'channels/bo/tvumsa_fanart.png',
'm3u_group': 'Bolivia',
'enabled': True,
'order': 4
}
}

0 comments on commit d27dbf4

Please sign in to comment.