Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove emergency sub param from next queries. #106

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.drnu" version="6.4.5" name="DR TV" provider-name="TermeHansen">
<addon id="plugin.video.drnu" version="6.4.6" name="DR TV" provider-name="TermeHansen">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.dateutil" version="2.8.2" />
Expand Down Expand Up @@ -31,6 +31,9 @@
<screenshot>resources/media/Screenshot3.jpg</screenshot>
<screenshot>resources/media/Screenshot4.jpg</screenshot>
</assets>
<news>[B]Version 6.4.6 - 2024-10-03[/B]
- Fix "unsupported_subCode" issue.
</news>
<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
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[B]Version 6.4.6 - 2024-10-03[/B]
- Fix "unsupported_subCode" issue.

[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
Expand Down
16 changes: 14 additions & 2 deletions resources/lib/tvapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time
from dateutil import parser
from datetime import datetime, timezone, timedelta
from urllib.parse import urlparse, parse_qs
from urllib.parse import urlparse, parse_qs, parse_qsl, urlencode, urlunparse


CHANNEL_IDS = [20875, 20876, 192099, 192100, 20892]
Expand All @@ -51,6 +51,17 @@ def cache_path(path):
return True


def fix_query(url, remove={}, add={}):
o = list(urlparse(url))
qs = dict(parse_qsl(o[4]))
for k,v in remove.items():
if qs.get(k) == v:
del qs[k]
qs.update(add)
o[4] = urlencode(qs)
return urlunparse(o)


def full_login(user, password):
ses = requests.Session()
# start login flow
Expand Down Expand Up @@ -283,7 +294,8 @@ def get_item(self, id, use_cache=True):
return self._request_get(url)

def get_next(self, path, use_cache=True, headers=None):
url = URL + path
remove = {'sub':'Emergency'}
url = URL + fix_query(path, remove=remove)
return self._request_get(url, headers=headers, use_cache=use_cache)

def get_list(self, id, param, use_cache=True):
Expand Down
Loading