Frndly TV with Python on Windows without Docker: the easy way

If you currently subscribe to Frndly TV and you would like to integrate Frndly TV in your Channels DVR, this is for you, if the following conditions are all true:

I have created three Windows Batch files to make the process very easy. You can download them from my personal Google Drive and save them in your user directory (C:\Users\<your user ID>):

Instructions:

  1. open a Windows command prompt (Windows key + R, type "cmd", press Enter)

  2. type: install_frndly_for_channels_no_docker.bat (and press Enter)

  3. answer the questions asked (this terminal window will have to remain open 24/7 after this step is done)

  4. open another Windows command prompt

  5. type: create_frndly_sources_in_channels.bat (and press Enter)

  6. answer the questions asked (one of the questions pertains to the channel start number, which is the number at which you would like the Frndly TV channels to begin within Channels DVR.)

  7. refresh your Sources page on the server and you will see the new sources, and you will see the guide being downloaded

For running automatically after a reboot of your computer, you will need this:

And see these two posts:

Example (my user directory is C:\Users\mjitk):

First Batch script:

C:\Users\mjitk>install_frndly_for_channels_no_docker.bat

Please enter your Frndly TV email address: [Redacted]
Please enter your Frndly TV password: [Redacted]

Cloning the Frndly TV for Channels repository...

Changing directory to the cloned repository...

Installing the required Python packages...

Requirement already satisfied: requests in c:\users\mjitk\appdata\local\programs\python\python310\lib\site-packages (from -r requirements.txt (line 1)) (2.27.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\mjitk\appdata\local\programs\python\python310\lib\site-packages (from requests->-r requirements.txt (line 1)) (1.26.9)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\mjitk\appdata\local\programs\python\python310\lib\site-packages (from requests->-r requirements.txt (line 1)) (2022.5.18.1)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\mjitk\appdata\local\programs\python\python310\lib\site-packages (from requests->-r requirements.txt (line 1)) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in c:\users\mjitk\appdata\local\programs\python\python310\lib\site-packages (from requests->-r requirements.txt (line 1)) (3.3)

Running the Python application with your credentials...

Starting server on port 8183

At this point, minimize this terminal window and don't touch it. :slight_smile:

Second Batch script in another command prompt:

C:\Users\mjitk>create_frndly_sources_in_channels.bat

There is a Channels DVR server running on this computer.
If this is the server you want to use, enter 127.0.0.1 for the IP address.

IP address of the Channels DVR server (without port number): 127.0.0.1
Port number of the Channels DVR server: 8089

Which Frndly TV plan are you subscribed to? (Basic, Classic, or Premium): Premium
Please enter the channel number to start: 4000

Creating the first source on the server...
true
Creating the second source on the server...
true

Refresh the Sources page on the server to see the new Frndly TV sources.

On your server:

image

Of course, this would not be possible without the work from @matthuisman:

Wait -- I thought Docker was the easy way... :slight_smile:

1 Like

Thanks for putting this up so quickly.

I ran into this issue:

C:\Users\tbeck\Downloads>install_frndly_for_channels_no_docker.bat

Please enter your Frndly TV email address: email@gmail
Please enter your Frndly TV password: password

Cloning the Frndly TV for Channels repository...

'git' is not recognized as an internal or external command,
operable program or batch file.
Done.

Changing directory to the cloned repository...
The system cannot find the path specified.
Done.

Installing the required Python packages...
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
WARNING: You are using pip version 22.0.4; however, version 24.0 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.
Done.

Running the Python application with your credentials...
python: can't open file 'C:\Users\tbeck\Downloads\app.py': [Errno 2] No such file or directory

Sorry, I forgot that Git is not installed by default on Windows. I added it to the instructions.

Alright. Did all that but the cmd window closed afterwards and there's no frndly tv in the list of TVE providers in Channels DVR.

I did get a payload.json file in my user directory. I used the ip address of my computer. should I have used 127.0.0.1?

"limit": "2",
"name": "Frndly TV (no EPG)",
"numbering": "ignore",
"refresh": "24",
"source": "URL",
"start_number": "1100",
"type": "HLS",
"url": "http://10.0.0.108:8089:8183/playlist.m3u8?gracenote=exclude",
"xmltv_url": "http://10.0.0.108:8089:8183/epg.xml?gracenote=exclude",
"xmltv_refresh": "3600"

Tried adding a custom channel and got this:

It's obvious I don't know what I'm doing. LOL :crazy_face:

You're almost there. It looks like for the IP address of your Channels DVR server, you typed 10.0.0.108:8089 but the batch script expected only the IP address without the port number, which is assumed to be 8089 by default.

You have two choices at this point:

  1. Delete your sources and rerun the second script with only the IP address without the port number (10.0.0.108)
  2. Edit your current sources and remove the extra :8089 in all URLs

The first window? That shouldn't be the case, it should not close by itself.

I'll edit the payloal.json .

The second try didn't.

1 Like

Given the fact that poor @RyzenBeast is having trouble with it, I guess I didn't make it that easy after all. :laughing:

I really threw this together quickly and made some assumptions. My bad. Sorry, @RyzenBeast.

I will make some improvements and let you know when that's ready.

I have uploaded new versions of the Batch scripts to my Google Drive.

I think they are more user friendly now. :crossed_fingers:

It's fine to rerun them if they were already run before.

Success! THANK YOU!

Since I just dropped Spectrum due to their ridiculous price increase after coming off a 2-year promo, I'm dabbling here. The YTTV and Frndly TV combo seems to be the ticket but I'm looking at Hulu too because for a couple bucks more it's all in one app. Apparently Hulu TVE in Channels DVR is broken at the moment but I know this happens with YTTV from time to time as well.

That said, Is there a way to automate running the *.bat files at startup in the case of a system reboot?

Sure, here are the steps to run a batch file at startup in Windows:

  1. Create a Batch file: Write your commands in a text file and save it with a .bat extensionÂč.
  2. Create a Shortcut: Right-click on the batch file and select Create shortcut⁎.
  3. Open Startup Folder: Press the Win + R keyboard shortcut to launch the Run dialog. Type shell:startup and press Enter to open the Startup folder for the current user⁶. If you want the batch file to run for all users, type shell:common startup instead⁶.
  4. Paste the Shortcut: Once the Startup folder has been opened, paste the shortcut into the folder⁞.

Now, every time you start your computer, the batch file will run automatically. Please note that you might need administrative privileges to perform these steps⁔.

Source: Conversation with Copilot, 6/11/2024
(1) How to Create a Batch (.bat) File in Windows. https://www.youtube.com/watch?v=sODXtX7jdcI.
(2) How to make a .bat file autorun on pc startup - Stack Overflow. cmd - How to make a .bat file autorun on pc startup - Stack Overflow.
(3) Run Batch File (.BAT) on Startup in Windows - ShellHacks. how to run a batch file at startup in Windows - Search.
(4) How to create batch script files on Windows 11. How to create batch script files on Windows 11 | Windows Central.
(5) how do i autostart batch file on windows startup - Stack Overflow. cmd - how do i autostart batch file on windows startup - Stack Overflow.
(6) How to Run Batch File as Administrator Without Prompt in Windows 10. https://www.youtube.com/watch?v=BH8N2eVHvUY.
(7) How to Create a Batch (.bat) File in Windows 11 [Solution]. https://www.youtube.com/watch?v=8fnVlKyjmGI.
(8) How To Run Batch File On Windows Startup - StackHowTo. https://stackhowto.com/how-to-run-batch-file-on-windows-startup/.
(9) undefined. How to Run a Batch File Each Time the Computer Loads Windows.

For the first step, create your own Batch file that you can call run_frndly_tv_on_startup.bat with the following content:

REM Full path where the code from Github was downloaded
cd C:\Users\<user>\<...>\frndlytv-for-channels

REM Replace %FRNDLY_EMAIL% and %FRNDLY_PASSWORD% with their real values
python app.py --PORT 8183 --USERNAME "%FRNDLY_EMAIL%" --PASSWORD "%FRNDLY_PASSWORD%"

I'll check into this and report back later but I think I can test without doing a reboot by closing the cmd window and then running the batch file I create per the instructions above manually.

Good Lord, this reminds me of editing my autoexec.bat and config.sys files back in the DOS days to get things started up and configured!

1 Like

As luck would have it my PC decided to reboot last night and I hadn't yet done this task.

I wrote (copy / paste / fill in the blanks) the batch file this morning and gave it a spin by manually triggering the *.bat file shortcut from the startup directory with a double click and it loaded everything but in Channels DVR I had to manually load the m3u's from the sources screen. Is there a way to automate this procedure?

I know I'm a POA but others may enjoy having this information too!

Yes, it should be possible to automate the refresh of the sources.

I'm going to be busy for a few days.
I probably won't be able to get to it until the weekend.

1 Like

No rush! Thanks for all you've done this far! Much appreciated!

1 Like

Well, guess what? So did mine!
I guess we both got hit with an update.

That got me moving on this and here it is:

This is the content of the file. Notice on top of the file that you will need to modify the values to fit your setup.

@echo off

REM Modify the values between the quotation marks for your setup
set FRNDLY_EMAIL="[email protected]"
set FRNDLY_PASSWORD="password"
set DVR_IP="127.0.0.1"
set DVR_PORT="8089"
set DIRECTORY_WITH_PYTHON_CODE="C:\Users\mjitk\frndlytv-for-channels"

REM Only change the values after the '=' signs if your Frndly TV sources have different names
set "FRNDLY_SOURCE_WITH_EPG=Frndly TV (with EPG)"
set "FRNDLY_SOURCE_NO_EPG=Frndly TV (no EPG)"


REM !!! Do not change anything below this line !!!


REM Start the Python server for Frndly TV in a new window
cd %DIRECTORY_WITH_PYTHON_CODE%
start cmd /k python app.py --PORT 8183 --USERNAME "%FRNDLY_EMAIL%" --PASSWORD "%FRNDLY_PASSWORD%"

REM Wait 5 seconds
timeout /t 5

REM Check whether the Channels DVR server is running
curl http://%DVR_IP%:%DVR_PORT%/dvr | findstr  /I /C:"running"
set running=%ERRORLEVEL%

if %running% EQU 0 (
    REM The Channels DVR server is already running. 

    REM Reload the Frndly TV M3U sources on the server
    set "SOURCE_1=%FRNDLY_SOURCE_WITH_EPG: =%"
    set "SOURCE_2=%FRNDLY_SOURCE_NO_EPG: =%"
    curl -X POST "http://%DVR_IP%:%DVR_PORT%/providers/m3u/sources/%SOURCE_1%/refresh"
    curl -X POST "http://%DVR_IP%:%DVR_PORT%/providers/m3u/sources/%SOURCE_2%/refresh"
)
2 Likes

Note that if the Sources page was already open before this was run, you will probably have to refresh the browser tab to see the updates.

1 Like

I'll check it out as soon as I am done watching The Acolyte..