From 3acc2fd687175d4768530f6983b9149566388217 Mon Sep 17 00:00:00 2001 From: pietje666 Date: Mon, 2 Oct 2017 01:55:40 +0200 Subject: [plugin.video.vrt.nu] 1.0.0 (#1439) --- plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py | 1 - .../resources/lib/vrtplayer/urltostreamservice.py | 8 ++++---- plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py | 10 ++++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'plugin.video.vrt.nu/resources') diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py index c2df058..7edcccd 100644 --- a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py +++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py @@ -42,7 +42,6 @@ class KodiWrapper: stream = stream_service.get_stream_from_url(path) if stream is not None: play_item = xbmcgui.ListItem(path=stream.stream_url) - play_item.setMimeType('application/x-mpegURL') if stream.subtitle_url is not None: play_item.setSubtitles([stream.subtitle_url]) xbmcplugin.setResolvedUrl(self._handle, True, listitem=play_item) diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py index 1d3cecc..f295d65 100644 --- a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py +++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py @@ -44,13 +44,13 @@ class UrlToStreamService: '"email": "%s"}' % (uid, sig, ts, cred.username) response = self._session.post("https://token.vrt.be", data=data, headers=headers) - securevideo_url = "{0}.securevideo.json".format(self.__cut_slash_if_present(url)) + securevideo_url = "{0}.mssecurevideo.json".format(self.__cut_slash_if_present(url)) securevideo_response = self._session.get(securevideo_url, cookies=response.cookies) json = securevideo_response.json() - mzid = list(json - .values())[0]['mzid'] - final_url = urlparse.urljoin(self._BASE_GET_STREAM_URL_PATH, mzid) + video_id = list(json + .values())[0]['videoid'] + final_url = urlparse.urljoin(self._BASE_GET_STREAM_URL_PATH, video_id) stream_response = self._session.get(final_url) hls = self.__get_hls(stream_response.json()['targetUrls']).replace("https", "http") diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py index 6d1f896..3b413ce 100644 --- a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py +++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py @@ -97,14 +97,20 @@ class VRTPlayer: if len(option_tags) != 0: title_items.extend(self.__get_episodes(option_tags)) else: - episodes = soup.find_all(class_="tile") - if len(episodes) != 0: + episodes_list_slider = soup.find(id="episodelist__slider") + if episodes_list_slider is not None: title_items.extend(self.__get_multiple_videos(soup)) else: title_items.extend(self.__get_single_video(relevant_path.url, soup)) return title_items + def __get_episodes(self, option_tags): + """ + This method gets all the episodes = seasons from the dropdownmenus on the vrt.nu website + :param option_tags: + :return: + """ title_items = [] for option_tag in option_tags: title = statichelper.replace_newlines_and_strip(option_tag.text) -- cgit v1.2.3