Skip to content

Commit

Permalink
[plugin.video.vrt.nu] 2.5.30
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister committed Apr 16, 2024
1 parent 648fcf8 commit 1f19a3e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 82 deletions.
3 changes: 3 additions & 0 deletions plugin.video.vrt.nu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ leave a message at [our Facebook page](https://facebook.com/kodivrtnu/).
</table>

## Releases
### v2.5.30 (2024-04-16)
- Fix playing from TV guide (@mediaminister)

### v2.5.29 (2024-02-12)
- Fix program listings (@mediaminister)

Expand Down
47 changes: 4 additions & 43 deletions plugin.video.vrt.nu/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.vrt.nu" name="VRT MAX" version="2.5.29" provider-name="Martijn Moreel, dagwieers, mediaminister">
<addon id="plugin.video.vrt.nu" name="VRT MAX" version="2.5.30" provider-name="Martijn Moreel, dagwieers, mediaminister">
<requires>
<import addon="resource.images.studios.white" version="0.0.22"/>
<import addon="script.module.beautifulsoup4" version="4.6.2"/>
Expand Down Expand Up @@ -42,6 +42,9 @@
<website>https://github.com/add-ons/plugin.video.vrt.nu/wiki</website>
<source>https://github.com/add-ons/plugin.video.vrt.nu</source>
<news>
v2.5.30 (2024-04-16)
- Fix playing from TV guide

v2.5.29 (2024-02-12)
- Fix program listings

Expand Down Expand Up @@ -72,48 +75,6 @@ v2.5.21 (2023-05-23)
- Fix 1080p for livestreams
- Remove All programs menu
- Fix paging in episode listings

v2.5.20 (2022-12-06)
- Fix all programs menu
- Fix latest episode API

v2.5.19 (2022-10-16)
- Fix categories and channels menu listings
- Fix resumepoints and Up Next integration
- Fix playing from VRT MAX url API interface

v2.5.18 (2022-10-07)
- Fix menu listings

v2.5.17 (2022-09-21)
- Fix watching VRT MAX abroad
- Fix 'My Programs' menu
- Fix login issue on Raspberry Pi

v2.5.16 (2022-09-13)
- Fix 'My Programs' menu
- Hide resumepoints error messages
- Implement new login api

v2.5.15 (2022-08-31)
- Fix add-on crash

v2.5.14 (2022-08-29)
- VRT MAX rebranding

v2.5.13 (2022-08-05)
- Support 1080p video on demand

v2.5.12 (2022-05-25)
- Fix playing from TV guide
- Fix listing programs with a single char in their name

v2.5.11 (2022-05-15)
- Fix "All programs", "Categories","Most recent", "Soon offline" and "Channels" menu

v2.5.10 (2022-04-29)
- Fix watching from the tv guide
- Fix season menu labels
</news>
<assets>
<icon>resources/media/icon.png</icon>
Expand Down
4 changes: 3 additions & 1 deletion plugin.video.vrt.nu/resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_sort(program_type):
ascending = False
elif program_type == 'oneoff':
sort = 'label'
elif program_type in 'reeksoplopend':
elif program_type in ('series', 'reeksoplopend'):
sort = 'episode'
elif program_type == 'reeksaflopend':
sort = 'episode'
Expand Down Expand Up @@ -793,6 +793,7 @@ def convert_programs(api_data, destination, use_favorites=False, **kwargs):
path=url_for(destination, end_cursor=end_cursor, **kwargs),
art_dict={'thumb': 'DefaultInProgressShows.png'},
info_dict={},
prop_dict={'SpecialSort': 'bottom'},
)
)
return programs
Expand Down Expand Up @@ -952,6 +953,7 @@ def convert_episodes(api_data, destination, use_favorites=False, **kwargs):
path=url_for(destination, end_cursor=end_cursor, **kwargs),
art_dict={'thumb': 'DefaultInProgressShows.png'},
info_dict={},
prop_dict={'SpecialSort': 'bottom'},
)
)
return episodes, sort, ascending
Expand Down
12 changes: 6 additions & 6 deletions plugin.video.vrt.nu/resources/lib/playerinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def push_upnext(self):
def update_position(self):
"""Update the player position, when possible"""
try:
last_pos = self.getTime()
pos = self.getTime()
# Kodi Player sometimes returns a time of 0.0 and this causes unwanted behaviour with VRT MAX Resumepoints API.
if last_pos > 0.0:
self.last_pos = last_pos
if pos > 0.0:
self.last_pos = pos
except RuntimeError:
pass

Expand Down Expand Up @@ -244,9 +244,9 @@ def virtualsubclip_seektozero(self):
def update_total(self):
"""Update the total video time"""
try:
total = self.getTotalTime()
tot = self.getTotalTime()
# Kodi Player sometimes returns a total time of 0.0 and this causes unwanted behaviour with VRT MAX Resumepoints API.
if total > 0.0:
self.total = total
if tot > 0.0:
self.total = tot
except RuntimeError:
pass
52 changes: 20 additions & 32 deletions plugin.video.vrt.nu/resources/lib/tvguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,42 +209,30 @@ def get_episode_items(self, date, channel):
@staticmethod
def get_stream_ids(episode_id=None):
"""Get videoId and publicationId using VRT MAX REST API"""
from tokenresolver import TokenResolver
access_token = TokenResolver().get_token('vrtnu-site_profile_at')
from api import api_req
video_id = None
publication_id = None
if access_token:
headers = {
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/json',
graphql_query = """
query Stream($id: ID!) {
catalogMember(id: $id) {
...stream
}
}
graphql = """
query Stream($id: ID!) {
catalogMember(id: $id) {
...stream
}
}
fragment stream on Episode {
watchAction {
videoId
publicationId
}
}
"""
payload = {
'operationName': 'Stream',
'variables': {
'id': episode_id
},
'query': graphql,
fragment stream on Episode {
watchAction {
videoId
publicationId
}
}
from json import dumps
data = dumps(payload).encode('utf-8')
url = 'https://www.vrt.be/vrtnu-api/graphql/v1'
episode = get_url_json(url=url, cache=None, headers=headers, data=data, raise_errors='all').get('data').get('catalogMember')
if episode:
video_id = episode.get('watchAction').get('videoId')
publication_id = episode.get('watchAction').get('publicationId')
"""
operation_name = 'Stream'
variables = {
'id': episode_id
}
episode = api_req(graphql_query, operation_name, variables).get('data').get('catalogMember')
if episode:
video_id = episode.get('watchAction').get('videoId')
publication_id = episode.get('watchAction').get('publicationId')
return video_id, publication_id

def get_episode_path(self, episode, channel):
Expand Down

0 comments on commit 1f19a3e

Please sign in to comment.