Bump to v1.4.2

Fix subscription and category videos
master v1.4.2
azzy9 11 months ago
parent 1562203b69
commit 95136f7584

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.rumble" name="Rumble" version="1.4.1" provider-name="azzy9">
<addon id="plugin.video.rumble" name="Rumble" version="1.4.2" provider-name="azzy9">
<requires>
<import addon="script.module.simplejson"/>
<import addon="script.module.requests"/>
@ -21,7 +21,8 @@
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
<news>- v1.4.1 - Fix category videos
<news>- v1.4.2 - Fix subscription and category videos
- v1.4.1 - Fix category videos
- v1.4.0 - Add functionality to see comments if logged in</news>
</extension>
</addon>

@ -28,7 +28,6 @@ requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
reqs = requests.session()
def request_get( url, data=None, extra_headers=None ):
""" makes a request """
@ -38,7 +37,7 @@ def request_get( url, data=None, extra_headers=None ):
# headers
my_headers = {
'Accept-Language': 'en-gb,en;q=0.5',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Referer': url,
'Cache-Control': 'no-cache',
@ -94,9 +93,9 @@ def build_url(query):
}))
def notify( message, name=False, iconimage=False, timeShown=5000 ):
def notify( message, name=False, iconimage=False, time_shown=5000 ):
""" Show notfication to user """
""" Show notification to user """
if not name:
name = ADDON_NAME
@ -104,7 +103,7 @@ def notify( message, name=False, iconimage=False, timeShown=5000 ):
if not iconimage:
iconimage = ADDON_ICON
xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (name, message, timeShown, iconimage))
xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (name, message, time_shown, iconimage))
def view_set( name ):
@ -134,8 +133,7 @@ def get_string( string_id ):
if string_id >= 30000:
return __language__( string_id )
else:
return xbmc.getLocalizedString( string_id )
return xbmc.getLocalizedString( string_id )
def get_date_formatted( format_id, year, month, day ):
@ -145,8 +143,7 @@ def get_date_formatted( format_id, year, month, day ):
return month + '/' + day + '/' + year
if format_id == '2':
return day + '/' + month + '/' + year
else:
return year + '/' + month + '/' + day
return year + '/' + month + '/' + day
def get_params():

@ -6,6 +6,8 @@ This is a class to generate hashes that is used by the Rumble platform
class MD5Ex:
""" MD5Ex class to create MD5 hashes """
hex = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]
def bit_shift( self, val1, val2, direction = 'r', zero_fill = False ):
@ -30,18 +32,33 @@ class MD5Ex:
return 0
def hash( self, n ):
""" hash method """
return self.binHex( self.binHash( self.strBin(n), len(n) << 3))
def hashUTF8( self, n ):
""" hashUTF8 method """
return self.hash(self.encUTF8(n))
def hashRaw( self, n ):
""" hashRaw method """
return self.binStr(self.binHash(self.strBin(n), len(n) << 3))
def hashRawUTF8( self, n ):
""" hashRawUTF8 method """
return self.hashRaw(self.encUTF8(n))
def hashStretch( self, n, h, i ):
""" hashStretch method """
return self.binHex(self.binHashStretch(n, h, i))
def binHashStretch( self, n, h, i ):

@ -116,28 +116,28 @@ def home_menu():
if RUMBLE_USER.has_login_details():
# subscriptions
add_dir( 'Subscriptions', BASE_URL + '/subscriptions', 3, MEDIA_DIR + 'favorite.png', '', '', 'other' )
add_dir( 'Subscriptions', BASE_URL + '/subscriptions', 3, MEDIA_DIR + 'favorite.png', '', '', 'subscriptions' )
# subscriptions
add_dir( 'Following', BASE_URL + '/', 3, MEDIA_DIR + 'favorite.png', '', '', 'following' )
# News
add_dir( get_string(29916), BASE_URL + '/category/news/recorded', 3, MEDIA_DIR + 'news.png', '', '', 'other' )
add_dir( get_string(29916), BASE_URL + '/category/news/recorded', 3, MEDIA_DIR + 'news.png', '', '', 'cat_video' )
# Viral
add_dir( get_string(30050), BASE_URL + '/category/viral/recorded', 3, MEDIA_DIR + 'viral.png', '', '', 'other' )
add_dir( get_string(30050), BASE_URL + '/category/viral/recorded', 3, MEDIA_DIR + 'viral.png', '', '', 'cat_video' )
# Podcasts
add_dir( get_string(30051), BASE_URL + '/category/podcasts/recorded', 3, MEDIA_DIR +'podcast.png','','','other')
add_dir( get_string(30051), BASE_URL + '/category/podcasts/recorded', 3, MEDIA_DIR +'podcast.png','','','cat_video')
# Battle Leaderboard
add_dir( get_string(30052), BASE_URL + '/battle-leaderboard/recorded', 3, MEDIA_DIR + 'leader.png', '', '', 'top' )
# Entertainment
add_dir( get_string(30053), BASE_URL + '/category/entertainment/recorded', 3, MEDIA_DIR + 'entertaiment.png', '', '', 'other' )
add_dir( get_string(30053), BASE_URL + '/category/entertainment/recorded', 3, MEDIA_DIR + 'entertaiment.png', '', '', 'cat_video' )
# Sports
add_dir( get_string(19548), BASE_URL + '/category/sports/recorded', 3, MEDIA_DIR + 'sports.png', '', '', 'other' )
add_dir( get_string(19548), BASE_URL + '/category/sports/recorded', 3, MEDIA_DIR + 'sports.png', '', '', 'cat_video' )
# Science
add_dir( get_string(29948), BASE_URL + '/category/science/recorded', 3, MEDIA_DIR + 'science.png', '', '', 'other' )
add_dir( get_string(29948), BASE_URL + '/category/science/recorded', 3, MEDIA_DIR + 'science.png', '', '', 'cat_video' )
# Technology
add_dir( get_string(30054), BASE_URL + '/category/technology/recorded', 3, MEDIA_DIR + 'technology.png', '', '', 'other' )
add_dir( get_string(30054), BASE_URL + '/category/technology/recorded', 3, MEDIA_DIR + 'technology.png', '', '', 'cat_video' )
# Vlogs
add_dir( get_string(30055), BASE_URL + '/category/vlogs/recorded', 3, MEDIA_DIR + 'vlog.png', '', '', 'other' )
add_dir( get_string(30055), BASE_URL + '/category/vlogs/recorded', 3, MEDIA_DIR + 'vlog.png', '', '', 'cat_video' )
# Settings
add_dir( get_string(5), '', 8, MEDIA_DIR + 'settings.png', '', '', '' )
@ -221,6 +221,8 @@ def get_image( data, image_id ):
def list_rumble( url, cat ):
""" Method to get and display items from Rumble """
amount = 0
headers = None
@ -228,7 +230,6 @@ def list_rumble( url, cat ):
# make sure there is a session
# result is stored in a cookie
RUMBLE_USER.has_session()
#{ 'cookie': 'u_s=' + ADDON.getSetting('session')}
data = request_get(url, None, headers)
@ -237,9 +238,9 @@ def list_rumble( url, cat ):
amount = dir_list_create( data, cat, 'video', True, 1 )
else:
amount = dir_list_create( data, cat, 'channel', True )
elif cat in { 'other' }:
elif cat in { 'cat_video' }:
amount = dir_list_create( data, cat, 'cat_video', False, 2 )
elif cat in { 'channel', 'user', 'top' }:
elif cat in { 'subscriptions', 'channel', 'user', 'top', 'other' }:
amount = dir_list_create( data, cat, 'video', False, 2 )
elif cat == 'following':
amount = dir_list_create( data, cat, 'following', False, 2 )
@ -265,8 +266,8 @@ def dir_list_create( data, cat, video_type='video', search = False, play=False )
#open get url and open player
add_dir( video_title, BASE_URL + link, 4, str(img), str(img), '', cat, False, True, play, { 'name' : channel_link, 'subscribe': True } )
if video_type == 'cat_video':
videos = re.compile(r'<a\s*class=\"videostream__link link\"\s*href=(.+?)>\s*<div class=\"videostream__thumb\">\s*<img\s*class=\"videostream__image\"\s*src=(.+?)alt=\"([^\"]+)\"\s*(?:[^\>]+)>\s*<div class=\"videostream__info\">\s*<div class=\"videostream__views\">\s*<img (?:[^\>]+)>\s*<span class=\"videostream__number\">([^\<]+)</span>\s*</div>\s*<div class=\"videostream__status\">([^\<]+)</div>\s*</div>\s*</div>\s*<h3 class=\"videostream__title clamp clamp-2\">([^\<]+)</h3>\s*<address class=\"channel\">\s*<a\s*rel=\"author\"\s*class=\"channel__link link ([^\"]+)\"\s*href=([^\>]+)>\s*<img\s*class=\"channel__avatar\"\s*src=\"([^\"]+)\"\s*alt\=([^\>]+)>', re.MULTILINE|re.DOTALL|re.IGNORECASE).findall(data)
elif video_type == 'cat_video':
videos = re.compile(r'<a\s*class=\"videostream__link link\"\s*href=(.+?)>\s*<div class=\"videostream__thumb\">\s*<img\s*class=\"videostream__image\"\s*src=(.+?)alt=\"([^\"]+)\"\s*(?:[^\>]+)>\s*<div class=\"videostream__info\">\s*<div class=\"videostream__views\">\s*<img (?:[^\>]+)>\s*<span class=\"videostream__number\">([^\<]+)</span>\s*</div>\s*<div class=\"videostream__status videostream__status--duration\">([^\<]+)</div>\s*</div>\s*</div>\s*<h3 class=\"videostream__title clamp clamp-2\">([^\<]+)</h3>\s*<address class=\"channel\">\s*<a\s*rel=\"author\"\s*class=\"channel__link link ([^\"]+)\"\s*href=([^\>]+)>\s*<img\s*class=\"channel__avatar\"\s*src=\"([^\"]+)\"\s*alt\=([^\>]+)>', re.MULTILINE|re.DOTALL|re.IGNORECASE).findall(data)
if videos:
amount = len(videos)
for link, img, title, stream_count, stream_status, alt_title, img_id, channel_link, channel_img, channel_name in videos:
@ -579,11 +580,14 @@ def subscribe( name, action ):
return True
notify( 'Unable to to perform action' )
return False
def add_dir(name, url, mode, iconimage, fanart, description, cat, folder=True, fav_context=False, play=False, subscribe_context=False):
""" Adds directory items """
link_params = {
'url': url,
'mode': str( mode ),

Loading…
Cancel
Save