diff --git a/addons.xml b/addons.xml index 945c701..122c703 100644 --- a/addons.xml +++ b/addons.xml @@ -75,7 +75,7 @@ - + http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml.md5 @@ -974,29 +974,40 @@ ASN televises live games from multiple NCAA Division I college sports conference - + - video Stream the most captivating nature and wildlife documentaries and videos shot in stunning Ultra HD (4K) on Smithsonian Earth. - Smithsonian Earth is a commercial-free streaming site that offers unlimited access to nature and wildlife documentaries and videos shot in stunning 4K UHD resolution. Refreshed weekly, you'll never run out of things to discover. - + Smithsonian Earth is a commercial-free streaming site that offers unlimited access to nature and wildlife documentaries and videos shot in stunning 4K UHD resolution. Refreshed weekly, you'll never run out of things to discover. Subscription costs $3.99 per month with a 30 day free trial. + For support go to my github. No support without a full, unedited debug log. No support at TVAddons or any other forum. all GPL(v2) or Later - Login is broken - + https://smithsonianearthtv.com/ + v 2018.10.27[CR]- Update for 2018[CR]- Remove quality settings[CR]v 0.0.4[CR]- Fixes for website changes[CR]- Added infolabels[CR]v 0.0.3[CR]- Add quality option in settings[CR]v 0.0.2[CR]- Code cleanup[CR]v 0.0.1[CR]- Initial release + + icon.png + fanart.jpg + resources/media/screenshot001.png + resources/media/screenshot002.png + resources/media/screenshot003.png + resources/media/screenshot004.png + resources/media/screenshot005.png + resources/media/screenshot006.png + resources/media/screenshot007.png + resources/media/screenshot008.png + @@ -1044,6 +1055,7 @@ ASN televises live games from multiple NCAA Division I college sports conference Big South Sports Watch live and on demand events from the Big South Conference, a collegiate athletic conference affiliated with the NCAA's Division I. + The Big South website is no longer offering streaming events. diff --git a/addons.xml.md5 b/addons.xml.md5 index b494926..ada64cd 100644 --- a/addons.xml.md5 +++ b/addons.xml.md5 @@ -1 +1 @@ -4ed91f0ec7910f13f7532e3ec53cf852 \ No newline at end of file +b1bd0ff374c7e06c7b7823aab89c8da3 \ No newline at end of file diff --git a/plugin.video.smithsonian-earth/addon.py b/plugin.video.smithsonian-earth/addon.py index b8058c0..9684782 100644 --- a/plugin.video.smithsonian-earth/addon.py +++ b/plugin.video.smithsonian-earth/addon.py @@ -8,8 +8,7 @@ from bs4 import BeautifulSoup import mechanize import html5lib -import simplejson as json -#import Cookie +import json import cookielib cookiejar = cookielib.LWPCookieJar() @@ -28,7 +27,15 @@ password = settings.getSetting(id="password") addon = xbmcaddon.Addon(id="plugin.video.smithsonian-earth") addonname = addon.getAddonInfo('name') -views = settings.getSetting(id="views") +confluence_views = [500,501,503,504,515] +force_views = settings.getSetting(id="force_views") + +log_notice = settings.getSetting(id="log_notice") +if log_notice != 'false': + log_level = 2 +else: + log_level = 1 +xbmc.log('LOG_NOTICE: ' + str(log_notice),level=log_level) plugin = "Smithsonian Earth" @@ -38,12 +45,10 @@ baseurl = 'https://api.smithsonianearthtv.com:8443' addon_handle = int(sys.argv[1]) -confluence_views = [500,501,502,503,504,508,515] #630 def cats(): - #page = br.open('https://api.smithsonianearthtv.com:8443/channels/5DJZN6FN/responsives/categories/16617?5DJZN6FN').read() page = br.open('https://api.skychnl.net/channels/5DJZN6FN/responsives/categories/48456').read() cats = BeautifulSoup(page,'html5lib').find_all('option') for title in cats: @@ -53,10 +58,8 @@ def cats(): continue if '48459' in url: url = url.split('categories')[0] + 'get_next_category_page?id=48459&index=0' - mode = 635 + mode = 636 title = title.text - xbmc.log('TITLE: ' +str(title)) - xbmc.log('URL: ' +str(url)) addDir(title, url, mode, defaulticon, defaultfanart) xbmcplugin.endOfDirectory(addon_handle) @@ -70,6 +73,7 @@ def videos(url): image = 'http:' + (re.compile('image:url\\((.+?)\\)').findall(str(title)))[0]#.replace('.jpg','.background.atv4.jpg') url = 'https://api.skychnl.net' + (title.get('href'))# + 'token=' + str(cookie.value) title = title.find('h2').text.encode('utf-8').replace('&','&').strip() + #xbmc.log('TITLE: ' +str(title), level=log_level) addDir2(title, url, 634, defaultfanart, image, plot='') #xbmcplugin.setContent(addon_handle, content="videos") xbmcplugin.endOfDirectory(addon_handle) @@ -85,27 +89,42 @@ def series(name,url,iconimage): br['password'] = password logged_in = br.submit() check = logged_in.read() + device_id = re.compile(" device_id = '(.+?)'").findall(str(check)) + xbmc.log('DEVICE_ID: ' + str(device_id),level=log_level) dlsn = settings.getSetting(id="status") - if 'Log In' in check: - xbmcgui.Dialog().notification(plugin, 'Login Failed', defaultimage, 5000, False) - return - else: + if email in check: if dlsn=='false': xbmcgui.Dialog().notification(plugin, 'Login Successful', defaultimage, 2500, False) + else: + xbmcgui.Dialog().notification(plugin, 'Login Failed', defaultimage, 50000, False) + return page = br.open(url).read() for cookie in cookiejar: - xbmc.log('Cookie Name: ' + str(cookie.name)) - xbmc.log('Cookie Value: ' + str(cookie.value)) - xbmc.log('Cookie Domain: ' + str(cookie.domain)) + xbmc.log('Cookie Name: ' + str(cookie.name), level=log_level) + xbmc.log('Cookie Value: ' + str(cookie.value), level=log_level) + xbmc.log('Cookie Domain: ' + str(cookie.domain), level=log_level) url = url.replace('https://api.skychnl.net', baseurl) + '&' + cookie.name + '=' + cookie.value - xbmc.log('URL: ' + str(url)) + xbmc.log('URL: ' + str(url), level=log_level) page = br.open(url).read() - #soup = BeautifulSoup(page,'html5lib').find_all('a') - scripts = BeautifulSoup(page,'html5lib').find_all('script',{'type':'text/javascript'}) - #for script in scripts: - #print str(len(str(script))) - jsob = re.compile('episodesArray = (.+?);').findall(str(scripts[4]));i=0 - jdata = json.loads(jsob[0]) + scripts = BeautifulSoup(page,'html5lib').find_all('script',{'type':'text/javascript'});i=0 + for script in scripts: + i = i + 1 + if 'episodesArray' in str(script): + xbmc.log('### SEASON ###', level=log_level) + count = int(i - 1) + xbmc.log('COUNT: ' + str(i), level=log_level) + if len(str(scripts[count])) > 5000: + jsob = re.compile('episodesArray = (.+?);').findall(str(scripts[count])) + else: + xbmc.log('### SINGLE ###', level=log_level) + count = int(i - 1) + xbmc.log('COUNT: ' + str(i), level=log_level) + jsob = re.compile('new SCVideo\((.+?)\)').findall(str(scripts[count])) + image = BeautifulSoup(page,'html5lib').find('div',{'class':'thumb'}) + iconimage = 'https:' + image.find('img')['src'] + single(jsob,iconimage) + return + jdata = json.loads(jsob[0]);i=0 for title in jdata: title = jdata[i]['title'] image = jdata[i]['thumbnail']#.replace('.jpg','.spot.16_9.jpg') @@ -118,22 +137,35 @@ def series(name,url,iconimage): m3u8_url = jdata[i]['vtt'][0]['m3u8_url'] #subs_url = jdata[i]['vtt'][0]['url'] key = m3u8_url.split('/') - q = settings.getSetting(id='quality') - url = 'http://se-media.smithsonianchannel.com/5DJZN6FN/' + key[4] + '/hd/hls/v' + q + '_' + key[4] + '_clear/v' + q + '_' + key[4] + '_clear.m3u8' + url = 'https://se-media.smithsonianchannel.com/5DJZN6FN/' + key[4] + '/hd/hls/' + key[4] + '_clear.m3u8' li = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image) + #li.setSubtitles(subs_url) li.setProperty('fanart_image', defaultfanart) + li.setProperty('IsPlayable', 'true') li.setInfo(type="Video", infoLabels={"Title": title, "Plot": description, "Season": season, "Episode": ep, "Premiered": pubdate, "mpaa": rating}) - #li.setProperty('mimetype', 'video/mp4') li.addStreamInfo('video', { 'duration': duration }) - xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, totalItems=10) + xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, totalItems=10, isFolder=False) xbmcplugin.setContent(addon_handle, 'episodes');i=i+1 - if views != 'false': - xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[3])+")") + if force_views != 'false': + xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[int(settings.getSetting(id="views"))])+")") xbmcplugin.endOfDirectory(addon_handle) #635 -def single(url): +def single(jsob,iconimage): + jdata = json.loads(jsob[0])#;i=0 + for title in jdata: + title = jdata['title'] + description = jdata['description'] + duration = jdata['duration'] + rating = jdata['rating'] + pubdate = jdata['pubdate'] + url = jdata['html5_url'] + play(title,url,iconimage) + + +#636 +def nature(url): page = br.open(url).read() jdata = json.loads(page);i=0 for title in jdata['page']['category']['videos']: @@ -144,7 +176,7 @@ def single(url): rating = jdata['page']['category']['videos'][i]['video']['rating'] video_id = jdata['page']['category']['videos'][i]['video']['id'] url = 'https://api.smithsonianearthtv.com:8443/channels/5DJZN6FN/responsives/' + str(video_id) + '?index=0&locale=en' - purl = 'plugin://plugin.video.smithsonian-earth?mode=636&url=' + urllib.quote_plus(url) + "&name=" + urllib.quote_plus(title) + "&iconimage=" + urllib.quote_plus(image) + purl = 'plugin://plugin.video.smithsonian-earth?mode=637&url=' + urllib.quote_plus(url) + "&name=" + urllib.quote_plus(title) + "&iconimage=" + urllib.quote_plus(image) pubdate = jdata['page']['category']['videos'][i]['video']['pubdate'] li = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image);i=i+1 li.setProperty('fanart_image', defaultfanart) @@ -152,12 +184,12 @@ def single(url): li.addStreamInfo('video', { 'duration': duration }) xbmcplugin.addDirectoryItem(handle=addon_handle, url=purl, listitem=li) xbmcplugin.setContent(addon_handle, 'episodes') - if views != 'false': - xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[3])+")") + if force_views != 'false': + xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[int(settings.getSetting(id="views"))])+")") xbmcplugin.endOfDirectory(addon_handle) -#636 +#637 def stream(name,url): xbmc.log('URL: ' + str(url)) sign_in = br.open('https://api.smithsonianearthtv.com:8443/channels/5DJZN6FN/responsives/login') @@ -166,23 +198,19 @@ def stream(name,url): br['password'] = password logged_in = br.submit() check = logged_in.read() + device_id = re.compile(" device_id = '(.+?)'").findall(str(check)) + xbmc.log('DEVICE_ID: ' + str(device_id),level=log_level) dlsn = settings.getSetting(id="status") - if 'Log In' in check: - xbmcgui.Dialog().notification(plugin, 'Login Failed', defaultimage, 5000, False) - return - else: + if email in check: if dlsn=='false': xbmcgui.Dialog().notification(plugin, 'Login Successful', defaultimage, 2500, False) + else: + xbmcgui.Dialog().notification(plugin, 'Login Failed', defaultimage, 50000, False) + return page = br.open(str(url)).read() - url = re.compile('html5_url":"(.+?)"').findall(page) - xbmc.log('M3U8_URL: ' + str(url)) - urls = url[0].rpartition('/') - keys = urls[-1].rpartition('.') - q = settings.getSetting(id='quality') - q_key = 'v' + q +'_' + keys[0] - post_url = q_key + '/' + q_key + '.m3u8' - stream = urls[0] + '/' + post_url - play(name,stream,iconimage) + url = re.compile('html5_url":"(.+?)"').findall(page)[0] + xbmc.log('M3U8_URL: ' + str(url),level=log_level) + play(name,url,iconimage) xbmcplugin.endOfDirectory(addon_handle) @@ -199,6 +227,16 @@ def play(name,url,iconimage): xbmcplugin.endOfDirectory(addon_handle) +#99 +def PLAY(url): + listitem = xbmcgui.ListItem(path=url) + xbmc.log('### SETRESOLVEDURL ###', level=log_level) + listitem.setProperty('IsPlayable', 'true') + xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) + xbmc.log('URL: ' + str(url), level=log_level) + xbmcplugin.endOfDirectory(addon_handle) + + def remove_non_ascii_1(text): return ''.join(i for i in text if ord(i)<128) @@ -228,7 +266,7 @@ def addDir2(name,url,mode,fanart,thumbnail,plot): #commands = [] #commands.append ----- THIS WORKS! ----- #liz.addContextMenuItems([('Description', 'XBMC.RunScript(special://home/addons/plugin.video.smithsonian-earth/plot.py)')]) - liz.addContextMenuItems([('Plot Info', 'XBMC.RunPlugin(%s?mode=681&url=%s)' % (sys.argv[0], url))]) + #liz.addContextMenuItems([('Description', 'XBMC.RunPlugin(%s?mode=681&url=%s)' % (sys.argv[0], url))]) ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True, totalItems=70) return ok @@ -287,30 +325,36 @@ def unescape(s): except: pass -xbmc.log("Mode: " + str(mode)) -xbmc.log("URL: " + str(url)) -xbmc.log("Name: " + str(name)) +xbmc.log("Mode: " + str(mode), level=log_level) +xbmc.log("URL: " + str(url), level=log_level) +xbmc.log("Name: " + str(name), level=log_level) if mode == None:# or url == None or len(url) < 1: - xbmc.log("Generate Smithsonian Earth Main Menu") + xbmc.log(("Generate Smithsonian Earth Main Menu"), level=log_level) cats() elif mode==630: - xbmc.log("Smithsonian Earth Categories") + xbmc.log(("Smithsonian Earth Categories"), level=log_level) cats() elif mode==633: - xbmc.log("Smithsonian Earth Videos") + xbmc.log(("Smithsonian Earth Videos"), level=log_level) videos(url) elif mode==634: - xbmc.log("Smithsonian Earth Series") + xbmc.log(("Smithsonian Earth Series"), level=log_level) series(name,url,iconimage) elif mode==635: - xbmc.log("Smithsonian Earth Single") + xbmc.log(("Smithsonian Earth Single"), level=log_level) single(url) elif mode==636: - xbmc.log("Smithsonian Earth Stream") + xbmc.log(("Smithsonian Nature Scenes"), level=log_level) + nature(url) +elif mode==637: + xbmc.log(("Smithsonian Nature Scenes Stream"), level=log_level) stream(name,url) elif mode==681: - xbmc.log("Smithsonian Earth Plot Info") + xbmc.log(("Smithsonian Earth Plot Info"), level=log_level) plot_info(url) +elif mode==99: + xbmc.log(("Play Smithsonian Earth Video"), level=log_level) + PLAY(url) xbmcplugin.endOfDirectory(int(sys.argv[1])) diff --git a/plugin.video.smithsonian-earth/addon.xml b/plugin.video.smithsonian-earth/addon.xml index 1a4f453..9117dda 100644 --- a/plugin.video.smithsonian-earth/addon.xml +++ b/plugin.video.smithsonian-earth/addon.xml @@ -1,26 +1,37 @@ - + - video Stream the most captivating nature and wildlife documentaries and videos shot in stunning Ultra HD (4K) on Smithsonian Earth. - Smithsonian Earth is a commercial-free streaming site that offers unlimited access to nature and wildlife documentaries and videos shot in stunning 4K UHD resolution. Refreshed weekly, you'll never run out of things to discover. - + Smithsonian Earth is a commercial-free streaming site that offers unlimited access to nature and wildlife documentaries and videos shot in stunning 4K UHD resolution. Refreshed weekly, you'll never run out of things to discover. Subscription costs $3.99 per month with a 30 day free trial. + For support go to my github. No support without a full, unedited debug log. No support at TVAddons or any other forum. all GPL(v2) or Later - Login is broken - + https://smithsonianearthtv.com/ + v 2018.10.27[CR]- Update for 2018[CR]- Remove quality settings[CR]v 0.0.4[CR]- Fixes for website changes[CR]- Added infolabels[CR]v 0.0.3[CR]- Add quality option in settings[CR]v 0.0.2[CR]- Code cleanup[CR]v 0.0.1[CR]- Initial release + + icon.png + fanart.jpg + resources/media/screenshot001.png + resources/media/screenshot002.png + resources/media/screenshot003.png + resources/media/screenshot004.png + resources/media/screenshot005.png + resources/media/screenshot006.png + resources/media/screenshot007.png + resources/media/screenshot008.png + diff --git a/plugin.video.smithsonian-earth/changelog.txt b/plugin.video.smithsonian-earth/changelog.txt index 3af801f..9f33136 100644 --- a/plugin.video.smithsonian-earth/changelog.txt +++ b/plugin.video.smithsonian-earth/changelog.txt @@ -1,3 +1,6 @@ +Version 2018.10.27 +- Update for 2018 + Version 0.0.4 - Fixes for website changes - Make use of infolabels diff --git a/plugin.video.smithsonian-earth/resources/language/English/strings.xml b/plugin.video.smithsonian-earth/resources/language/English/strings.xml index 5c2cab6..9a06f30 100644 --- a/plugin.video.smithsonian-earth/resources/language/English/strings.xml +++ b/plugin.video.smithsonian-earth/resources/language/English/strings.xml @@ -1,21 +1,19 @@ + Enable Log Notices Login Details - Stream Quality - Lowest - Low - Medium Low - Medium - Medium High - High - Higher - Best - Force Views User Account Username Password Hide Login Message + Force Views + Thumbnail + List + Media Info 2 + Media Info + Media Info 3 + Confluence View Bitrate Views diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot001.png b/plugin.video.smithsonian-earth/resources/media/screenshot001.png new file mode 100644 index 0000000..7bd6327 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot001.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot002.png b/plugin.video.smithsonian-earth/resources/media/screenshot002.png new file mode 100644 index 0000000..9046059 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot002.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot003.png b/plugin.video.smithsonian-earth/resources/media/screenshot003.png new file mode 100644 index 0000000..53b05ec Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot003.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot004.png b/plugin.video.smithsonian-earth/resources/media/screenshot004.png new file mode 100644 index 0000000..9d44417 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot004.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot005.png b/plugin.video.smithsonian-earth/resources/media/screenshot005.png new file mode 100644 index 0000000..7a144d6 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot005.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot006.png b/plugin.video.smithsonian-earth/resources/media/screenshot006.png new file mode 100644 index 0000000..06afdc2 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot006.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot007.png b/plugin.video.smithsonian-earth/resources/media/screenshot007.png new file mode 100644 index 0000000..30bf725 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot007.png differ diff --git a/plugin.video.smithsonian-earth/resources/media/screenshot008.png b/plugin.video.smithsonian-earth/resources/media/screenshot008.png new file mode 100644 index 0000000..76afd89 Binary files /dev/null and b/plugin.video.smithsonian-earth/resources/media/screenshot008.png differ diff --git a/plugin.video.smithsonian-earth/resources/settings.xml b/plugin.video.smithsonian-earth/resources/settings.xml index 6f1a82f..ce679bc 100644 --- a/plugin.video.smithsonian-earth/resources/settings.xml +++ b/plugin.video.smithsonian-earth/resources/settings.xml @@ -4,10 +4,14 @@ - - + + + + + + + + + - - - diff --git a/repository.metalchris/addon.xml b/repository.metalchris/addon.xml index 0398df2..cfb33e0 100644 --- a/repository.metalchris/addon.xml +++ b/repository.metalchris/addon.xml @@ -1,5 +1,5 @@ - + http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml.md5 diff --git a/zips/plugin.video.smithsonian-earth/changelog-2018.10.27.txt b/zips/plugin.video.smithsonian-earth/changelog-2018.10.27.txt new file mode 100644 index 0000000..9f33136 --- /dev/null +++ b/zips/plugin.video.smithsonian-earth/changelog-2018.10.27.txt @@ -0,0 +1,15 @@ +Version 2018.10.27 +- Update for 2018 + +Version 0.0.4 +- Fixes for website changes +- Make use of infolabels + +Version 0.0.3 +- Add quality option in settings + +Version 0.0.2 +- Code cleanup + +Version 0.0.1 +- Initial release. diff --git a/zips/plugin.video.smithsonian-earth/plugin.video.smithsonian-earth-2018.10.27.zip b/zips/plugin.video.smithsonian-earth/plugin.video.smithsonian-earth-2018.10.27.zip new file mode 100644 index 0000000..61bdcb9 Binary files /dev/null and b/zips/plugin.video.smithsonian-earth/plugin.video.smithsonian-earth-2018.10.27.zip differ diff --git a/zips/repository.metalchris/addon.xml b/zips/repository.metalchris/addon.xml index 4ed887f..cfb33e0 100644 --- a/zips/repository.metalchris/addon.xml +++ b/zips/repository.metalchris/addon.xml @@ -1,5 +1,5 @@ - + http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml http://raw.github.com/MetalChris/repository.metalchris/master/addons.xml.md5 diff --git a/zips/repository.metalchris/repository.metalchris-3.1.5.zip b/zips/repository.metalchris/repository.metalchris-3.1.5.zip new file mode 100644 index 0000000..f40ceee Binary files /dev/null and b/zips/repository.metalchris/repository.metalchris-3.1.5.zip differ