Skip to content

Commit 159a074

Browse files
committed
fixes Tvh service name issue with username-password
1 parent 9dda33b commit 159a074

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

addon.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.zap2epg" name="zap2epg" version="0.6.2" provider-name="edit4ever">
2+
<addon id="script.module.zap2epg" name="zap2epg" version="0.6.3" provider-name="edit4ever">
33
<requires>
44
<import addon="xbmc.python" version="2.7.13"/>
55
<import addon="script.module.dateutil" version="2.4.2"/>
@@ -29,9 +29,7 @@ Setup:
2929
<email></email>
3030
<source></source>
3131
<news>
32-
v0.6.2 - Only match Tvheadend channels that are enabled - Add option for original genre categories (2017-12-13)
33-
v0.6.1 - OTA Tvheadend channels pre-selected in channels list (2017-12-8)
34-
v0.6.0 - add Kodi 18 (LE9) compatibility and fix TVH username-password (2017-12-7)
32+
v0.6.3 - fixes Tvh service name issue with username-password (2017-12-18)
3533
</news>
3634
<assets>
3735
<icon>resources/icon.png</icon>

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v0.6.3 (2017-12-18)
2+
- fixes Tvh service name issue with username-password
3+
14
v0.6.2 (2017-12-13)
25
- Only match Tvheadend channels that are enabled
36
- Add option for original genre categories

zap2epg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
################################################################################
1616

1717
import urllib2
18+
import base64
1819
import codecs
1920
import time
2021
import datetime
@@ -90,7 +91,7 @@ def mainRun(userdata):
9091
country = 'USA'
9192
else:
9293
country = 'CAN'
93-
logging.info('Running zap2epg-0.6.2 for zipcode: %s and lineup: %s', zipcode, lineup)
94+
logging.info('Running zap2epg-0.6.3 for zipcode: %s and lineup: %s', zipcode, lineup)
9495
pythonStartTime = time.time()
9596
cacheDir = os.path.join(userdata, 'cache')
9697
dayHours = int(days) * 8 # set back to 8 when done testing
@@ -103,10 +104,9 @@ def tvhMatchGet():
103104
channels_url = tvhUrlBase + '/api/channel/grid?all=1&limit=999999999&sort=name&filter=[{"type":"boolean","value":true,"field":"enabled"}]'
104105
if usern is not None and passw is not None:
105106
logging.info('Adding Tvheadend username and password to request url...')
106-
password_mgr = urllib2.HTTPDigestAuthHandler()
107-
password_mgr.add_password(realm='tvheadend', uri=channels_url, user=usern, passwd=passw)
108-
opener = urllib2.build_opener(password_mgr)
109-
response = opener.open(channels_url)
107+
request = urllib2.Request(channels_url)
108+
request.add_header('Authorization', b'Basic ' + base64.b64encode(usern + b':' + passw))
109+
response = urllib2.urlopen(request)
110110
else:
111111
response = urllib2.urlopen(channels_url)
112112
try:
@@ -652,7 +652,7 @@ def makeDescsortList(optList):
652652
ratings = edict['eprating'] + space
653653
if edict['epflag'] != []:
654654
flagList = edict['epflag']
655-
new = ' '.join(flagList).upper() + space
655+
new = ' - '.join(flagList).upper() + space
656656
#if edict['epnew'] is not None:
657657
#new = edict['epnew'] + space
658658
#if edict['eplive'] is not None:

0 commit comments

Comments
 (0)