Skip to content
Permalink
Browse files

kodi: fix LE addons

accessing LE addon's is met with a 403 due to user-agent blocking,
fix this by matching their UA
  • Loading branch information...
adamg88 committed Jun 8, 2019
1 parent 40d89ff commit 286a20dd7eb63f9ff0daca49213fa311088e2299
Showing with 16 additions and 0 deletions.
  1. +16 −0 packages/mediacenter/kodi/patches/kodi-ce-005-fix-le-addons.patch
@@ -0,0 +1,16 @@
diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp
index 3169bb9..f7c3ab9 100644
--- a/xbmc/filesystem/CurlFile.cpp
+++ b/xbmc/filesystem/CurlFile.cpp
@@ -1000,6 +1000,11 @@ bool CCurlFile::Open(const CURL& url)

// setup common curl options
SetCommonOptions(m_state, m_failOnError && !CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->CanLogComponent(LOGCURL));
+
+ if(strcmp(url2.GetHostName().c_str(), "libreelec.tv")
+ || strcmp(url2.GetHostName().c_str(), "kodi.tv"))
+ g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_USERAGENT, "Kodi/18.2 (X11; Linux aarch64) LibreELEC/9.0 App_Bitness/32 Version/18.2-Git:18.2-Leia");
+
SetRequestHeaders(m_state);
m_state->m_sendRange = m_seekable;
m_state->m_bRetry = m_allowRetry;

6 comments on commit 286a20d

@lrusak

This comment has been minimized.

Copy link
Contributor

replied Jun 9, 2019

Wouldn't it be easier to supply your own add-ons for your users off of your own infrastructure?

I imagine this UA will get blocked at some point...

@adamg88

This comment has been minimized.

Copy link
Contributor Author

replied Jun 9, 2019

Wouldn't it be easier to supply your own add-ons for your users off of your own infrastructure?

If you had bothered to look before commenting then you would have realised that we already do.

I imagine this UA will get blocked at some point...

Because this is what reputable distributions do... block users from downloading addons.

@lrusak

This comment has been minimized.

Copy link
Contributor

replied Jun 9, 2019

Because this is what reputable distributions do... block users from downloading addons.

Your users aren't our users.

If you have your own repo what purpose does this commit serve?

@adamg88

This comment has been minimized.

Copy link
Contributor Author

replied Jun 9, 2019

Your users aren't our users.

Nonsense everybody knows that users bounce between distributions as and when it suits them, nevertheless no reasonable open-source distribution should be engaging in these sort of petty blocks, you would not see Debian purposefully blocking access to their repositories to users of Ubuntu now would you?

If you have your own repo what purpose does this commit serve?

It allows users to use the LE repo and then install LE addons on CE. 🤦‍♂

@lrusak

This comment has been minimized.

Copy link
Contributor

replied Jun 10, 2019

Your users aren't our users.

Nonsense everybody knows that users bounce between distributions as and when it suits them, nevertheless no reasonable open-source distribution should be engaging in these sort of petty blocks, you would not see Debian purposefully blocking access to their repositories to users of Ubuntu now would you?

If you have your own repo what purpose does this commit serve?

It allows users to use the LE repo and then install LE addons on CE. 🤦‍♂

So why do you filter your repo by user agent also then? We don't allow people to install from the CE repo as we wouldn't ever expect that from you guys. If you want to contribute to our project then there wouldn't be any issue but without an agreement in place we don't expect you to use our repo. Thanks for understanding.

If you rebrand and don't use the "Kodi" name anymore then you are expected to host the Kodi add-ons on your own repo instead of leaching off the Kodi name. Please keep that in mind.

@adamg88

This comment has been minimized.

Copy link
Contributor Author

replied Jun 10, 2019

So why do you filter your repo by user agent also then?

Rubbish, we have never placed such petty restrictions, we are better than to lower ourselves to the same low standards.

We don't allow people to install from the CE repo as we wouldn't ever expect that from you guys.

So you decide what users can and can not do now and think restricting liberties is appropriate? 👎

If you want to contribute to our project then there wouldn't be any issue but without an agreement in place we don't expect you to use our repo.

LE has had this user-agent blocking in place since long before CE existed so don't try and make this about something it has nothing to do with. We don't use your repo as I already explained to you in my last post, thank you for not understanding. If our users want to use the LE repo then we won't stop them, if you want to block them for whatever reason then well that just shows how petty you guys really are now doesn't it.

If you rebrand and don't use the "Kodi" name anymore then you are expected to host the Kodi add-ons on your own repo instead of leaching off the Kodi name. Please keep that in mind.

Not sure why this old chesnut got dragged into this discussion but yes we are already aware, thank you for reminding us again Constable Rusak.

Please sign in to comment.
You can’t perform that action at this time.