Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
v1.0.2-beta:
Browse files Browse the repository at this point in the history
- Dropped requests module dependency due to SSL/TLS bug
- created TODO
  • Loading branch information
Torro committed Feb 19, 2017
1 parent 4fcf06d commit 28e01a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Disable listing of livestreams marked private.
Speed up loading a large list of streams.
17 changes: 6 additions & 11 deletions addon.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"""Een Kodi add-on om kerkdienstgemist.nl livestreams te bekijken/luisteren."""

__copyright__ = "Copyright (C) 2017 Torro"


import sys
import urllib
import urlparse
import xbmcgui
import xbmcplugin
import requests
import urllib2
from bs4 import BeautifulSoup

base_url = sys.argv[0]
Expand All @@ -23,7 +18,7 @@ def build_url(query):
def getKDGLive():
"""Make a list of livepages to be scraped"""
url = 'https://kerkdienstgemist.nl/browse/live'
bcnum = int(BeautifulSoup(requests.get(url).text, 'html.parser')
bcnum = int(BeautifulSoup(urllib2.urlopen(url), 'html.parser')
.find_all('span', 'bold')[2].string)
pagenum = (bcnum - 1) / 10 + 1
pagelist = ["{}?page={}".format(url, str(no)) for no
Expand All @@ -38,7 +33,7 @@ def parseKDGLive(pagelist):
treeindex = 1

for page in pagelist:
pagina = BeautifulSoup(requests.get(page).text, 'html.parser')
pagina = BeautifulSoup(urllib2.urlopen(page), 'html.parser')

for broadcast in pagina.find_all('li', 'live'):
broadcast_tree.update(
Expand Down Expand Up @@ -81,10 +76,10 @@ def buildServicesList(broadcast_tree):

def playStation():
"""Get the stream for the selected broadcast; hand it off to kodi"""
asseturl = requests.get('https://www.kerkdienstgemist.nl' +
args['url'][0]).url + '/embed'
asseturl = urllib2.urlopen('https://www.kerkdienstgemist.nl' +
args['url'][0]).url + '/embed'
stream = BeautifulSoup(
requests.get(asseturl).text, 'html.parser'
urllib2.urlopen(asseturl), 'html.parser'
).body.find_all('script')[3].string.split("'")[1]
play_item = xbmcgui.ListItem(path=stream)
xbmcplugin.setResolvedUrl(addon_handle, True, listitem=play_item)
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.0.2-beta
- Dropped Requests module dependency due to SSL/TLS bug
- created TODO

v1.0.1-beta
- Add-on licensed under GPLv3
- Refactored the hand-off of the selected stream
Expand Down

0 comments on commit 28e01a7

Please sign in to comment.