Skip to content

Commit

Permalink
Added: Re-Authentication for Videoland.
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Oct 31, 2024
1 parent e2a81da commit 34fe1e8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
5 changes: 5 additions & 0 deletions channels/channel.videoland/videolandnl/chn_videolandnl.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"order": 4,
"value": "type=\"select\" lvalues=\"30126|30127|30128\" default=\"0\" label=\"30081\"",
"id": "filter_premium"
},
{
"order": 5,
"id": "re-authenticate",
"value": "label=\"30129\" type=\"action\" action=\"RunScript(plugin.video.retrospect, 0, ?channel=channel.videoland.videolandnl&action=execute&command=log_off)\" option=\"close\""
}
]
}
6 changes: 6 additions & 0 deletions channels/channel.videoland/videolandnl/chn_videolandnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Union, List, Optional, Tuple

import pytz
import xbmc

from resources.lib import chn_class, contenttype, mediatype
from resources.lib.addonsettings import AddonSettings
Expand Down Expand Up @@ -438,6 +439,11 @@ def update_video_item(self, item: MediaItem) -> MediaItem:
# M3u8.set_input_stream_addon_input(stream)
return item

def log_off(self):
""" Force a logoff for the channel. """
self.__authenticator.log_off("", force=True)
xbmc.executebuiltin("Container.Refresh()")

def log_on(self, username=None, password=None) -> bool:
""" Logs on to a website, using an url.
Expand Down
6 changes: 5 additions & 1 deletion resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,11 @@ msgctxt "#30128"
msgid "Filter Premium"
msgstr ""

# empty strings from id 30129 to 30189
msgctxt "#30129"
msgid "Re-Authenticate"
msgstr ""

# empty strings from id 30130 to 30189

msgctxt "#30190"
msgid "Monday"
Expand Down
4 changes: 1 addition & 3 deletions resources/lib/authentication/gigyahandler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import time
import uuid
from typing import Optional

try:
Expand Down Expand Up @@ -155,7 +154,6 @@ def log_off(self, username) -> bool:
UriHandler.delete_cookie(domain=".gigya.com")
UriHandler.delete_cookie(domain=f".{self.realm}")
AddonSettings.set_setting(f"{self.realm}-jwt", "", store=LOCAL)
AddonSettings.set_setting(f"{self.realm}-deviceid", "", store=LOCAL)

self.__uid = None
self.__uid_signature = None
Expand Down Expand Up @@ -185,7 +183,7 @@ def get_authentication_token(self) -> Optional[str]:
# Get a generic token
url = "https://front-auth.videoland.bedrock.tech/v2/platforms/m6group_web/getJwt"
headers = {
"x-auth-device-id": f"{self._device_id}",
"x-auth-device-id": self._device_id,
"x-auth-gigya-signature": self.__uid_signature,
"x-auth-gigya-signature-timestamp": str(self.__uid_signature_timestamp),
"x-auth-gigya-uid": self.__uid
Expand Down
31 changes: 15 additions & 16 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,33 @@
<category id="channelsettings" label="30032">
<setting type="lsep" label="30063" />
<!-- start of active channels -->
<setting id="config_channel" type="select" label="30040" values="NPO Start|Videoland|Kijk.nl|GoPlay|Vier|Vijf|Zes|Zeven|VTM.be|Stievie|VRT NU|Ketnet|SVT Play|UR Play|TV4 Play" />
<setting id="config_channel" type="select" label="30040" values="NPO Start|Videoland|Kijk.nl|GoPlay|Vier|Vijf|Zes|Zeven|VTM.be|Stievie|VRT NU|SVT Play|UR Play|TV4 Play" />
<!-- end of active channels -->

<setting type="lsep" label="30032" />
<setting id="channel_00000000-0000-0000-0000-000000000000_none" label="30034" type="text" enable="false" visible="eq(-2,)" />

<!-- begin of channel settings -->
<!-- chn_ketnet.py -->
<setting id="channel_756FFEC8-B6BA-11E0-898D-1F434824019B_hls_over_dash" label="30099" type="bool" default="" visible="eq(-3,Ketnet)" />
<!-- chn_kijknl.py -->
<setting id="channel_271456ED-6E84-4FAB-A7AF-77A1C669F942_hls_over_dash" label="30099" type="bool" default="false" visible="eq(-4,Kijk.nl)" />
<setting id="channel_271456ED-6E84-4FAB-A7AF-77A1C669F942_hls_over_dash" label="30099" type="bool" default="false" visible="eq(-3,Kijk.nl)" />
<!-- chn_nos2010.py -->
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_username" type="text" label="30094" default="" visible="eq(-5,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password_set" label="30093" type="action" action="RunScript(plugin.video.retrospect, 0, ?action=encryptsetting&amp;settingid=channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password&amp;settingname=NPO.nl password&amp;tabfocus=102)" option="close" visible="eq(-6,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password" default="" visible="eq(-7,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_show_future" type="bool" default="true" label="30125" visible="eq(-8,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_username" type="text" label="30094" default="" visible="eq(-4,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password_set" label="30093" type="action" action="RunScript(plugin.video.retrospect, 0, ?action=encryptsetting&amp;settingid=channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password&amp;settingname=NPO.nl password&amp;tabfocus=102)" option="close" visible="eq(-5,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_password" default="" visible="eq(-6,NPO Start)" />
<setting id="channel_ED8FDB9C-3870-11E2-B1C2-192A6288709B_show_future" type="bool" default="true" label="30125" visible="eq(-7,NPO Start)" />
<!-- chn_svt.py -->
<setting id="channel_3AF9C61E-88B2-11E1-A03F-08F6BAE59B18_show_programs_folder" label="30582" type="bool" default="true" visible="eq(-9,SVT Play)" />
<setting id="channel_3AF9C61E-88B2-11E1-A03F-08F6BAE59B18_show_accessibility_videos" label="30587" type="bool" default="true" visible="eq(-10,SVT Play)" />
<setting id="channel_3AF9C61E-88B2-11E1-A03F-08F6BAE59B18_show_programs_folder" label="30582" type="bool" default="true" visible="eq(-8,SVT Play)" />
<setting id="channel_3AF9C61E-88B2-11E1-A03F-08F6BAE59B18_show_accessibility_videos" label="30587" type="bool" default="true" visible="eq(-9,SVT Play)" />
<!-- chn_tv4se.py -->
<setting id="set_refresh_token" label="30113" type="action" action="RunScript(plugin.video.retrospect, 0, ?channel=channel.se.tv4se&amp;channelcode=tv4segroup&amp;action=execute&amp;command=fetch_token)" option="close" visible="eq(-11,TV4 Play)" />
<setting id="set_refresh_token" label="30113" type="action" action="RunScript(plugin.video.retrospect, 0, ?channel=channel.se.tv4se&amp;channelcode=tv4segroup&amp;action=execute&amp;command=fetch_token)" option="close" visible="eq(-10,TV4 Play)" />
<!-- chn_urplay.py -->
<setting id="channel_9F0F57D6-B897-11E0-AF2E-92314924019B_mainlist_pages" type="number" label="30586" default="25" visible="eq(-12,UR Play)" />
<setting id="channel_9F0F57D6-B897-11E0-AF2E-92314924019B_mainlist_pages" type="number" label="30586" default="25" visible="eq(-11,UR Play)" />
<!-- chn_videolandnl.py -->
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_username" type="text" label="30094" default="" visible="eq(-13,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password" default="" visible="eq(-14,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password_set" label="30093" type="action" action="RunScript(plugin.video.retrospect, 0, ?action=encryptsetting&amp;settingid=channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password&amp;settingname=Videoland&amp;tabfocus=102)" option="close" visible="eq(-15,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_filter_premium" type="select" lvalues="30126|30127|30128" default="0" label="30081" visible="eq(-16,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_username" type="text" label="30094" default="" visible="eq(-12,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password" default="" visible="eq(-13,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password_set" label="30093" type="action" action="RunScript(plugin.video.retrospect, 0, ?action=encryptsetting&amp;settingid=channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_videolandnl_password&amp;settingname=Videoland&amp;tabfocus=102)" option="close" visible="eq(-14,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_filter_premium" type="select" lvalues="30126|30127|30128" default="0" label="30081" visible="eq(-15,Videoland)" />
<setting id="channel_C5182B93-6B71-44BE-948F-0B74E6C2BAA6_re-authenticate" label="30129" type="action" action="RunScript(plugin.video.retrospect, 0, ?channel=channel.videoland.videolandnl&amp;action=execute&amp;command=log_off)" option="close" visible="eq(-16,Videoland)" />
<!-- chn_vier.py -->
<setting id="viervijfzes_username" type="text" label="30094" default="" visible="eq(-17,Zeven)|eq(-17,Zes)|eq(-17,Vijf)|eq(-17,Vier)|eq(-17,GoPlay)" />
<setting id="viervijfzes_password_set" label="30093" type="action" action="RunScript(plugin.video.retrospect, 0, ?action=encryptsetting&amp;settingid=viervijfzes_password&amp;settingname=Vier/Vijf/Zes.be password&amp;tabfocus=102)" option="close" visible="eq(-18,Zeven)|eq(-18,Zes)|eq(-18,Vijf)|eq(-18,Vier)|eq(-18,GoPlay)" />
Expand Down

0 comments on commit 34fe1e8

Please sign in to comment.