Skip to content

Commit

Permalink
Merge pull request #119 from knackebrot/master
Browse files Browse the repository at this point in the history
New options: stream over HTTPS & stream with login
  • Loading branch information
phunkyfish authored Oct 22, 2018
2 parents bb7dd7f + 60aa65c commit 6bb1af4
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 7 deletions.
6 changes: 5 additions & 1 deletion pvr.vuplus/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.vuplus"
version="3.12.6"
version="3.13.0"
name="Enigma2 Client"
provider-name="Joerg Dembski and Ross Nicholson">
<requires>@ADDON_DEPENDS@</requires>
Expand Down Expand Up @@ -175,6 +175,10 @@
<disclaimer lang="zh_TW">這是測試版軟體!其原創作者並無法對於以下情況負責,包含:錄影失敗,不正確的定時設定,多餘時數,或任何產生的其它不良影響...</disclaimer>
<platform>@PLATFORM@</platform>
<news>
v3.13.0
- Added: New setting to enable streaming over HTTPS
- Added: New setting to enable authentication for streaming

v3.12.6
- Fixed: Windows build fix
- Fixed: tsbuffer.ts never got deleted, fixes #115
Expand Down
4 changes: 4 additions & 0 deletions pvr.vuplus/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.13.0
- Added: New setting to enable streaming over HTTPS
- Added: New setting to enable authentication for streaming

v3.12.6
- Fixed: Windows build fix
- Fixed: tsbuffer.ts never got deleted, fixes #115
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,15 @@ msgctxt "#30065"
msgid "On pause"
msgstr ""

#empty strings from id 30066 to 30069
msgctxt "#30066"
msgid "Use secure HTTP (https) for streams"
msgstr ""

msgctxt "#30067"
msgid "Use login for streams"
msgstr ""

#empty strings from id 30068 to 30069

msgctxt "#30070"
msgid "Recordings & Timers"
Expand Down
18 changes: 17 additions & 1 deletion pvr.vuplus/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@
</dependencies>
<control type="edit" format="integer" />
</setting>
<setting id="use_secure_stream" type="boolean" label="30066">
<level>0</level>
<default>false</default>
<dependencies>
<dependency type="enable" setting="autoconfig">false</dependency>
</dependencies>
<control type="toggle" />
</setting>
<setting id="use_login_stream" type="boolean" label="30067">
<level>0</level>
<default>false</default>
<dependencies>
<dependency type="enable" setting="autoconfig">false</dependency>
</dependencies>
<control type="toggle" />
</setting>
</group>
</category>

Expand Down Expand Up @@ -297,4 +313,4 @@
</group>
</category>
</section>
</settings>
</settings>
14 changes: 12 additions & 2 deletions src/enigma2/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ void Settings::ReadFromAddon()

if (!XBMC->GetSetting("streamport", &m_iPortStream))
m_iPortStream = DEFAULT_STREAM_PORT;


if (!XBMC->GetSetting("use_secure_stream", &m_bUseSecureHTTPStream))
m_bUseSecureHTTPStream = false;

if (!XBMC->GetSetting("use_login_stream", &m_bUseLoginStream))
m_bUseLoginStream = false;

//General
if (!XBMC->GetSetting("onlinepicons", &m_bOnlinePicons))
m_bOnlinePicons = true;
Expand Down Expand Up @@ -159,6 +165,10 @@ ADDON_STATUS Settings::SetValue(const std::string &settingName, const void *sett
return SetSetting<bool>(settingName, settingValue, m_bAutoConfig, ADDON_STATUS_OK);
else if (settingName == "streamport")
return SetSetting<int>(settingName, settingValue, m_iPortStream, ADDON_STATUS_NEED_RESTART);
else if (settingName == "use_secure_stream")
return SetSetting<bool>(settingName, settingValue, m_bUseSecureHTTPStream, ADDON_STATUS_NEED_RESTART);
else if (settingName == "use_login_stream")
return SetSetting<bool>(settingName, settingValue, m_bUseLoginStream, ADDON_STATUS_NEED_RESTART);
//General
else if (settingName == "onlinepicons")
return SetSetting<bool>(settingName, settingValue, m_bOnlinePicons, ADDON_STATUS_NEED_RESTART);
Expand Down Expand Up @@ -229,4 +239,4 @@ ADDON_STATUS Settings::SetStringSetting(const std::string &settingName, const vo
bool Settings::IsTimeshiftBufferPathValid() const
{
return XBMC->DirectoryExists(m_strTimeshiftBufferPath.c_str());
}
}
4 changes: 4 additions & 0 deletions src/enigma2/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ namespace enigma2
const std::string& GetPassword() const { return m_strPassword; }
bool GetAutoConfigLiveStreamsEnabled() const { return m_bAutoConfig; }
int GetStreamPortNum() const { return m_iPortStream; }
bool UseSecureConnectionStream() const { return m_bUseSecureHTTPStream; }
bool UseLoginStream() const { return m_bUseLoginStream; }

//General
bool GetUseOnlinePicons() const { return m_bOnlinePicons; }
Expand Down Expand Up @@ -131,6 +133,8 @@ namespace enigma2
std::string m_strPassword = "";
bool m_bAutoConfig = false;
int m_iPortStream = DEFAULT_STREAM_PORT;
bool m_bUseSecureHTTPStream = false;
bool m_bUseLoginStream = false;

//General
bool m_bOnlinePicons = true;
Expand Down
11 changes: 9 additions & 2 deletions src/enigma2/data/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ bool Channel::UpdateFrom(TiXmlElement* channelNode, const std::string &enigmaURL

m_m3uURL = StringUtils::Format("%s/web/stream.m3u?ref=%s", enigmaURL.c_str(), WebUtils::URLEncodeInline(m_serviceReference).c_str());

m_streamURL = StringUtils::Format("http://%s:%d/%s", Settings::GetInstance().GetHostname().c_str(), Settings::GetInstance().GetStreamPortNum(), tempString.c_str());
m_streamURL = StringUtils::Format(
"http%s://%s%s:%d/%s",
Settings::GetInstance().UseSecureConnectionStream() ? "s" : "",
Settings::GetInstance().UseLoginStream() ? StringUtils::Format("%s:%s@", Settings::GetInstance().GetUsername().c_str(), Settings::GetInstance().GetPassword().c_str()).c_str() : "",
Settings::GetInstance().GetHostname().c_str(),
Settings::GetInstance().GetStreamPortNum(),
tempString.c_str()
);

if (Settings::GetInstance().GetUseOnlinePicons())
{
Expand All @@ -89,4 +96,4 @@ void Channel::UpdateTo(PVR_CHANNEL &left) const
left.iEncryptionSystem = 0;
left.bIsHidden = false;
strncpy(left.strIconPath, m_iconPath.c_str(), sizeof(left.strIconPath));
}
}

0 comments on commit 6bb1af4

Please sign in to comment.