summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskipmodea1 <skipmodea1@outlook.com>2017-11-12 09:42:21 +0100
committerMartijn Kaijser <martijn@xbmc.org>2017-11-12 10:05:06 +0100
commit5694665bd5c2aacc3b67de0a3c6ea40fbc782e3e (patch)
treeb07871584ba7f1927eda92c6b1e18bdf0a595458
parent7bcfc4001cd24523d25d9b9b4b884b05612afe4c (diff)
[plugin.video.hak5] 1.0.2
-rw-r--r--plugin.video.hak5/addon.xml4
-rw-r--r--plugin.video.hak5/changelog.txt3
-rw-r--r--plugin.video.hak5/resources/lib/hak5_const.py4
-rw-r--r--plugin.video.hak5/resources/lib/hak5_list_episodes.py49
-rw-r--r--plugin.video.hak5/resources/lib/hak5_list_seasons.py7
-rw-r--r--plugin.video.hak5/resources/lib/hak5_main.py2
-rw-r--r--plugin.video.hak5/resources/lib/hak5_play.py25
7 files changed, 50 insertions, 44 deletions
diff --git a/plugin.video.hak5/addon.xml b/plugin.video.hak5/addon.xml
index 416f26e..efafba7 100644
--- a/plugin.video.hak5/addon.xml
+++ b/plugin.video.hak5/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.hak5"
name="Hak5"
- version="1.0.1"
+ version="1.0.2"
provider-name="Skipmode A1">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
@@ -14,7 +14,7 @@
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Watch videos from hak5.com</summary>
- <description lang="en_GB">Watch videos from hak5.com. The videos are from the shows Hak5, Haktik, Threatwire, Tekthing, Pineapple University and Metasploit</description>
+ <description lang="en_GB">Watch videos from hak5.com. The videos are from the shows Hak5, Haktik, Threatwire, Tekthing and Metasploit</description>
<disclaimer lang="en_GB">For bugs, requests or general questions visit the hak5.com thread on the Kodi forum</disclaimer>
<language>en</language>
<platform>all</platform>
diff --git a/plugin.video.hak5/changelog.txt b/plugin.video.hak5/changelog.txt
index de23b40..213d41d 100644
--- a/plugin.video.hak5/changelog.txt
+++ b/plugin.video.hak5/changelog.txt
@@ -1,3 +1,6 @@
+v1.0.2 (2017-11-12)
+Fixes due to website changes
+
v1.0.1 (2017-10-11)
Fixes due to website changes
Removed Pinapple University videos
diff --git a/plugin.video.hak5/resources/lib/hak5_const.py b/plugin.video.hak5/resources/lib/hak5_const.py
index 83ad2bd..0334942 100644
--- a/plugin.video.hak5/resources/lib/hak5_const.py
+++ b/plugin.video.hak5/resources/lib/hak5_const.py
@@ -19,5 +19,5 @@ TEKTHINGRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/tekthing/page/
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-10-11"
-VERSION = "1.0.1" \ No newline at end of file
+DATE = "2017-11-12"
+VERSION = "1.0.2" \ 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 6c95be1..fe8192f 100644
--- a/plugin.video.hak5/resources/lib/hak5_list_episodes.py
+++ b/plugin.video.hak5/resources/lib/hak5_list_episodes.py
@@ -95,24 +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)
+ # <div id="post-8843" class="video-item post-8843 post type-post status-publish format-video has-post-thumbnail hentry category-episodes category-hak5 category-season-22 tag-darren-kitchen tag-hack-across-the-planet tag-hak-5 tag-pseudocode-for-life post_format-post-format-video">
# <div class="item-thumbnail">
- # <a href="https://www.hak5.org/episodes/3-billion-yahoo-accounts-hacked-disqus-hacked-threat-wire">
- # <img width="520" height="293" src="https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-520x293.jpg" class="attachment-thumb_520x293 size-thumb_520x293 wp-post-image" alt="" srcset="https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-520x293.jpg 520w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-150x84.jpg 150w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-300x169.jpg 300w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-1024x576.jpg 1024w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-260x146.jpg 260w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-356x200.jpg 356w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-370x208.jpg 370w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-180x101.jpg 180w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-130x73.jpg 130w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-748x421.jpg 748w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked-624x351.jpg 624w, https://www.hak5.org/wp-content/uploads/2017/10/3-billion-yahoo-accounts-hacked.jpg 1280w" sizes="(max-width: 520px) 100vw, 520px" /> <div class="link-overlay fa fa-search"></div>
+ # <a href="https://www.hak5.org/episodes/hak5-2216-pseudocode-for-life-2-hack-across-the-planet">
+ # <img width="520" height="293" src="https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-520x293.jpg" class="attachment-thumb_520x293 size-thumb_520x293 wp-post-image" alt="" srcset="https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-520x293.jpg 520w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-150x84.jpg 150w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-300x169.jpg 300w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-1024x576.jpg 1024w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-260x146.jpg 260w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-356x200.jpg 356w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-370x208.jpg 370w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-180x101.jpg 180w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-130x73.jpg 130w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-748x421.jpg 748w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-624x351.jpg 624w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2.jpg 1280w" sizes="(max-width: 520px) 100vw, 520px" /> <div class="link-overlay fa fa-play"></div>
# </a>
# </div>
# <div class="item-head">
- # <h3><a href="https://www.hak5.org/episodes/3-billion-yahoo-accounts-hacked-disqus-hacked-threat-wire" rel="9479" title="3 Billion Yahoo Accounts Hacked; Disqus Hacked! – Threat Wire">3 Billion Yahoo Accounts Hacked; Disqus Hacked! &#8211; Threat Wire</a>
+ # <h3><a href="https://www.hak5.org/episodes/hak5-2216-pseudocode-for-life-2-hack-across-the-planet" rel="8843" title="Hak5 2216 – Pseudocode for Life 2 – Hack Across the Planet">Hak5 2216 &#8211; Pseudocode for Life 2 &#8211; Hack Across the Planet</a>
# </h3>
# <div class="item-info hidden">
# <span class="item-author"><a href="https://www.hak5.org/author/snubs" title="Posts by Shannon Morse" rel="author">Shannon Morse</a></span>
- # <span class="item-date">October 10, 2017</span>
+ # <span class="item-date">June 28, 2017</span>
# <div class="item-meta">
- # <span><i class="fa fa-eye"></i> 0</span> <span><i class="fa fa-comment"></i> 0</span> <span><i class="fa fa-thumbs-up"></i> 0</span>
+ # <span><i class="fa fa-eye"></i> 0</span> <span><i class="fa fa-comment"></i> 0</span> <span><i class="fa fa-thumbs-up"></i> 1</span>
# </div>
# </div>
# </div>
# <div class="item-content hidden">
- # <p>The Yahoo breach was a lot worse than we thought, the Equifax ex-CEO sheds light on some questions, disqus was hacked, and Kaspersky is stuck in the middle of debates. All that coming up now on ThreatWire. Hak5 Product Launch Event! October 20th: https://www.hak5.org/rsvp &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Shop: http://www.hakshop.com Support: http://www.patreon.com/threatwire Subscribe: http://www.youtube.com/hak5 Our Site: http://www.hak5.org [&hellip;]</p>
+ # <p>It&#8217;s better to regret something you have done than something you haven&#8217;t. Regular episodes resume August 2nd. UK meetups July 10-14. Sign up at https://HackAcrossThePlanet.com https://HackAcrossThePlanet.com &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Shop: http://www.hakshop.com Support: http://www.patreon.com/threatwire Subscribe: http://www.youtube.com/hak5 Our Site: http://www.hak5.org Contact Us: http://www.twitter.com/hak5 Threat Wire RSS: https://shannonmorse.podbean.com/feed/ Threat Wire iTunes: https://itunes.apple.com/us/podcast/threat-wire/id1197048999 Help us with Translations! http://www.youtube.com/timedtext_cs_panel?tab=2&#038;c=UC3s0BtrBJpwNDaflRSoiieQ &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
# </div>
# <div class="clearfix"></div>
# </div>
@@ -124,8 +125,8 @@ class Main:
for episode in episodes:
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "episode)", str(episode)), xbmc.LOGDEBUG)
+ # xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
+ # ADDON, VERSION, DATE, "episode", str(episode)), xbmc.LOGDEBUG)
video_page_url = episode.a['href']
@@ -208,29 +209,33 @@ class Main:
blog_date_year = blog_date[blog_date_year_start_pos: blog_date_year_end_pos]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_year)", str(blog_date_year)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "blog_date_year", str(blog_date_year)), xbmc.LOGDEBUG)
blog_date_month_start_pos = blog_date_year_end_pos + 1
blog_date_month_end_pos = blog_date_month_start_pos + 2
blog_date_month = blog_date[blog_date_month_start_pos:blog_date_month_end_pos]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_month)", str(blog_date_month)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "blog_date_month", str(blog_date_month)), xbmc.LOGDEBUG)
# lets find the blog date day
- blog_date = episode.findAll('div', attrs={'class': re.compile("^" + 'blog-date')})
- blog_date = str(blog_date)
- blog_date_day_start_pos = blog_date.find('<span>')
- blog_date_day_end_pos = blog_date.find('</span>')
- blog_date_day = blog_date[blog_date_day_start_pos + len('<span>'):blog_date_day_end_pos]
+ blog_date = episode.findAll('span', attrs={'class': re.compile("^" + 'item-date')})
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_day)", str(blog_date_day)), xbmc.LOGDEBUG)
+ if len(blog_date) == 0:
+ blog_date_day = '00'
+ else:
+ blog_date = str(blog_date[0].text)
+ blog_date_day_start_pos = blog_date.find(',') - 2
+ blog_date_day_end_pos = blog_date_day_start_pos + 2
+ blog_date_day = blog_date[blog_date_day_start_pos:blog_date_day_end_pos]
+
+ xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
+ ADDON, VERSION, DATE, "blog_date_day", str(blog_date_day)), xbmc.LOGDEBUG)
video_date = blog_date_year + '-' + blog_date_month + '-' + blog_date_day + ' 00:00:01'
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "video_date)", str(video_date)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "video_date", str(video_date)), xbmc.LOGDEBUG)
# Unescaping the plot
try:
@@ -238,6 +243,8 @@ class Main:
except:
plot = title
+ xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (ADDON, VERSION, DATE, "plot", str(plot)), xbmc.LOGDEBUG)
+
add_sort_methods()
context_menu_items = []
@@ -286,6 +293,6 @@ class Main:
xbmcplugin.endOfDirectory(self.plugin_handle)
def add_sort_methods():
- sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
- for method in sort_methods:
- xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method)
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_list_seasons.py b/plugin.video.hak5/resources/lib/hak5_list_seasons.py
index 9b3388e..f2d37dc 100644
--- a/plugin.video.hak5/resources/lib/hak5_list_seasons.py
+++ b/plugin.video.hak5/resources/lib/hak5_list_seasons.py
@@ -137,7 +137,8 @@ class Main:
# Finish creating a virtual folder.
xbmcplugin.endOfDirectory(self.plugin_handle)
+
def add_sort_methods():
- sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
- for method in sort_methods:
- xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_main.py b/plugin.video.hak5/resources/lib/hak5_main.py
index af47c11..f1c2105 100644
--- a/plugin.video.hak5/resources/lib/hak5_main.py
+++ b/plugin.video.hak5/resources/lib/hak5_main.py
@@ -89,7 +89,7 @@ class Main:
# Metasploit Recently Added Episodes
#
parameters = {"action": "list-episodes", "plugin_category": LANGUAGE(30307), "url": METASPLOITRECENTLYADDEDURL,
- "next_page_possible": "True"}
+ "next_page_possible": "False"}
url = self.plugin_url + '?' + urllib.urlencode(parameters)
list_item = xbmcgui.ListItem(LANGUAGE(30307))
is_folder = True
diff --git a/plugin.video.hak5/resources/lib/hak5_play.py b/plugin.video.hak5/resources/lib/hak5_play.py
index 685a992..7e0f93d 100644
--- a/plugin.video.hak5/resources/lib/hak5_play.py
+++ b/plugin.video.hak5/resources/lib/hak5_play.py
@@ -82,23 +82,18 @@ class Main:
no_url_found = True
have_valid_url = False
- # <meta property="og:url" content="https://youtu.be/K_EOLgX5Dqs"/>
+ #<iframe width="900" height="506" src="https://www.youtube.com/embed/fYdFNFTSoy4?feature=oembed&#038;wmode=opaque&#038;rel=0&#038;showinfo=0&#038;modestbranding=0"
+ # frameborder="0" gesture="media" allowfullscreen></iframe>
+
# let's extract the youtube-id
html_source = str(html_source)
- start_pos_meta_prop = html_source.find('meta property="og:url"')
- if start_pos_meta_prop > 0:
- search_for_string = '"/>'
- end_pos_meta_prop = html_source.find(search_for_string, start_pos_meta_prop)
- if end_pos_meta_prop > 0:
- # the last 3 characters are removed
- meta_prop = html_source[start_pos_meta_prop: end_pos_meta_prop]
-
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "meta_prop", str(meta_prop)), xbmc.LOGDEBUG)
-
- pos_of_last_slash = meta_prop.rfind('/')
- youtube_id = meta_prop[pos_of_last_slash + 1:]
-
+ start_pos_youtube_embed = html_source.find('youtube.com/embed/')
+ if start_pos_youtube_embed > 0:
+ start_pos_youtube_id = start_pos_youtube_embed + len('youtube.com/embed/')
+ search_for_string = '?'
+ end_pos_youtube_id = html_source.find(search_for_string, start_pos_youtube_id)
+ if end_pos_youtube_id > 0:
+ youtube_id = html_source[start_pos_youtube_id:end_pos_youtube_id]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
ADDON, VERSION, DATE, "youtube_id", str(youtube_id)), xbmc.LOGDEBUG)