Skip to content

Commit

Permalink
fix code 8009 - 404 issue once again and remove ishelper (#103)
Browse files Browse the repository at this point in the history
* new fix for 8009 issue
* remove use of inputstreamhelper
* bump version
  • Loading branch information
TermeHansen authored Sep 29, 2024
1 parent 4dbf38b commit 7ed9d16
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
7 changes: 5 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.drnu" version="6.4.4" name="DR TV" provider-name="TermeHansen">
<addon id="plugin.video.drnu" version="6.4.5" name="DR TV" provider-name="TermeHansen">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.dateutil" version="2.8.2" />
<import addon="script.module.requests" version="2.31.0" />
<import addon="script.module.requests-cache" version="0.5.2+matrix.2"/>
<import addon="script.module.inputstreamhelper" version="0.6.1+matrix.1"/>
<import addon="service.cronxbmc" version="0.1.6"/>
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
Expand All @@ -32,6 +31,10 @@
<screenshot>resources/media/Screenshot3.jpg</screenshot>
<screenshot>resources/media/Screenshot4.jpg</screenshot>
</assets>
<news>[B]Version 6.4.5 - 2024-09-29[/B]
- Fix issue of dr returning 404 on some streams with 'sub' header, again..
- remove inputstreamhelper from addon
</news>
<news>[B]Version 6.4.4 - 2024-09-08[/B]
- Fix issue of dr returning 404 on some streams with 'sub' header
</news>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[B]Version 6.4.5 - 2024-09-29[/B]
- Fix issue of dr returning 404 on some streams with 'sub' header, again...
- remove inputstreamhelper from addon

[B]Version 6.4.4 - 2024-09-08[/B]
- Fix issue of dr returning 404 on some streams with 'sub' header

Expand Down
9 changes: 3 additions & 6 deletions resources/lib/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import xbmcgui
import xbmcplugin
from xbmcvfs import translatePath
from inputstreamhelper import Helper

from resources.lib import tvapi
from resources.lib import tvgui
Expand Down Expand Up @@ -457,11 +456,9 @@ def playVideo(self, id, kids_channel, path):
listItem = xbmcgui.ListItem(path=video['url'], offscreen=True)

if int(get_setting('inputstream')) == 0:
is_helper = Helper('hls')
if is_helper.check_inputstream():
listItem.setProperty('inputstream', is_helper.inputstream_addon)
if kodi_version_major() <= 20:
listItem.setProperty('inputstream.adaptive.manifest_type', 'hls')
listItem.setProperty('inputstream', 'inputstream.adaptive')
if kodi_version_major() <= 20:
listItem.setProperty('inputstream.adaptive.manifest_type', 'hls')

local_subs_bool = bool_setting('enable.localsubtitles') or int(get_setting('inputstream')) == 1
if local_subs_bool and video['srt_subtitles']:
Expand Down
6 changes: 5 additions & 1 deletion resources/lib/tvapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def cache_path(path):
return False
return True


def full_login(user, password):
ses = requests.Session()
# start login flow
Expand Down Expand Up @@ -479,8 +480,11 @@ def get_stream(self, id):
'lang': 'da',
'resolution': 'HD-1080',
}

u = self.session.get(url, params=data, headers=headers, timeout=GET_TIMEOUT)
if u.status_code == 404 and u.json()['code'] == 8009:
data['sub'] = 'Registered'
u = self.session.get(url, params=data, headers=headers, timeout=GET_TIMEOUT)

if u.status_code == 200:
for stream in u.json():
if stream['accessService'] == 'StandardVideo':
Expand Down

0 comments on commit 7ed9d16

Please sign in to comment.