BUG - PVR is Broken - FILMON API CHANGES

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Exclamation  PVR is Broken - FILMON API CHANGES
Post: #1
Hello,

Please be advised that this PVR should be marked as broken. I have tested with over 20 different Kodi instances that use this PVR, and all are not functioning as normal.

I believe Filmon have made updates to there API - Source: here

Faults:
  • Most accounts unable to login even paid for subscriptions
  • Recording - Unable to view content, this happened a few weeks ago, the content will simply not play. Although I have a work around in place for those that need it
  • Constant Errors - again if you are able to login, channels will randomly be blocked by Filmon with an access denied message

I am not a devloper so I lack the skill needed to make changes to this PVR addon. I am attempting to bring it to the developers/Team Kodis attention
(This post was last modified: 2016-11-12 17:36 by Drt1989.)
find quote
MikeKL Offline
Fan
Posts: 422
Joined: Aug 2014
Reputation: 47
Post: #2
pvr.filmon does at first glance appear to be unable to login with existing user login and password, following is log from Kodi Jarvis install running on macOS kodi.log

[Image: SaTpO77.jpg]

rPi 2, SanDisk Ultra 8Gb SD & Milhouse LE TestBuild (Kodi 18) -> Onkyo AV -> Philips 42" LCD TV
(This post was last modified: 2016-11-13 13:18 by MikeKL.)
find quote
MikeKL Offline
Fan
Posts: 422
Joined: Aug 2014
Reputation: 47
Post: #3
I have also added an issue to github, refering to this thread. https://github.com/kodi-pvr/pvr.filmon/issues/55

@Drt1989, Try not to post about the same issue/topic in many threads Wink

Lets hope a willing kodi developer will take a look at issue WinkCool

Cant find any specific information on any recent changes to API

Latest Filmon API info here

rPi 2, SanDisk Ultra 8Gb SD & Milhouse LE TestBuild (Kodi 18) -> Onkyo AV -> Philips 42" LCD TV
(This post was last modified: 2016-11-12 20:23 by MikeKL.)
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #4
Sorry I thought to make some noise about this lol. I do have the feeling this has been abandoned by its original developer.
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #5
I may have a look at the pvr and see if I can make any changes myself. However this is not my area and I have already been able to replace the pvr via use of third party addons, so it's not a priority. However after visiting 20+ customers today I'm very brain tried!
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #6
(2016-11-12 19:13)MikeKL Wrote:  I have also added an issue to github, refering to this thread. https://github.com/kodi-pvr/pvr.filmon/issues/55

@Drt1989, Try not to post about the same issue/topic in many threads Wink

Lets hope a willing kodi developer will take a look at issue WinkCool

Cant find any specific information on any recent changes to API

Latest Filmon API info here

I've looked into the FilmonAPI.cpp file that is part of this PVR. I've established that the login fault is due to issues with the session key.

Unable to login - the API request returns a HTTP 403 ERROR - FORBIDDEN.

As taken from my log:

20:39:17 T:2664 ERROR: AddOnLog: PVR Filmon Client: request failure
20:39:17 T:2664 ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
20:39:17 T:2664 ERROR: CCurlFile::Open failed with code 403 for http://www.filmon.com/tv/api/init?channe...BcWl0CEw==
20:39:17 T:2664 ERROR: AddOnLog: PVR Filmon Client: request failure
20:39:18 T:2664 ERROR: AddOnLog: PVR Filmon Client: ADDON_Create - Failed to connect to Filmon, check settings

This would leave me to believe that the app_id is no longer accepted by Filmon. Filmon's documentation reports that app_id is a unique key provided to the developer (i may be wrong here) See:

app_id : - a secret key , email to [email protected] to get one (use ‘foo’ for testing)

Above line taken from Filmons API documentation

Please forgive me here as I have no real programming knowledge, but I've used common sense and read the documentation to come to this conclusion..


@MikeKL are you able to update your github ticket with the above, hopefully this gets flagged. I may be wrong here but from my testing this is all I can find.


I will be doing more testing tomorrow if time permits

Regards

DRT
find quote
MikeKL Offline
Fan
Posts: 422
Joined: Aug 2014
Reputation: 47
Post: #7
@Drt1989 Yes I reached a similar limited knowledge conclusion after looking at errors within kodi.log I posted.

Code:
17:41:17 T:123145472315392   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
17:41:17 T:123145472315392   ERROR: CCurlFile::Open failed with code 403 for http://www.filmon.com/tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==
17:41:17 T:123145472315392   ERROR: AddOnLog: PVR Filmon Client: request failure

With reference to Method: init section of filmon API documentation.

Switched on debug logging in kodi, with verbose logging for libcURL enabled, here is Kodi debug log

When looking at additional debug information, don't know for sure but looks like successfully connecting to filmon server but then requesting HD stream "ftv_defq=hd" even though within the kodi pvr.filmon addon settings I have HD disabled?

extract
Code:
11:39:55 T:123145438474240   DEBUG: Curl::Debug - HEADER_OUT: Host: www.filmon.com
11:39:55 T:123145438474240   DEBUG: Curl::Debug - HEADER_OUT: Accept: */*
11:39:55 T:123145438474240   DEBUG: Curl::Debug - HEADER_OUT: Cookie: ftv_defq=hd; lang=en; ftv_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJGaWxtT25UViIsImF1ZCI6I​kZpbG1PblRWX01HTyIsImV4cCI6MTQ4MTAyODM3MCwibmJmIjoxNDc4NDM2MzEwLCJpYXQiOjE0Nzg0M​zYzNzAsInJlcXVlc3QiOnsidXNlciI6eyJpZCI6IjQyMTc2MjYzIiwiZW1haWwiOiJhdi5tZWRpYS5hb​nl0aW1lLmFueXdoZXJlQGdtYWlsLmNvbSIsImFmZmlkIjpudWxsLCJ2ZW5kb3JfaWQiOm51bGwsImN1c​nJlbnRfY291bnRyeSI6IkVTIiwicmVnaXN0ZXJfY291bnRyeSI6bnVsbH19fQ.iigeG-2MEiME9Ye_w-fE-Utz-azgiJR1PAaWC9YP3v4; PHPSESSID=5c97gtp1ej68etd8dveu4snpu7
11:39:55 T:123145438474240   DEBUG: Curl::Debug - HEADER_OUT: Accept-Charset: UTF-8,*;q=0.8
11:39:55 T:123145434181632    INFO: Python script stopped
11:39:55 T:123145434181632   DEBUG: Thread LanguageInvoker 123145434181632 terminating
11:39:55 T:123145438474240   DEBUG: Curl::Debug - TEXT: The requested URL returned error: 403
11:39:55 T:123145438474240   DEBUG: Curl::Debug - TEXT: Closing connection #0
11:39:55 T:123145438474240   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
11:39:55 T:123145438474240   ERROR: CCurlFile::Open failed with code 403 for http://www.filmon.com/tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==

[Image: LlOTBxM.jpg]

rPi 2, SanDisk Ultra 8Gb SD & Milhouse LE TestBuild (Kodi 18) -> Onkyo AV -> Philips 42" LCD TV
(This post was last modified: 2016-11-13 13:15 by MikeKL.)
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #8
(2016-11-13 12:32)MikeKL Wrote:  @Drt1989 Yes I reached a similar limited knowledge conclusion after looking at errors within kodi.log I posted.

Code:
17:41:17 T:123145472315392   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
17:41:17 T:123145472315392   ERROR: CCurlFile::Open failed with code 403 for http://www.filmon.com/tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==
17:41:17 T:123145472315392   ERROR: AddOnLog: PVR Filmon Client: request failure

With reference to Method: init section of filmon API documentation.

Switched on debug logging in kodi, with verbose logging for libcURL enabled, here is Kodi debug log

When looking at additional debug information, don't know for sure but looks like successfully connecting to filmon server but then requesting HD stream "ftv_defq=hd" even though within the kodi pvr.filmon addon settings I have HD disabled?


- From Internet sources it seems that there was once a way to get HD streams for free, (A third party add-on used this and has stopped working unless you untick HD streams) this has now been patched. I can try making an edit to SD but I am doubtful this will fix it. - Like you say no experience here but common sense.

I've E-mailed Filmon and they state I must be an affiliate. Something I may do.

Edit - I think the "ftv_defq=hd" is a red hearing - fault is still apparent even with a paid for HD Subscription.

I'm afraid to say I can't do any more I lack the skill and knowledge needed.
(This post was last modified: 2016-11-13 18:34 by Drt1989.)
find quote
Aristogiton Offline
Junior Member
Posts: 4
Joined: Nov 2016
Reputation: 1
Post: #9
The problem lies in the USER_AGENT which the embedded client uses for calling the init method. I tried, for example, to call using my default user agent and 'foo' & 'bar' as suggested for test: no way. The result was 'forbidden'.

Then I switched to this one: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' and magically the rest returned a nice json object with, among other things, a nice session key.

I suspect the "en-GB" can make the difference.

Good luck.
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #10
Interesting. From what I've read not an easy task to change the user agent, and I'm not so sure if it can be changed within one of the pvr files?

Total newb as you can see. Help appreciated!

- Basically having to recompile Kodi....... I'm lacking time/knowledge/need to do this although I do like trying new things to increase my knowledge.

One thing that puzzles me. The third party add on can play filmon streams.... So it must use a different agent?

I think this needs to be brought to teams kodis attention? Otherwise this PVR will die.
(This post was last modified: 2016-11-14 21:37 by Drt1989.)
find quote
Aristogiton Offline
Junior Member
Posts: 4
Joined: Nov 2016
Reputation: 1
Post: #11
There is no simple way to change kodi user-agent. But it's unnecessary. You should try instead to recompile the filmon.pvr with this simple fix.

https://github.com/kodi-pvr/pvr.filmon/b...monAPI.cpp - line 217:

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==");

should be

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==|User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");

or maybe better

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==|User-Agent=Mozilla%2F5.0%20(Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-GB%3B%20rv%3A1.9.0.3)%20Gecko%2F2008092417%20Firefox%2F3.0.3");

Hope this helps.


NOTE: en-GB is not the real trouble. User-agent has to be EXACTLY what I wrote. I really don't know why.
(This post was last modified: 2016-11-14 22:16 by Aristogiton.)
find quote
donbrew Offline
Senior Member
Posts: 260
Joined: Oct 2013
Reputation: 4
Post: #12
In my case it is not the pvr that isn't working it is the FilmOn addon. I have a free US account, when I click on a service that used to work I get a "FilmOn error, check the log" . That usually happens when a site is down.

The log says:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'module' object has no attribute 'PLAYER_CORE_MPLAYER'
Traceback (most recent call last):
File "/home/me/.kodi/addons/plugin.video.filmon/default.py", line 935, in <module>
IIIiI11ii1I ( IIIIii , oo0 , O0o0 , Ii1I1IIii1II , OOo0 , ii11I1 , oO0oo , Ii111iIi1iIi , '' , iiI111I1iIiI , i1I1ii11i1Iii , IIIII )
File "/home/me/.kodi/addons/plugin.video.filmon/default.py", line 797, in IIIiI11ii1I
xbmc . Player ( xbmc . PLAYER_CORE_MPLAYER ) . play ( O00OoOO0oo0 )
AttributeError: 'module' object has no attribute 'PLAYER_CORE_MPLAYER'
-->End of Python script error report<--
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #13
(2016-11-14 22:04)Aristogiton Wrote:  There is no simple way to change kodi user-agent. But it's unnecessary. You should try instead to recompile the filmon.pvr with this simple fix.

https://github.com/kodi-pvr/pvr.filmon/b...monAPI.cpp - line 217:

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==");

should be

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==|User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");

or maybe better

bool res = filmonRequest("tv/api/init?channelProvider=ipad&app_id=IGlsbSBuVCJ7UDwZBl0eBR4JGgEBERhRXlBcWl0CEw==|User-Agent=Mozilla%2F5.0%20(Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-GB%3B%20rv%3A1.9.0.3)%20Gecko%2F2008092417%20Firefox%2F3.0.3");

Hope this helps.


NOTE: en-GB is not the real trouble. User-agent has to be EXACTLY what I wrote. I really don't know why.

Any possible chance you are able to link me a compiled version with your edit - I am afraid to say I have 0 knowledge at all! If not I shall sludge my way through it (I can make the edit, just do not have the tools to compile)
find quote
Drt1989 Offline
Member
Posts: 88
Joined: Jun 2016
Reputation: 8
Post: #14
(2016-11-14 22:23)donbrew Wrote:  In my case it is not the pvr that isn't working it is the FilmOn addon. I have a free US account, when I click on a service that used to work I get a "FilmOn error, check the log" . That usually happens when a site is down.

The log says:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'module' object has no attribute 'PLAYER_CORE_MPLAYER'
Traceback (most recent call last):
File "/home/me/.kodi/addons/plugin.video.filmon/default.py", line 935, in <module>
IIIiI11ii1I ( IIIIii , oo0 , O0o0 , Ii1I1IIii1II , OOo0 , ii11I1 , oO0oo , Ii111iIi1iIi , '' , iiI111I1iIiI , i1I1ii11i1Iii , IIIII )
File "/home/me/.kodi/addons/plugin.video.filmon/default.py", line 797, in IIIiI11ii1I
xbmc . Player ( xbmc . PLAYER_CORE_MPLAYER ) . play ( O00OoOO0oo0 )
AttributeError: 'module' object has no attribute 'PLAYER_CORE_MPLAYER'
-->End of Python script error report<--

Was it by any chance a UK Channel you tried to play? Filmon are no longer (was never allowed too iirc) to broadcast UK TV in the USA. Also some Filmon Addons used a loop hole to show all streams in HD (read: 576p) but Filmon on have been making changes recently - see my source in first post.

Your Filmon App is not the same 3rd part app I use. Check in it's settings if it has a HD option if it does, make sure its not ticked.

I maybe wrong because it seems your error log relates to something other than I state above, but alas I am very new to programming.
find quote
donbrew Offline
Senior Member
Posts: 260
Joined: Oct 2013
Reputation: 4
Post: #15
(2016-11-14 22:33)Drt1989 Wrote:  Was it by any chance a UK Channel you tried to play? Filmon are no longer (was never allowed too iirc) to broadcast UK TV in the USA. Also some Filmon Addons used a loop hole to show all streams in HD (read: 576p) but Filmon on have been making changes recently - see my source in first post.

Your Filmon App is not the same 3rd part app I use. Check in it's settings if it has a HD option if it does, make sure its not ticked.

I maybe wrong because it seems your error log relates to something other than I state above, but alas I am very new to programming.

Well, some of the UK channels, the really crappy ones, have always been available in the US in 576P; And still are on the filmon.tv website. The Kodi addon does not get them. BTW, one of those channels is BBC News.
find quote
Post Reply