From f9a09137e968901c8bc5995f10212c1c2bac26e2 Mon Sep 17 00:00:00 2001 From: skipmodea1 Date: Wed, 11 Oct 2017 21:43:16 +0200 Subject: [plugin.video.hak5] 1.0.1 (#1453) --- plugin.video.hak5/addon.xml | 4 +- plugin.video.hak5/changelog.txt | 4 ++ plugin.video.hak5/resources/lib/hak5_const.py | 7 ++-- .../resources/lib/hak5_list_episodes.py | 44 ++++++++-------------- .../resources/lib/hak5_list_seasons.py | 3 +- plugin.video.hak5/resources/lib/hak5_main.py | 16 +------- 6 files changed, 28 insertions(+), 50 deletions(-) diff --git a/plugin.video.hak5/addon.xml b/plugin.video.hak5/addon.xml index 7e0e995..416f26e 100644 --- a/plugin.video.hak5/addon.xml +++ b/plugin.video.hak5/addon.xml @@ -1,7 +1,7 @@  @@ -19,7 +19,7 @@ en all GNU GENERAL PUBLIC LICENSE. Version 3, June 2007 - + https://forum.kodi.tv/showthread.php?tid=318316 http://hak5.com https://github.com/skipmodea1/plugin.video.hak5 diff --git a/plugin.video.hak5/changelog.txt b/plugin.video.hak5/changelog.txt index 55706c6..de23b40 100644 --- a/plugin.video.hak5/changelog.txt +++ b/plugin.video.hak5/changelog.txt @@ -1,2 +1,6 @@ +v1.0.1 (2017-10-11) +Fixes due to website changes +Removed Pinapple University videos + v1.0.0 (2017-07-09) initial version \ No newline at end of file diff --git a/plugin.video.hak5/resources/lib/hak5_const.py b/plugin.video.hak5/resources/lib/hak5_const.py index 129de87..83ad2bd 100644 --- a/plugin.video.hak5/resources/lib/hak5_const.py +++ b/plugin.video.hak5/resources/lib/hak5_const.py @@ -12,13 +12,12 @@ SETTINGS = xbmcaddon.Addon() LANGUAGE = SETTINGS.getLocalizedString IMAGES_PATH = os.path.join(xbmcaddon.Addon().getAddonInfo('path'), 'resources', 'images') HAK5RECENTLYADDEDURL = 'http://www.hak5.org/category/episodes' -HAK5SEASONSURLHTTP = 'http://www.hak5.org/category/episodes' -HAK5SEASONSURLHTTPS = 'https://www.hak5.org/category/episodes' +HAK5SEASONSURLHTTPS = 'https://www.hak5.org/shows/hak5' HAKTIKRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/haktip/page/001' THREATWIRERECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/threatwire/page/001' TEKTHINGRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/tekthing/page/001' PINEAPPLEUNIVERSITYRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/pineapple-university' METASPLOITRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/metasploit-minute/page/001' HEADERS = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'} -DATE = "2017-07-09" -VERSION = "1.0.0" \ No newline at end of file +DATE = "2017-10-11" +VERSION = "1.0.1" \ No newline at end of file diff --git a/plugin.video.hak5/resources/lib/hak5_list_episodes.py b/plugin.video.hak5/resources/lib/hak5_list_episodes.py index 5979c73..6c95be1 100644 --- a/plugin.video.hak5/resources/lib/hak5_list_episodes.py +++ b/plugin.video.hak5/resources/lib/hak5_list_episodes.py @@ -95,41 +95,25 @@ class Main: # xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % ( # ADDON, VERSION, DATE, "html_source", str(html_source)), xbmc.LOGDEBUG) - #
- #
# - #
- #
- #
- # @@ -156,7 +140,9 @@ class Main: xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % ( ADDON, VERSION, DATE, "thumbnail_url", str(thumbnail_url)), xbmc.LOGDEBUG) - title = episode.a['title'] + pos_of_title_start = str(episode).find('title="') + len('title="') + pos_of_title_end = str(episode).find('"', pos_of_title_start) + title = str(episode)[pos_of_title_start:pos_of_title_end] # Clean up title try: diff --git a/plugin.video.hak5/resources/lib/hak5_list_seasons.py b/plugin.video.hak5/resources/lib/hak5_list_seasons.py index b0544aa..9b3388e 100644 --- a/plugin.video.hak5/resources/lib/hak5_list_seasons.py +++ b/plugin.video.hak5/resources/lib/hak5_list_seasons.py @@ -72,7 +72,8 @@ class Main: # xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % ( # ADDON, VERSION, DATE, "html_source", str(html_source)), xbmc.LOGDEBUG) - seasons = soup.findAll('a', attrs={'href': re.compile("^" + HAK5SEASONSURLHTTPS)}) + #Season 1 + seasons = soup.findAll('a', attrs={'href': re.compile("^" + "https://www.hak5.org/category/episodes/season")}) xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % ( ADDON, VERSION, DATE, "len(seasons)", str(len(seasons))), xbmc.LOGDEBUG) diff --git a/plugin.video.hak5/resources/lib/hak5_main.py b/plugin.video.hak5/resources/lib/hak5_main.py index 49575a6..af47c11 100644 --- a/plugin.video.hak5/resources/lib/hak5_main.py +++ b/plugin.video.hak5/resources/lib/hak5_main.py @@ -10,7 +10,7 @@ import xbmcgui import xbmcplugin import os -from hak5_const import LANGUAGE, IMAGES_PATH, HAK5RECENTLYADDEDURL, HAK5SEASONSURLHTTP, \ +from hak5_const import LANGUAGE, IMAGES_PATH, HAK5RECENTLYADDEDURL, HAK5SEASONSURLHTTPS, \ HAKTIKRECENTLYADDEDURL, THREATWIRERECENTLYADDEDURL, TEKTHINGRECENTLYADDEDURL, PINEAPPLEUNIVERSITYRECENTLYADDEDURL, \ METASPLOITRECENTLYADDEDURL # @@ -39,7 +39,7 @@ class Main: # # Hak5 Seasons # - parameters = {"action": "list-seasons", "plugin_category": LANGUAGE(30302), "url": HAK5SEASONSURLHTTP, + parameters = {"action": "list-seasons", "plugin_category": LANGUAGE(30302), "url": HAK5SEASONSURLHTTPS, "next_page_possible": "False"} url = self.plugin_url + '?' + urllib.urlencode(parameters) list_item = xbmcgui.ListItem(LANGUAGE(30302)) @@ -85,18 +85,6 @@ class Main: list_item.setProperty('IsPlayable', 'false') xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=list_item, isFolder=is_folder) - # - # Pinapple University Recently Added Episodes - # - parameters = {"action": "list-episodes", "plugin_category": LANGUAGE(30306), "url": PINEAPPLEUNIVERSITYRECENTLYADDEDURL, - "next_page_possible": "False"} - url = self.plugin_url + '?' + urllib.urlencode(parameters) - list_item = xbmcgui.ListItem(LANGUAGE(30306)) - is_folder = True - list_item.setArt({'fanart': os.path.join(IMAGES_PATH, 'fanart-blur.jpg')}) - list_item.setProperty('IsPlayable', 'false') - xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=list_item, isFolder=is_folder) - # # Metasploit Recently Added Episodes # -- cgit v1.2.3