Frndly TV for Channels

I got the 500 error again from what I believe it the latest container. It still only seems to happen when watching live after a while when it needs to re-authenticate, and then only once (after the error it works fine). Since recordings seem to work fine this doesn't seem like a huge deal for me, but here is a log from the most recent 500 error.

2021-11-23 16:47:54,stdout,----------------------------------------

2021-11-23 16:47:54,stdout,Exception: Failed to get response from url: https://frndlytv-api.revlet.net/service/api/v1/page/stream

2021-11-23 16:47:54,stdout,    raise Exception('Failed to get response from url: {}'.format(url))

2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 122, in _request
"
2021-11-23 16:47:54,stdout,"    return self._request(url, login_on_failure=False)
"
2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 117, in _request
"
2021-11-23 16:47:54,stdout,"    data = self._request(f'https://frndlytv-api.revlet.net/service/api/v1/page/stream', params=params)
"
2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 155, in _play_path
"
2021-11-23 16:47:54,stdout,    self._play_path(f'channel/live/{slug}')

2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 128, in _play_slug
"
2021-11-23 16:47:54,stdout,    routes[func]()

2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 102, in do_GET
"
2021-11-23 16:47:54,stdout,    self._error(e)

2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 104, in do_GET
"
2021-11-23 16:47:54,stdout,    method()

2021-11-23 16:47:54,stdout,"  File \"/usr/local/lib/python3.8/http/server.py\", line 415, in handle_one_request
"
2021-11-23 16:47:54,stdout,    self.handle_one_request()

2021-11-23 16:47:54,stdout,"  File \"/usr/local/lib/python3.8/http/server.py\", line 427, in handle
"
2021-11-23 16:47:54,stdout,    self.handle()

2021-11-23 16:47:54,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 747, in __init__
"
2021-11-23 16:47:54,stdout,"    super().__init__(*args, **kwargs)
"
2021-11-23 16:47:54,stdout,"  File \"./app.py\", line 76, in __init__
"
2021-11-23 16:47:54,stdout,"    self.RequestHandlerClass(request, client_address, self)
"
2021-11-23 16:47:54,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 360, in finish_request
"
2021-11-23 16:47:54,stdout,"    self.finish_request(request, client_address)
"
2021-11-23 16:47:54,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 683, in process_request_thread
"
2021-11-23 16:47:54,stdout,Traceback (most recent call last):

2021-11-23 16:47:54,stdout,"Exception happened during processing of request from ('10.0.1.28', 39828)
"
2021-11-23 16:47:54,stdout,----------------------------------------

2021-11-23 16:47:54,stdout,10.0.1.28 - - [23/Nov/2021 16:47:54] "GET /play2/game_show_network HTTP/1.1" 500 -

2021-11-23 16:47:54,stdout,logged in!

2021-11-23 16:47:52,stdout,logging in....
1 Like

hmm, i wonder if it just needs a bit of delay after logging in before trying to play...

Not sure how you guys get this to happen.
I've never seen my container need to re-login at all..
hmm

UPDATE:
Try the latest image. This is a good rewrite of the entire thing.
And also a small 2 second delay after logging in that hopefully solves your error 500 issue

Also, for anyone who doesn't want to run docker
the code can now quite easily run outside of Docker just using Python.

Just requires requests to be installed in python (pip install requests)

Then you run it with
python app.py PORT USERNAME PASSWORD IP (IP is optional)
eg
python app.py 8183 "[email protected]" "mypassword" "72.229.28.185"

then access it as normal with http://127.0.0.1:8183

I did this mainly to make it easier to test - but others may find it useful

1 Like

I really don't know what's going on, but it seems like the 500 issue on first live watch with re-authentication from a channels app is still there (I can see the delay in the log timestamps!):

2021-11-24 16:50:04,stdout,----------------------------------------

2021-11-24 16:50:04,stdout,Exception: Failed to get response from url: https://frndlytv-api.revlet.net/service/api/v1/page/stream

2021-11-24 16:50:04,stdout,    raise Exception('Failed to get response from url: {}'.format(url))

2021-11-24 16:50:04,stdout,"  File \"/usr/src/app/frndly.py\", line 94, in _request
"
2021-11-24 16:50:04,stdout,"    return self._request(url, login_on_failure=False)
"
2021-11-24 16:50:04,stdout,"  File \"/usr/src/app/frndly.py\", line 89, in _request
"
2021-11-24 16:50:04,stdout,"    data = self._request(f'https://frndlytv-api.revlet.net/service/api/v1/page/stream', params=params)
"
2021-11-24 16:50:04,stdout,"  File \"/usr/src/app/frndly.py\", line 47, in play
"
2021-11-24 16:50:04,stdout,    url = frndly.play(slug)

2021-11-24 16:50:04,stdout,"  File \"./app.py\", line 59, in _play
"
2021-11-24 16:50:04,stdout,    routes[func]()

2021-11-24 16:50:04,stdout,"  File \"./app.py\", line 53, in do_GET
"
2021-11-24 16:50:04,stdout,    self._error(e)

2021-11-24 16:50:04,stdout,"  File \"./app.py\", line 55, in do_GET
"
2021-11-24 16:50:04,stdout,    method()

2021-11-24 16:50:04,stdout,"  File \"/usr/local/lib/python3.8/http/server.py\", line 415, in handle_one_request
"
2021-11-24 16:50:04,stdout,    self.handle_one_request()

2021-11-24 16:50:04,stdout,"  File \"/usr/local/lib/python3.8/http/server.py\", line 427, in handle
"
2021-11-24 16:50:04,stdout,    self.handle()

2021-11-24 16:50:04,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 747, in __init__
"
2021-11-24 16:50:04,stdout,"    super().__init__(*args, **kwargs)
"
2021-11-24 16:50:04,stdout,"  File \"./app.py\", line 28, in __init__
"
2021-11-24 16:50:04,stdout,"    self.RequestHandlerClass(request, client_address, self)
"
2021-11-24 16:50:04,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 360, in finish_request
"
2021-11-24 16:50:04,stdout,"    self.finish_request(request, client_address)
"
2021-11-24 16:50:04,stdout,"  File \"/usr/local/lib/python3.8/socketserver.py\", line 683, in process_request_thread
"
2021-11-24 16:50:04,stdout,Traceback (most recent call last):

2021-11-24 16:50:04,stdout,"Exception happened during processing of request from ('10.0.1.28', 40226)
"
2021-11-24 16:50:04,stdout,----------------------------------------

2021-11-24 16:50:04,stdout,10.0.1.28 - - [24/Nov/2021 16:50:04] "GET /play/game_show_network HTTP/1.1" 500 -

2021-11-24 16:50:02,stdout,Logged in!

2021-11-24 16:50:01,stdout,logging in....

I have not seen any errors yet. My first channels tuned with no issues after first login.

@trhill
Success!! finally found the issue of the 500 error. Pretty obvious in the end. silly me!

@everyone
Please update to latest Docker container.
The old container will probably stop working so best to move to latest.

and sorry again for the forced update.
Hopefully this is really the last last time....

2 Likes

@matthuisman

Is it safe to assume that if someone is running the app via Python that when the container version is updated that the person using Python should pull the latest version of the app as well ?

correct, also the python version now uses proper named arguments which are the same names as the docker environment variables.

eg.
python app.py --PORT 8183 --USERNAME "[email protected]" --PASSWORD "mypassword" --IP "72.229.28.185"

I'm using this app as a "template" of sorts.
Get it right once, and then can start producing a bunch of others all with the same features etc.

1 Like

Thank you again for this quick fix.
This is really a great addition to Channels and it is saving money on my Frndly TV subscription. So thanks a lot! My donation to you was well worth it. :slight_smile:

Nice! I've updated my container.

Thank you so much for all of your efforts. They are sincerely appreciated!

Thanks Matt.
Woke up this morning and tuned to a channel with no 500 errors. Good Job. Now if someone can figure out how to get a xmltv for the two channels Dove and Curiosity From Frndly's guide would make this a perfect fit for this addition to our Channels DVR.

ok, you should now be able to get a basic EPG (just title of program) for the channels that don't get it from Gracenote.

You need to do

  1. Update to latest container
  2. Change your current playlist url to: http://..../playlist.m3u?gracenote=include
    (this playlist will now only contain channels that have gracenote ids)
  3. ADD a new playlist
  4. Set its url to http://..../playlist.m3u?gracenote=exclude
    (this playlist will contain only channels that dont have a gracenote id)
  5. Add EPG for this playlist: http://..../epg.xml?gracenote=exclude
    (this epg will only contain epg data for channels that don't have gracenote id)

And that should do it

Hopefully in the future Channels will allow using both Gracenote IDs and an EPG together.
When that happens - the above 2nd playlist wouldn't be needed anymore

4 Likes

Thank you sir. It works perfectly. Happy Turkey Day. :turkey:

I just set this up today. I am getting an error that shows:
Could not parse playlist http://192.168.1.152:8183/play/history.m3u8: Can't detect playlist type

Would anyone be able to help me? Thanks

I it appears that Frndly has made some changes. Several Channels have the same error. It appears that the links are not m3u8 url's

Yes, for me A&E, History, Lifetime, and FYI are not working.

argh, looks like FrndlyTv is switching some channels over to MPD with DRM which Channels / ffmpeg don't support.

The latest container will now show an error for streams that are not supported.
You could use /playlist.m3u8?exclude=frndly-31,frndly-33 etc to remove them from playlist

i could make a Kodi FrndlyTv add-on that can support Widevine DRM, but that obviously doesn't help the Channels users much

1 Like

I wonder if there is any hope that Frndly won't do this to all the channels they carry. This ChannelsDVR "add-on" to get Frndly is pretty much the only reason why I got Frndly. Glad I didn't go for the annual subscription. Is there any hope of getting around this set back.

In the USA, at least, it is illegal to circumvent DRM.
Since Channels is and wants to remain 100% legal, they will never even remotely consider trying to get around DRM. I support this.

Sadly, once DRM is used by providers, it simply won't work in Channels.

Let's enjoy whatever is left while we can. :laughing:

To clarify I didn't mean to suggest circumventing the DRM. I agree everything should of course be legal. I meant is there a way to legally authenticate the DRM using our proper Frndly credentials like we do with the other channels Frndly offers. Or is this basically a "you use our app or nothing at all" type of thing even though we are paying for access to the stream?

1 Like

Authenticating (signing in) is totally different than DRM.
You need a client that supports their DRM method.
It's like the PBS stations that added DRM to their stream. The web player and apps can handle the DRM, but Channels cannot.