Quick and Easy Synology frndlytv-for-channels Setup
I was recently contacted via PM by a member who was having trouble setting frndlytv-for-channels up on a Synology. Since I went through the basic procedure in PM with them, I figured I should include it here for other members who may be searching for a way to implement frndlytv-for-channels on a Synology but may be new to (or intimidated) by Docker. And the best part of this method is you don't really have to do anything with Container Manager, or Compose or Portainer or whatnot. Just need to use scheduled tasks.
First go to the Synology task scheduler [control panel] - [task scheduler].
Next from the menu bar [create] - [scheduled task] - [user defined script].
Under general you can call it whatever you want. For user, I have only ever used root as my user for all my installation tasks. But I imagine any administrator account with full permissions will work fine.
Under task settings send run details to whatever email account you want to be notified about success/failure. Since this is going to be an on demand manual task, do not select "send run details only when the script terminates abnormally". You want to know if it runs at all or if its been successful or failed, so you always want to be notified. In the user defined script, use what I have listed below the screenshot, making sure to change your username and password accordingly.
That script will remove any previous version of frndlytv-for-channels (don't worry you won't lose any settings in ChannelsDVR) and install (update) frndlytv-for-channels. There are two additional --env variables in the screenshot that can be ignored by most users. The IP helps LocalNow correctly geolocate (especially if you are behind a VPN). The KEEP_ALIVE helps with rare recording failures due to timeouts (and is explained much higher up in this thread). Neither of these variables should be needed by most users.
Hit the [OK] button (or SAVE or ACCEPT or the equivalent). You will likely get a warning message about using root or an administrator account. Select [OK] if you have the basic understanding that those accounts are powerful and you are proceeding at your own risk. You may even be ask for the account Synology password to complete the task creation.
On the schedule task list right click this new task and select [RUN] - [OK].
In a couple of minutes you should get an email stating it completed normally (or if there where errors, what those errors were).
You can confirm the docker is running correctly by going to the frndlytv-for-channels status page at http://SYNOLOGY-IP:8183/ substituting SYNOLOGY-IP with the address of the Synology server hosting your dockers. The status page should look something like below (URLs will be different for you).
Nice writeup. Thanks for sharing it.
Much easier for new users to use the task manager than trying to ssh in and run shell commands.
Docker commands do require user root to run them, so you could remove the sudo -s in the script commands, although leaving them in doesn't hurt.
I use sudo - after connecting via SSH to get a root user shell when executing docker commands.
I don't think this approach is better over the Synology provided tools but if you want to script it then run your docker pull as the very first step (and a better choice would be to throw in some kind of guard to exit the script if you can not pull the image. sudo -s docker pull ..... || exit 1)
The reason you want to pull first is that pulling is likely the longest step and the one that has the potential for failure. If you stop and rm the container first then you run the likely risk that you can't run again, or at least you aren't going to run a new image.
Again, this really isn't an approach you should be using unless you're comfortable with troubleshooting when things go off and you'll need to shell in to do any of that and run docker commands. Best is to stick with the tools that are provided, either the graphical Docker interface or the newer Container Station interface.
Looks like its back up but I can't get the docker channels script to work.
I am able to log onto the website now but frndlytv docker integration still not working.
Ok I wrote an error in the script its working .. My fault.
Hello! Channels newbie here. I thought I'd give it a test run this month, along with the Frndly TV docker. But I'm going to try setting it all up in Unraid, and I don't see any previous experiences in this thread. The Frndly docker is not listed in their community app store, so I'll be configuring it manually. Does anyone with experience have any advice or recommendations before I get started?
Hopefully you have Portainer available, and if so here's what your stack should look like:
version: '3.9'
services:
frndlytv-for-channels:
image: matthuisman/frndlytv-for-channels
container_name: frndlytv-for-channels
environment:
- IP=${IP} # For Geo-locating FrndlyTV to a different area
- USERNAME=${USERNAME} # FrndlyTV username (the email you used to sign-up)
- PASSWORD=${PASSWORD} # FrndlyTV password (the password you chose when you signed-up)
ports:
- '8185:80'
restart: unless-stopped
I have been using Python via terminal on my mac for months and as of today it's not connecting. I am wondering if the upgrade they said they did last night is causing this. Does anyone know?
Look for errors in the terminal output.
I run the docker version, which uses the same python in a container and I look at the docker container log.
Maybe it's not logging you in or throwing some other error.
I do see an error from earlier today that it recovered from.
2023-09-06T22:51:57.309398102Z 172.18.0.1 - - [06/Sep/2023 15:51:57] "GET /playlist.m3u?gracenote=include HTTP/1.1" 200 -
2023-09-06T22:51:57.310767541Z 172.18.0.1 - - [06/Sep/2023 15:51:57] "GET /playlist.m3u?gracenote=include HTTP/1.1" 500 -
2023-09-06T22:51:57.311177721Z ----------------------------------------
2023-09-06T22:51:57.311416424Z Exception happened during processing of request from ('172.18.0.1', 35089)
2023-09-06T22:51:57.312023359Z Traceback (most recent call last):
2023-09-06T22:51:57.312295606Z File "./app.py", line 53, in do_GET
2023-09-06T22:51:57.312528780Z routes[func]()
2023-09-06T22:51:57.312713166Z File "./app.py", line 118, in _playlist
2023-09-06T22:51:57.312894550Z self.wfile.write(f'#EXTINF:-1 channel-id="{channel_id}" tvg-id="{channel_id}" tvg-logo="{logo}"{gracenote_id}{chno},{name}\n{url}\n'.encode('utf8'))
2023-09-06T22:51:57.313063392Z File "/usr/local/lib/python3.8/socketserver.py", line 826, in write
2023-09-06T22:51:57.313200405Z self._sock.sendall(b)
2023-09-06T22:51:57.313299780Z BrokenPipeError: [Errno 32] Broken pipe
2023-09-06T22:51:57.313485836Z
2023-09-06T22:51:57.313587099Z During handling of the above exception, another exception occurred:
2023-09-06T22:51:57.313865133Z
2023-09-06T22:51:57.313972677Z Traceback (most recent call last):
2023-09-06T22:51:57.314080808Z File "/usr/local/lib/python3.8/socketserver.py", line 683, in process_request_thread
2023-09-06T22:51:57.314193236Z self.finish_request(request, client_address)
2023-09-06T22:51:57.314287785Z File "/usr/local/lib/python3.8/socketserver.py", line 360, in finish_request
2023-09-06T22:51:57.314445226Z self.RequestHandlerClass(request, client_address, self)
2023-09-06T22:51:57.314553026Z File "./app.py", line 25, in __init__
2023-09-06T22:51:57.314651969Z super().__init__(*args, **kwargs)
2023-09-06T22:51:57.314751022Z File "/usr/local/lib/python3.8/socketserver.py", line 747, in __init__
2023-09-06T22:51:57.314851514Z self.handle()
2023-09-06T22:51:57.314939037Z File "/usr/local/lib/python3.8/http/server.py", line 435, in handle
2023-09-06T22:51:57.315040469Z self.handle_one_request()
2023-09-06T22:51:57.315132571Z File "/usr/local/lib/python3.8/http/server.py", line 423, in handle_one_request
2023-09-06T22:51:57.315232514Z method()
2023-09-06T22:51:57.315319537Z File "./app.py", line 55, in do_GET
2023-09-06T22:51:57.315444593Z self._error(e)
2023-09-06T22:51:57.315538390Z File "./app.py", line 29, in _error
2023-09-06T22:51:57.315642954Z self.end_headers()
2023-09-06T22:51:57.315736112Z File "/usr/local/lib/python3.8/http/server.py", line 537, in end_headers
2023-09-06T22:51:57.315838469Z self.flush_headers()
2023-09-06T22:51:57.315931251Z File "/usr/local/lib/python3.8/http/server.py", line 541, in flush_headers
2023-09-06T22:51:57.316031368Z self.wfile.write(b"".join(self._headers_buffer))
2023-09-06T22:51:57.316128545Z File "/usr/local/lib/python3.8/socketserver.py", line 826, in write
2023-09-06T22:51:57.316226146Z self._sock.sendall(b)
2023-09-06T22:51:57.316313297Z BrokenPipeError: [Errno 32] Broken pipe
2023-09-06T22:51:57.316453382Z ----------------------------------------
2023-09-06T22:52:53.650749217Z 172.18.0.1 - - [06/Sep/2023 15:52:53] "GET /playlist.m3u?gracenote=include HTTP/1.1" 200 -
And after looking further, it appears to be a bug in Channels DVR that caused this after updating to the latest pre-release version.
No issues with FrndlyTV here, using the Docker container. BTW, there's really no functional difference using a Python application like this running in a Docker container vs running it from the command line.
The idea with a Docker container, is to minimize issues with dependencies, and to isolate the application from the host OS to reduce attack vectors and the like. It also makes testing substantially easier for developers, as you only need to test for the OS environment that exists inside the container.
I see from your post history in this thread that you moved from Docker to running the application directly on the Mac OS. If you continue to have issues, you may want to consider moving back to Docker for the above stated reasons.