Frndly TV for Channels

When in doubt, reboot!

@matthuisman
Can you add gracenote station ID 73067 for the new channel, Bounce
Showing as

},
"102": {
  "gracenote": null,
  "slug": "bounce_hd"
}

Thanks

thanks :slight_smile:
code added. should be live soon when it next runs
image

1 Like

Looks like it updated about 20 minutes ago. I refreshed the lineups and guide data and it looks good!

1 Like

Getting error "Exception: Unauthorized access" from the Frndly for Channels docker container once or twice a month.
It can happen when Channels DVR tries to start a recording or fetch lineup or guide data.
Appears that Frndly for Channels logs in, but then gets an error that it's not logged in.
I'm using KEEP_ALIVE=0 since I had problems in the past if I don't have that set.

If it happens trying to start a recording or fetch guide data, Channels DVR will retry and succeed.
This one happened on a lineup refresh during the daily morning guide fetch and wasn't retried by Channels DVR, so the lineup refresh failed.

Can this be fixed in the Frndly for Channels code, or can we get Channels DVR to retry the lineup refresh.

Normal Channels DVR log entries

2024/03/06 09:08:05.030223 [M3U] Refreshed lineup for frndlyTV with 44 channels
2024/03/06 09:08:05.570563 [M3U] Refreshed lineup for frndlyTVNoEpg with 5 channels
2024/03/06 09:08:07.317270 [DVR] Fetched guide data for XMLTV-frndlyTVNoEpg in 1s
2024/03/06 09:08:08.031652 [DVR] Indexed 536 airings into XMLTV-frndlyTVNoEpg (5 channels over 74h15m21s) + 0 skipped [708ms index]
2024/03/06 09:08:08.138981 [DVR]   pruned 16 replaced airings in 107ms.
2024/03/06 09:08:08.208927 [DVR] Fetching guide data for 45 stations in X-M3U @ 2024-03-06 9:00AM

Channels DVR log showing this error (500 Internal Server Error)

2024/03/07 09:02:04.429600 [ERR] Unexpected m3u response for frndlyTV: 500 Internal Server Error
2024/03/07 09:02:09.585542 [M3U] Refreshed lineup for frndlyTVNoEpg with 5 channels
2024/03/07 09:02:11.351353 [DVR] Fetched guide data for XMLTV-frndlyTVNoEpg in 1s
2024/03/07 09:02:11.938229 [DVR] Indexed 507 airings into XMLTV-frndlyTVNoEpg (5 channels over 74h8m29s) + 0 skipped [581ms index]
2024/03/07 09:02:12.017896 [DVR]   pruned 29 replaced airings in 79ms.
2024/03/07 09:02:12.156503 [DVR] Fetching guide data for 45 stations in X-M3U @ 2024-03-07 9:00AM

Frndly for Channels docker log showing error (Exception: Unauthorized access)

2024-03-07T17:02:00.472806655Z 401
2024-03-07T17:02:00.473605198Z Unauthorized access
2024-03-07T17:02:00.473759450Z logging in....
2024-03-07T17:02:04.107915679Z Logged in!
2024-03-07T17:02:04.429110646Z 401
2024-03-07T17:02:04.429541386Z Unauthorized access
2024-03-07T17:02:04.429609043Z 172.18.0.1 - - [07/Mar/2024 09:02:04] "GET /playlist.m3u?gracenote=include HTTP/1.1" 500 -
2024-03-07T17:02:04.430251544Z ----------------------------------------
2024-03-07T17:02:04.430501718Z Exception happened during processing of request from ('172.18.0.1', 36993)
2024-03-07T17:02:04.555505032Z Traceback (most recent call last):
2024-03-07T17:02:04.555966513Z   File "/usr/local/lib/python3.8/socketserver.py", line 683, in process_request_thread
2024-03-07T17:02:04.556474086Z     self.finish_request(request, client_address)
2024-03-07T17:02:04.556711985Z   File "/usr/local/lib/python3.8/socketserver.py", line 360, in finish_request
2024-03-07T17:02:04.556863838Z     self.RequestHandlerClass(request, client_address, self)
2024-03-07T17:02:04.556964588Z   File "./app.py", line 25, in __init__
2024-03-07T17:02:04.557062209Z     super().__init__(*args, **kwargs)
2024-03-07T17:02:04.557155255Z   File "/usr/local/lib/python3.8/socketserver.py", line 747, in __init__
2024-03-07T17:02:04.557264696Z     self.handle()
2024-03-07T17:02:04.557402091Z   File "/usr/local/lib/python3.8/http/server.py", line 435, in handle
2024-03-07T17:02:04.557532678Z     self.handle_one_request()
2024-03-07T17:02:04.557637457Z   File "/usr/local/lib/python3.8/http/server.py", line 423, in handle_one_request
2024-03-07T17:02:04.557744826Z     method()
2024-03-07T17:02:04.557838151Z   File "./app.py", line 55, in do_GET
2024-03-07T17:02:04.557949155Z     self._error(e)
2024-03-07T17:02:04.558039653Z   File "./app.py", line 53, in do_GET
2024-03-07T17:02:04.558134297Z     routes[func]()
2024-03-07T17:02:04.558223799Z   File "./app.py", line 71, in _playlist
2024-03-07T17:02:04.558318040Z     channels = frndly.channels()
2024-03-07T17:02:04.558442274Z   File "/usr/src/app/frndly.py", line 150, in channels
2024-03-07T17:02:04.558545339Z     rows = self._request('https://frndlytv-api.revlet.net/service/api/v1/tvguide/channels?skip_tabs=0')['data']
2024-03-07T17:02:04.558671956Z   File "/usr/src/app/frndly.py", line 133, in _request
2024-03-07T17:02:04.558774626Z     return self._request(url, params=params, login_on_failure=False)
2024-03-07T17:02:04.558877439Z   File "/usr/src/app/frndly.py", line 136, in _request
2024-03-07T17:02:04.558974519Z     raise Exception(data['error']['message'])
2024-03-07T17:02:04.559083798Z Exception: Unauthorized access
2024-03-07T17:02:04.559174499Z ----------------------------------------
2024-03-07T17:02:05.059305366Z 401
2024-03-07T17:02:05.059533484Z Unauthorized access
2024-03-07T17:02:05.059638819Z logging in....
2024-03-07T17:02:08.697292470Z Logged in!
2024-03-07T17:02:09.579882278Z 172.18.0.1 - - [07/Mar/2024 09:02:09] "GET /playlist.m3u?gracenote=exclude HTTP/1.1" 200 -

UPDATE:
Here's an example of the same failure when trying to record a channel.
I had just redeployed the docker container and scheduled a recording.

2024-03-09T00:10:26.552408216Z Starting server on port 80
2024-03-09T00:13:28.557148275Z 192.168.64.1 - - [08/Mar/2024 16:13:28] "GET / HTTP/1.1" 200 -
2024-03-09T00:13:28.578457993Z 192.168.64.1 - - [08/Mar/2024 16:13:28] "GET /favicon.ico HTTP/1.1" 404 -
2024-03-09T02:00:00.024854352Z logging in....
2024-03-09T02:00:04.287387698Z Logged in!
2024-03-09T02:00:04.607717706Z 401
2024-03-09T02:00:04.607952306Z Unauthorized access
2024-03-09T02:00:04.608974843Z 192.168.64.1 - - [08/Mar/2024 18:00:04] "GET /play/story_tv.m3u8 HTTP/1.1" 500 -
2024-03-09T02:00:04.609683994Z ----------------------------------------
2024-03-09T02:00:04.609907510Z Exception happened during processing of request from ('192.168.64.1', 45161)
2024-03-09T02:00:04.632207222Z Traceback (most recent call last):
2024-03-09T02:00:04.632997021Z   File "/usr/local/lib/python3.8/socketserver.py", line 683, in process_request_thread
2024-03-09T02:00:04.633548360Z     self.finish_request(request, client_address)
2024-03-09T02:00:04.633720228Z   File "/usr/local/lib/python3.8/socketserver.py", line 360, in finish_request
2024-03-09T02:00:04.633837886Z     self.RequestHandlerClass(request, client_address, self)
2024-03-09T02:00:04.633935647Z   File "./app.py", line 25, in __init__
2024-03-09T02:00:04.634035020Z     super().__init__(*args, **kwargs)
2024-03-09T02:00:04.634131409Z   File "/usr/local/lib/python3.8/socketserver.py", line 747, in __init__
2024-03-09T02:00:04.634233477Z     self.handle()
2024-03-09T02:00:04.634385425Z   File "/usr/local/lib/python3.8/http/server.py", line 435, in handle
2024-03-09T02:00:04.634522244Z     self.handle_one_request()
2024-03-09T02:00:04.634618073Z   File "/usr/local/lib/python3.8/http/server.py", line 423, in handle_one_request
2024-03-09T02:00:04.634720326Z     method()
2024-03-09T02:00:04.634810519Z   File "./app.py", line 55, in do_GET
2024-03-09T02:00:04.634920302Z     self._error(e)
2024-03-09T02:00:04.635014419Z   File "./app.py", line 53, in do_GET
2024-03-09T02:00:04.635110977Z     routes[func]()
2024-03-09T02:00:04.635203125Z   File "./app.py", line 64, in _play
2024-03-09T02:00:04.635296942Z     url = frndly.play(slug)
2024-03-09T02:00:04.635480512Z   File "/usr/src/app/frndly.py", line 51, in play
2024-03-09T02:00:04.635630441Z     data = self._request(f'https://frndlytv-api.revlet.net/service/api/v1/page/stream', params=params)
2024-03-09T02:00:04.635768813Z   File "/usr/src/app/frndly.py", line 136, in _request
2024-03-09T02:00:04.635869198Z     raise Exception(data['error']['message'])
2024-03-09T02:00:04.635968507Z Exception: Unauthorized access
2024-03-09T02:00:04.636060791Z ----------------------------------------
2024-03-09T02:00:05.968864097Z 401
2024-03-09T02:00:05.969104764Z Unauthorized access
2024-03-09T02:00:05.969294364Z logging in....
2024-03-09T02:00:09.885293533Z Logged in!
2024-03-09T02:00:10.256087072Z channel/live/story_tv > https://sr-live-weigel.akamaized.net/v1/master/840a24ccd7c75076211d060179b3ad0c64fdc6ca/weigel_movies_nr_rt_new/689b3a2588e6474dac8dbd1219113d21/index.m3u8?...&startTime=1709949600
2024-03-09T02:00:10.571484710Z 192.168.64.1 - - [08/Mar/2024 18:00:10] "GET /play/story_tv.m3u8 HTTP/1.1" 302 -

Channels DVR failed the first attempt, retried and was able to start recording.

2024/03/08 18:00:00.003940 [DVR] Starting job 1709949600-ch9026 Modern Marvels on ch=[9026]
2024/03/08 18:00:04.611663 [ERR] Failed to start stream on channel 9026 via M3U-frndlyTV: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/story_tv.m3u8: 500 Internal Server Error
2024/03/08 18:00:04.611737 [DVR] Error running job 1709949600-ch9026 Modern Marvels: could not start stream on channels=[9026]: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/story_tv.m3u8: 500 Internal Server Error
2024/03/08 18:00:05.644000 [DVR] Starting job 1709949600-ch9026 Modern Marvels on ch=[9026]
2024/03/08 18:00:11.079733 [TNR] Opened connection to M3U-frndlyTV for ch9026 Story Television
2024/03/08 18:00:11.080015 [DVR] Recording for job 1709949600-ch9026 from M3U-frndlyTV ch9026 into "TV/Modern Marvels/Modern Marvels S11E17 2005-04-26 The Basement 2024-03-08-1800.mpg" for 1h0m54.355854612s

I removed KEEP_ALIVE=0 a couple days ago when I redeployed the container. Will see if that helps. Although I think that's the default in the latest version from 2023-04-08 I was and am running.

Is anyone else seeing this?

If the FrndlyTV for Channels container is logged out of FrndlyTV when a recording starts, Channels DVR always has to retry 3 times to get the master playlist.
The first 3 times Channels DVR shows a 504 Gateway Time-out.
Must be that Channels DVR can't get the master playlist from FrndlyTV(akamaized.net), since the container gives Channels DVR a fresh playlist url every time.

Below is a combination of the Channels DVR log, FrndlyTV for Channels container log and the Channels DVR debug recording log.
Channels DVR log example          : 2024/03/11 15:00:00.000522 [DVR] Starting job 1710194400-ch9025 fyi every 8 hrs MON at 1500 on ch=[9025]
FrndlyTV for Channels log example : 2024-03-11T22:00:05.069714364Z 172.17.0.1 - - [11/Mar/2024 15:00:05] "GET /play/fyi.m3u8 HTTP/1.1" 302 -
CDVR debug record log example     : at=2024-03-11T15:00:15.597043636-07:00 tag=frndly-32 action=new_stream additional_playlists=

Job tries first time to record and fails with 504 Gateway Time-out error.

2024/03/11 15:00:00.000522 [DVR] Starting job 1710194400-ch9025 fyi every 8 hrs MON at 1500 on ch=[9025]
2024-03-11T22:00:00.391718803Z 401
2024-03-11T22:00:00.392630384Z Unauthorized access
2024-03-11T22:00:00.392841597Z logging in....
2024-03-11T22:00:04.382999852Z Logged in!
2024-03-11T22:00:04.728709154Z channel/live/fyi > https://sr-live-ae.akamaized.net/v1/master/840a24ccd7c75076211d060179b3ad0c64fdc6ca/live_v3_nr_ae/0de5960457f74c6da3ce7e751d605d66/index.m3u8?...&hdnts=st=1710194404~exp=1710216004...&start=1710194400&startTime=1710194400
2024-03-11T22:00:05.069714364Z 172.17.0.1 - - [11/Mar/2024 15:00:05] "GET /play/fyi.m3u8 HTTP/1.1" 302 -
2024/03/11 15:00:05.576574 [ERR] Failed to start stream on channel 9025 via M3U-frndlyTV: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out
2024/03/11 15:00:05.576664 [DVR] Error running job 1710194400-ch9025 fyi every 8 hrs MON at 1500: could not start stream on channels=[9025]: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out

Job tries second time to record and fails with 504 Gateway Time-out error.

2024/03/11 15:00:06.630625 [DVR] Starting job 1710194400-ch9025 fyi every 8 hrs MON at 1500 on ch=[9025]
2024-03-11T22:00:06.989965208Z channel/live/fyi > https://sr-live-ae.akamaized.net/v1/master/840a24ccd7c75076211d060179b3ad0c64fdc6ca/live_v3_nr_ae/0de5960457f74c6da3ce7e751d605d66/index.m3u8?...&hdnts=st=1710194406~exp=1710216006...&start=1710194400&startTime=1710194400
2024-03-11T22:00:07.318181024Z 172.17.0.1 - - [11/Mar/2024 15:00:07] "GET /play/fyi.m3u8 HTTP/1.1" 302 -
2024/03/11 15:00:07.590639 [ERR] Failed to start stream on channel 9025 via M3U-frndlyTV: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out
2024/03/11 15:00:07.590711 [DVR] Error running job 1710194400-ch9025 fyi every 8 hrs MON at 1500: could not start stream on channels=[9025]: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out

Job tries third time to record and fails with 504 Gateway Time-out error.

2024/03/11 15:00:09.607877 [DVR] Starting job 1710194400-ch9025 fyi every 8 hrs MON at 1500 on ch=[9025]
2024-03-11T22:00:09.936240354Z channel/live/fyi > https://sr-live-ae.akamaized.net/v1/master/840a24ccd7c75076211d060179b3ad0c64fdc6ca/live_v3_nr_ae/0de5960457f74c6da3ce7e751d605d66/index.m3u8?...&hdnts=st=1710194409~exp=1710216009...&start=1710194400&startTime=1710194400
2024-03-11T22:00:10.255940496Z 172.17.0.1 - - [11/Mar/2024 15:00:10] "GET /play/fyi.m3u8 HTTP/1.1" 302 -
2024/03/11 15:00:10.575325 [ERR] Failed to start stream on channel 9025 via M3U-frndlyTV: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out
2024/03/11 15:00:10.575405 [DVR] Error running job 1710194400-ch9025 fyi every 8 hrs MON at 1500: could not start stream on channels=[9025]: M3U: Could not fetch playlist from 192.168.1.3:8183: GET: http://192.168.1.3:8183/play/fyi.m3u8: 504 Gateway Time-out

Job tries fourth time to record and succeeds. Debug recording log starts.

2024/03/11 15:00:14.592985 [DVR] Starting job 1710194400-ch9025 fyi every 8 hrs MON at 1500 on ch=[9025]
2024-03-11T22:00:14.920097048Z channel/live/fyi > https://sr-live-ae.akamaized.net/v1/master/840a24ccd7c75076211d060179b3ad0c64fdc6ca/live_v3_nr_ae/0de5960457f74c6da3ce7e751d605d66/index.m3u8?...&hdnts=st=1710194414~exp=1710216014...&start=1710194400&startTime=1710194400
2024-03-11T22:00:15.244955319Z 172.17.0.1 - - [11/Mar/2024 15:00:15] "GET /play/fyi.m3u8 HTTP/1.1" 302 -
at=2024-03-11T15:00:15.596676174-07:00 tag=frndly-32 action=parseMasterPlaylist url=http://192.168.1.3:8183/play/fyi.m3u8 status="200 OK" playlists=4 time=1.003158504s
at=2024-03-11T15:00:15.597043636-07:00 tag=frndly-32 action=new_stream additional_playlists=
at=2024-03-11T15:00:15.762350182-07:00 tag=frndly-32 action=fetchMediaPlaylist url="https://sr-live-ae.akamaized.net/v1/manifest/840a24ccd7c75076211d060179b3ad0c64fdc6ca/live_v3_nr_ae/ef3a4f70-2136-41e0-a5c3-4e3e4df6c03d/1.m3u8?hdntl=exp=1710280815~acl=/*~data=hdntl~hmac=HMAC" status_code=200 status="200 OK" content_length=819 playlist_count=3 target_duration=4s first_sequence=3515527 last_sequence=3515529 time=165.209208ms
at=2024-03-11T15:00:15.762566868-07:00 tag=frndly-32 action=stream_created url=http://192.168.1.3:8183/play/fyi.m3u8 media_playlists=4 adaptive_bitrate=false offline=false
2024/03/11 15:00:15.762777 [TNR] Opened connection to M3U-frndlyTV for ch9025 FYI
2024/03/11 15:00:15.763032 [DVR] Recording for job 1710194400-ch9025 from M3U-frndlyTV ch9025 into "TV/fyi every 8 hrs/fyi every 8 hrs 2024-03-11-1500.mpg" for 9m45.40687593s

Didn't help. Still getting the Exception: Unauthorized access
And still getting the 3 retries to record if logged out when the recording starts.
At least Channels DVR recovers from these, except when it happens during a lineup refresh.

I notice interruptions on some recording also when it starts to record.

Thanks. Good to hear it's not just me.

The only issue this seems to cause is not getting lineup refreshes when it happens at that time since Channels DVR doesn't retry in that case.

It does retry fetching guide data and starting a recording when it happens.

I see the same "401" and "Unauthorized access" "logging in" and "Logged in!"entries in my Frndly container log. They seem to be there once or twice each day. I haven't noticed any problems with recordings. I don't see any "504 Gateway time-out" errors in the DVR logs.

1 Like

Those are all normal. If the container needs to interact with the FrndlyTV service, it has to login to do it.

Thanks. I thought that might be the case. But, wasn't quite sure

Hi all, I am trying to get this working again after a year of not using it. I updated to the latest docker. It produces the proper url sources but the m3u link comes up with Error: "Expecting value: line 1 column 1 (char 0)"

I tried intentionally providing the wrong username and password in the docker and it still produces the same result. I get no error for invalid username or password. So it seems that its not trying to log in.

Any thoughts?

Check the FrndlyTV for Channels docker container log to see what it says.
First 3 lines should be
2024-03-09T22:54:47.317347417Z Starting server on port 80
2024-03-09T22:57:04.200357424Z logging in....
2024-03-09T22:57:07.806706381Z Logged in!

First lines are:

Starting server on port 80
172.17.0.1 - - [18/Mar/2024 04:21:47] "GET / HTTP/1.1" 200 -
172.17.0.1 - - [18/Mar/2024 04:21:47] "GET / HTTP/1.1" 200 -
logging in....
172.17.0.1 - - [18/Mar/2024 04:21:49] "GET /playlist.m3u8?gracenote=include HTTP/1.1" 500 -

Then it says:
Exception happened during processing of request from ('172.17.0.1', 60050)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Looks like it couldn't login to the FrndlyTV server or you would see this in the log
Logged in!

Check the environment values in the container and make sure your USERNAME and PASSWORD were assigned correctly.

I did get it to work by using a VPN. (I'm in Canada). Using just the environment values in the container doesn't seem to work no matter what ip address I use.

That would explain it. The service is only available in the US and its territories.

Yeah, I was just confused because I was able to use it before, using just the env ip with a US ip in the docker run command, without using the VPN. I don't know what changed. I'm glad I got it working. Thanks for your help.

Can someone explain to me like a 5th grader how to install FrndlyTV? I have a subscription and installed the docker image on a Synology NAS. When trying to add the source to ChannlesDVR, I get the following error: " invalid source url: Get "http://192.168.1.40:8183/playlist.m3u8?gracenote=include": context deadline exceeded (Client.Timeout exceeded while awaiting headers)".

The docker image log shows the following:

> Starting server on port 80
> 
> 172.17.0.1 - - [20/Mar/2024 18:07:46] "GET / HTTP/1.1" 200 -
> 
> logging in....
> 
> 192.168.1.40 - - [20/Mar/2024 18:08:38] "GET /playlist.m3u8?gracenote=include HTTP/1.1" 500 -
> 
> ----------------------------------------
> 
> Exception happened during processing of request from ('192.168.1.40', 53367)
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
>     resp = conn.urlopen(
>   File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
>     retries = retries.increment(
>   File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment
>     raise MaxRetryError(_pool, url, error or ResponseError(cause))
> urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='frndlytv-api.revlet.net', port=443): Max retries exceeded with url: /service/api/v1/get/token?box_id=SHIELD30X8X4X0&device_id=43&tenant_code=frndlytv&device_sub_type=nvidia%2C8.1.0%2C7.4.4&product=frndlytv&display_lang_code=eng&timezone=Pacific%2FAuckland (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fb83cfe7d90>, 'Connection to frndlytv-api.revlet.net timed out. (connect timeout=15)'))
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File "./app.py", line 53, in do_GET
>     routes[func]()
>   File "./app.py", line 71, in _playlist
>     channels = frndly.channels()
>   File "/usr/src/app/frndly.py", line 150, in channels
>     rows = self._request('https://frndlytv-api.revlet.net/service/api/v1/tvguide/channels?skip_tabs=0')['data']
>   File "/usr/src/app/frndly.py", line 116, in _request
>     self.login()
>   File "/usr/src/app/frndly.py", line 186, in login
>     headers['session-id'] = requests.get('https://frndlytv-api.revlet.net/service/api/v1/get/token', params=params, headers=headers, timeout=TIMEOUT).json()['response']['sessionId']
>   File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 73, in get
>     return request("get", url, params=params, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 59, in request
>     return session.request(method=method, url=url, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
>     resp = self.send(prep, **send_kwargs)
>   File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
>     r = adapter.send(request, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 553, in send
>     raise ConnectTimeout(e, request=request)
> requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='frndlytv-api.revlet.net', port=443): Max retries exceeded with url: /service/api/v1/get/token?box_id=SHIELD30X8X4X0&device_id=43&tenant_code=frndlytv&device_sub_type=nvidia%2C8.1.0%2C7.4.4&product=frndlytv&display_lang_code=eng&timezone=Pacific%2FAuckland (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fb83cfe7d90>, 'Connection to frndlytv-api.revlet.net timed out. (connect timeout=15)'))
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.8/socketserver.py", line 683, in process_request_thread
>     self.finish_request(request, client_address)
>   File "/usr/local/lib/python3.8/socketserver.py", line 360, in finish_request
>     self.RequestHandlerClass(request, client_address, self)
>   File "./app.py", line 25, in __init__
>     super().__init__(*args, **kwargs)
>   File "/usr/local/lib/python3.8/socketserver.py", line 747, in __init__
>     self.handle()
>   File "/usr/local/lib/python3.8/http/server.py", line 435, in handle
>     self.handle_one_request()
>   File "/usr/local/lib/python3.8/http/server.py", line 423, in handle_one_request
>     method()
>   File "./app.py", line 55, in do_GET
>     self._error(e)
>   File "./app.py", line 30, in _error
>     self.wfile.write(f'Error: {message}'.encode('utf8'))
>   File "/usr/local/lib/python3.8/socketserver.py", line 826, in write
>     self._sock.sendall(b)
> BrokenPipeError: [Errno 32] Broken pipe
> ----------------------------------------
1 Like

Looks like the FrndlyTV server is timing out when the container tries to Login, but I'm no Python expert.
Doing a ping to it times out.

ping frndlytv-api.revlet.net
Pinging frndlytv-api-new-2089997564.us-east-1.elb.amazonaws.com [44.214.61.69] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 44.214.61.69:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Check the Environment Variables USERNAME and PASSWORD in the docker container to see if they reflect the correct USERNAME and PASSWORD using Synology Container Manager

Running a container using a docker run command requires escaping any special characters (like exclamation mark, quote marks, etc.) in your PASSWORD.

 --env '[email protected]'
 --env 'PASSWORD=monkey123'

It's easier using a docker compose.yaml.

    environment:
      - [email protected] # FrndlyTV username (the email you used to sign-up)
      - PASSWORD=monkey123 # FrndlyTV password (the password you chose when you signed-up)