/F1Hub

Client for F1Hub

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

F1Hub

A Python Client to View F1TV Content the right way

F1Hub is a terminal application running directly on your computer -- no connection to the website needed* *In theory. As of now, the F1TV website is needed for some content

alt text

Features

What this is
  • No lenthy website load times
  • Even if the website is down, usually the API stays available, which means F1Hub will be working as well.
  • Designed to work with the 2021 updated F1TV API, delivering you 1080p50 streams by default.
  • Multi-Stream functionality: Unlike on the website, this tool opens as many streams as you like, enabling you to create your own Race Control at home.
  • Simply enter a Content ID (long number in the URL of a play page) in the content ID menu and immediately play! No long menu browsing required.

Anti-Features

What this is not

F1Hub is NOT a piracy tool. To use it, you will need to log in with your valid F1TV Credentials. To use livestream functionality, you will need to have an active F1TV Pro account. This program is not related to F1, F1TV, FIA or any other organization. This is a fan-made application designed to get the most out of the service F1TV provides.

Installation

Cool, how do I get it?

The simple way (Linux and MacOS, maybe Windows)

If you are on Linux (Tested on Ubuntu based systems) or MacOS, you can download the respective prepackaged file in the release tab. If you are on Windows, you will need to download the Linux package and use the Windows Subsystem for Linux In a terminal, navigate to the folder containing the downloaded file (most likely 'downloads') and enter

sudo chmod +x f1Hub-$version-$os
./f1Hub-$version-$os

If the above steps don't work, proceed with the following steps:

Dependencies

Special steps for Windows

One of F1Hub's dependencies doesn't work with Windows. To use it, you will have to use the Windows Subsystem For Linux You can find a guide on how to install and use it here

For all operating systems

First, let's install the dependencies. Make sure you have pip installed:

pip --version

If the command gives you an output, you're good to go. If it says that the command 'pip' was not found, follow the this guide to install pip on your machine: Now, use pip to install the needed dependencies

python3 -m pip install simple-term-menu pyperclip requests json

Some of these may already be preinstalled, depending on your machine and os. Next, install the video player MPV, according to this guide. To be sure, reboot your computer and type

mpv --version

into your Terminal to make sure it works and is in the PATH. Done! Now let's get the main program:

Main Program

Getting F1Hub

Download F1Hub, either by cloning the repository, or by downloading it directly from the releases tab. To clone it:

git clone https://github.com/kodosexe/f1hub

Now, you can simply run it by executing

cd f1Hub
python3 main.py

and you will be greeted by the Menu

Usage

How does it work?

First, you should login. For that, use the arrow keys to navigate to F1TV Login and choose Login by Password. It is stored in plaintext on your computer for now, though, so be careful! If you don't want to enter your password: You will need to open F1TV in your browser, right-click anywhere on the page, and select "Inspect" from the menu. In the bar that opens, select the "Network" tab. Check the box saying "Preserve Log". In Firefox, this option will appear when you click on the gears and is named "Persist Logs" Now, log in, as with any other website. The tab should fill with a list of network requests. Once you are logged in, type "ENTITLEMENT" into the search bar of the inspector tab. There should be one entry of that name. Right click on the entry and select "Copy -> Copy Response". The information was copied to your clipboard In the folder containing F1Hub, open or create the file named "entitlement.json" and paste your clipboard.

After restarting F1Hub, you can use it fully. You may need to repeat that step occasionally. Usually, when F1Hub crashes and gives you an error, it will be due to entitlement or login issues.

How to work with the ContentID

To play a stream using content ID, first navigate to the video in your browser. You will see a long sequence of numbers in the URL, something like "1000000716". That is the content ID. Copy that number and paste it into F1Hub in the "Play by Content ID" menu. Proceed like normal.

Known Bugs

Whoopsie
  • 2020 Preaseason Testing doesn't include full sessions. This is because this is the only event that has a different API response structure. I plan on fixing this soon.
  • The menu sometimes spazzes out in seasons before 2018. This is because of long titles resulting by a mishandling of the API - this is low priority because these sessions have only one stream. The main purpose of this program is to provide a multi-stream service. However, I do plan on fixing it at some point down the line.
  • Some menus only show partial content, none at all, or provide no stream. The API pre-2017 is wildly different. I didn't realize until too late and it will be patched at some point. 2020-2018 Work flawlessly, though
  • 2021 Sessions and Info not available. Current season is not implemented yet, as there is no info on the buildup. It will come at some point before the season.
  • There is little to no error handling... if something goes wrong, it will crash. Please keep in mind, this program, including all API analysis was built in little over 24Hrs. It will have bugs and issues.

Planned Features

What the future has in stock
  • All the bug fixes!
  • Better, more flexible menu structure, and a graphical UI down the line.
  • Live feature before the season's start -NOW AVAILABLE
  • 2021 Integration before the season's start -Available via ContentID feature
  • Any Event based on ID being able to be played, ideally before the season's start. -NOW AVAILABLE

I am now working on the first full release of F1Hub - It will have better menu structure, better aesthetics, proper error handling, safer password login and native and easy windows support.

Disclaimer

Just to cover my back

This program is provided as is, with no warranty whatsoever. I do not take responsibility for any damages or issues that may result from direct or indirect use of this program.