GithubHelp home page GithubHelp logo

f1viewer's Introduction

Go Report Card

f1viewer

preview image

Table of Contents

Installation

Note: You also need a compatible player installed, you can find a list here.

compile form source

Install the go compiler, then run the following commands

git clone https://github.com/SoMuchForSubtlety/f1viewer && cd f1viewer
go build .

Windows

macOS

  • You can install f1viewer with Homebrew (recommended)
     brew tap SoMuchForSubtlety/tap
     brew install SoMuchForSubtlety/tap/f1viewer
  • Or download the binary directly

Debian and Ubuntu

Download the latest release .deb file

Fedora, openSUSE, CentOS

  • Install from the f1viewer copr repo

    sudo dnf install dnf-plugins-core
    sudo dnf copr enable somuchforsubtlety/f1viewer
    sudo dnf install f1viewer
  • Or download the latest release .rpm file

Arch

Install the f1viewer AUR package.

Any other Linux distribution

Login

Login via email and password is currently broken dues to anti-bot measures from F1TV. Follow these steps to log in with your subscription token.

FAQ

why is there a login, what credentials should I use

You need an F1TV account created with an IP in a country that has F1TV pro. Use your F1TV account email and password to log in. You can use the tab key to navigate the login form.

when I try to play something I get a 4xx error

You need to be logged in and in a country that has F1TV pro. If you get the error but think your account should be able to play the selected content please open an issue.

f1viewer is not showing a live session / loading very slowly

This can happen if the F1TV servers are overloaded. There is nothing I can do to fix this. Start your stream as soon as possible at the start of the session and you can usually avoid this.

The player starts but then has some issue / error

Please make sure you are using the latest version of the player. If you use Windows please download MPV from here. Generally once an external program is started f1viewer is done and you should consult the external program's documentation for troubleshooting.

No players are detected

Players need to be in your PATH environment variable to be detected by f1viewer.

Config

When you first start f1viewer a boilerplate config is automatically generated. On Widows systems it's located in %AppData%\Roaming\f1viewer, on macOS in $HOME/Library/Application Support/f1viewer and on Linux in $XDG_CONFIG_HOME/f1viewer or $HOME/.config/f1viewer. You can access it quickly by running f1viewer -config.

Custom Commands

You can execute custom commands, for example to launch a different player. These are set in the config under custom_playback_options in the config file. You can add as many as you want.

[[custom_playback_options]]
  command = ["ffmpeg", "-hide_banner", "-loglevel", "error", "-i", "$url", "-c", "copy", "-f", "mp4", "$title.mp4"]
  proxy   = true
  title   = "Download as mp4"

title is the title. It will appear next to the standard Play with MPV and Copy URL to clipboard.

command is where your command goes. It is saved as a list of args like in the examples above. Every argument should be a separate string! The following would be incorrect! ["ffmpeg", "-i $url", "-c copy", "$title.mp4"]

proxy sends http requests through a proxy if they require cookies. This is useful for commands that use ffmpeg (and by extension mpv).

There are several placeholder variables you can use that will be replaced by f1viewer.

  • $url: the content's URL
  • $category: the content's category (eg. "Documentary")
  • $season: the season's year (eg. "2021")
  • $event: the event (eg. "Belgian Grand Prix")
  • $session: the session (eg. "F1 Practice 3")
  • $perspective: the perspective (eg. "F1 Live", "Kimi Räikkönen", etc.)
  • $title: the conten's title as reported by F1TV
  • $filename: the same as title, but with illegal characters removed
  • $series: "Formula 1", "Formula 2", etc.
  • $country: the country an event is held in
  • $circuit: the circuirt and event is held at
  • $time: the time of the session in RFC3339 format ($year, $month, $day, $hour and $minute are also available)
  • $date: the date of the session in ISO 8601 format
  • $ordinal: the ordinal numer of the event
  • $episodenumber: the episode number as reported by F1TV
  • $json: all metadata fields and the full source metadata from F1TV
  • $lang: the preferred languages as a comma separated list

If you have ideas for more variables feel free to open an issue.

Tip: To get Windows commands like echo, dir, etc. to work, you'll need to prepend them with "cmd", "/C", so for example ["echo", "hello"] turns into ["cmd", "/C", "echo", "hello"]

Multi Commands

To make it easy to load the same feeds with the same commands every time, you can map multiple commands to one action. The match_title variable will be used to match the session feeds (it also allows regex). For example, if match_title is Lando Norris, it will load any feed with that name, with the given command. You can specify commands directly with command, or reference one of your custom commands titles with command_key.

For an explanation on the command variable, see Custom Commands

[[multi_commands]]
  title = "Open F1 Live and HAM onboard"

  [[multi_commands.targets]]
    command     = ["mpv", "$url", "--alang=$lang"] # define a command to execute
    match_title = "F1 Live"

  [[multi_commands.targets]]
    command_key = "custom mpv"      # you can also reference previously defined custom commands
    match_title = "Lewis [a-zA-Z]+" # regex is also supported

Live Session Hooks

Live session hooks work like multi commands, but they are automatically started when a new live session is detected.

[[live_session_hooks]]
  title = "Open Pit Lane and Data Channel"

  [[live_session_hooks.targets]]
    command     = ["mpv", "$url", "--alang=$lang", "--quiet"] # define a command to execute
    match_title = "Pit Lane"

  [[live_session_hooks.targets]]
    command_key = "custom mpv"      # you can also reference previously defined custom commands
    match_title = "Data Channel"

Key Bindings

  • arrow keys or h, j, k, l.
  • tab to cycle through the login form fields
  • enter to select / confirm
  • q to quit

Logs

By default f1viewer saves all info and error messages to log files. Under Windows and macOS they are save in the same directory as the config file, on Linux they are saved to $HOME/.local/share/f1viewer/. You can access them quickly by running f1viewer -logs. Saving logs can also be turned off in the config.

Credentials

Your login credentials for F1TV are not saved in the config file. On macOS they are stored in the keychain and on Windows the credential store is used. If you're using Linux, where they are saved depends on your distro. Generally Pass, Secret Service / GNOME Keyring and KWallet are supported. If it does not work on your distro or you encounter any problems please open an issue.

f1viewer's People

Contributors

brett824 avatar bviolier avatar chrisvaughn avatar dependabot-preview[bot] avatar dependabot[bot] avatar emyarod avatar hdr avatar herbstein avatar hkgranli avatar jbpratt avatar jfoster avatar nsunderland1 avatar peskdale avatar skinza avatar skynewz avatar somuchforsubtlety avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f1viewer's Issues

Way to possible load custom .lua scripts for mpv

Any way to launch custom .lua scripts with action MPV?

Currently i trying launch script https://gitlab.com/lvml/mpv-plugin-excerpt with config

	{
            "title": "Play with MPV (Lua script)",
            "commands": [
		["mpv", "$url", "--alang=de --lua excerpt.lua"]
            ],
            "watchphrase": "Video",
            "command_to_watch": 0
        }

Scripts excerpt.lua and excerpt_copy placed in same directory as mpv/ffmpeg and commandline tell its loaded mpv https://f1tv-cdn-cent-live.formula1.com/ondemand/ce1c/_C_/3/2/wif0630041637/1/clip_2_master.m3u8?nva=1562911769&ttl=86400&cc=&token=0a6cfda24a469e6be08aa "--alang=de --lua excerpt.lua", but script not work.

Login/2019 Season

Good Morning ;)

I've been looking into an easy way to watch/stream F1 on my linux machine. Managed to compile this, got it running too.

2 questions: So far I don't see the 2019 FP1, the VOD on f1tv is already there though.

How would I log in? I didn't see any way to actually input my credentials for f1tv. Or am I completely missing something here?

Sorry for the beginner questions. :)

Control on Windows

Hello,
how are you supposed to control the tool? On windows 10 it does not take any key inputs nor can I find any doc about it. I can log in but not select anything else.

My player cannot read the m3u8

I do not know why it no longer works. F1viewer can get the m3u8 file easily but my video player cannot connect to the server of liberty.

this happens on pretty much any video in 2019, some in 2018. But for instance the padock pass plays well. I tried on two different computers with different ISPs and I disable the windows firewall.
this is the data.m3u8 i try to play

in my player, I paste also the ''FullStreamURL'' of the stream i seek but that fails too. i try one fo the URL written in the m3u8 file directly, and it fails too.

I also try with the MPV player and the data stream is played

I also tried on portable vlc, VLCPortable_3.0.7.paf stock settings and it does not work. I can play other m3u8 files non-related to f1 without problem.

[BUG] Crash on Austrian GP Practice 1 List Options

Describe the bug
Similar Bug to #48. When I select the Austrian GP 2020, Practice 1 the program crashes.
Bug is also reintroduced on 2019 Full Race Weekends as in #48

To Reproduce
Steps to reproduce the behavior:
Select 2020 Austrian GP Practice 1

Expected behaviour
List options to play with mpv, copy url etc.

Desktop (please complete the following information):

  • OS: Windows 10
  • Downloaded v1.1.0 from Github
  • Version 1.1.0

Logs

2020/07/03 13:09:43 [INFO] logged in!
2020/07/03 13:09:43 [INFO] checking for live session
2020/07/03 13:11:32 [INFO] logged in!
2020/07/03 13:11:32 [INFO] checking for live session
2020/07/03 13:12:15 [INFO] logged in!
2020/07/03 13:12:15 [INFO] checking for live session

Update with authentication

Is there any possibility you can update the program using the official authentication method?
I could not find a way to download videos with ffmpeg now that it is restricted. Would love to do that again.

F1viewer crash on startup

panic: runtime error: index out of range

goroutine 19 [running]:
main.getLiveNode(0xc000161fb0, 0x1, 0x1, 0x0)
        C:/Users/jakob/Documents/projects/F1/F1viewer/node.go:57 +0x72f
main.main.func1(0xc00012f2d0, 0xc000136000)
        C:/Users/jakob/Documents/projects/F1/F1viewer/main.go:128 +0x9b
created by main.main
        C:/Users/jakob/Documents/projects/F1/F1viewer/main.go:125 +0x5fc

$url substitution replaces original string

The replacement of $url in custom commands only works the first time it is triggered. Subsequent uses of the same custom command result in the previous url being returned again, as it has replaced the original string in the stored argument.

Log file being created in user's current directory rather than executable location

The log file (log.txt) is created wherever the user was in their filesystem when they call f1viewer. I imagine this file to be created in the executable location, but setWorkingDirectory is not called until a few lines later.

If it's not possible for the location to be changed, then perhaps make logging to file a debug-only option?

No sound.

Hi,

I'm getting a video but it has no sound. Not sure if I'm missing something obvious but nothing I do seems to solve the issue.

Cheers

403 Issues

Do I add my cookie/login credentials somewhere, or how this works?

m3u8 compatibility

First of all, thanks for not being subtle.

The .m3u8 files exported by the Viewer already had problems in VLC, but now they don't work with Kodi, which had been working until now. The error is "404" (according to Kodi log).

I tried adding the extra information that appears on the MPV titlebar/clip-name manually to the end of the URLs on the m3u8 but the response is the same. Can it be included in the .m3u8 somehow?

If not, maybe the next version can stop exporting .m3u8 or warning that compatibility is very limited?

Keep up the good work!

Race spoilers (again)

Previously addressed in #3, but something is causing them to show up again. WinnerXURL appears in the Info pane when hovering over the name of a Grand Prix under "Full Race Weekends".

(As a side-request, perhaps a config option to just hide the info pane completely? Unless working on code development, it's fairly useless to end users in it's current state.)

[BUG] The content must have a schedule that matches the current schedule filters

Describe the bug
Error received trying to playback anything from Austrian live event this weekend. Old content plays OK.
2020/07/03 12:13:49 [ERROR] got status 400 Bad Request with body:
{"skylark_error_code": null, "form_validation_errors": null, "error": "The content must have a schedule that matches the current schedule filters"}

To Reproduce
Steps to reproduce the behavior:

  1. Go to: 2020 Austrian Grand Prix Formula 2 Practice
    Main Feed
    │ ├──Play with MPV
  2. Try to play
  3. See error: [ERROR] got status 400 Bad Request with body:
    {"skylark_error_code": null, "form_validation_errors": null, "error": "The content must have a schedule that matches the current schedule filters"}

Expected behaviour
Playback to start in MPV player as per older items available to view.

Screenshots
image

Desktop (please complete the following information):

  • OS Win10 Pro 64bit
  • installation method: f1viewer_1.1.0_windows_64-bit.zip
  • Version [Version: 1.1.0
    Git commit: b696393
    Built: 2020-06-29T15:28:49Z]

Logs
2020/07/03 12:13:32 [INFO] logged in!
2020/07/03 12:13:32 [INFO] checking for live session
2020/07/03 12:13:49 [ERROR] got status 400 Bad Request with body:
{"skylark_error_code": null, "form_validation_errors": null, "error": "The content must have a schedule that matches the current schedule filters"}

Preseason Testing live coverage error

When trying to open the live stream for the pre season testing coverage the following error is returned:
[ERROR] {"form_validation_errors": null, "skylark_error_code": null, "error": "{"form_validation_errors": null, "skylark_error_code": null, "error": "driver_urls was not in the fields to be returned. Has it been filtered out? (Available fields: name, self)"}"}

The current live session is also not reported as a live session: "no live session found"

Don't work at windows 10 1909

Don't work and crash after open any full race. MPV player is updated. Try to download .m3u8 gives nothing its don't download and cant get URL.

Can't play many videos including live sessions

I got the latest version, 1.1.
Getting the following error:
[ERROR] got status 400 Bad Request with body: {"skylark_error_code": null, "form_validation_errors": null, "error": "The content must have a schedule that matches the current schedule filters"}

":" in $name

I've noticed that when I try to use the new $name attribute I sometimes run into problems if the name contains ":" since windows does not like that in file names.
Maybe you could replace invalid characters?

[BUG]

The exact error: tls: handshake failed: error:14FFF3E7:SSL routines:(UNKNOWN)SSL_internal:unknown failure occurred

MPV sometimes has issues with some stream (2020-any race-Main Feed). It gives an TLS error. Tried this with the most recent MPV and f1Viewer.

My suggestion would be to switch to VLC, or make it possible to choose the rendered in the config.json file.

MacOS login credentials not saved

f1viewer will not safe login credentials in de MacOS keychain.
After selecting save it'll log in, and then give a 'No keyring configured' message.
I'm running MacOS catalina on both machines I'm having this issue on.

Crash on Full Race Weekend Race Video List

Describe the bug
When trying to list the playback options for a race of the type "Full Race Weekend" the program crashes. Full Races (not the whole weekend) (pre 2018) work just fine.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to 'Full Race Weekend > 20xx F1 Championship > xx Grand Prix > Race > Crash'

Expected behaviour
List the options for the race.

Screenshots
image
loading... and then crashes.

Desktop (please complete the following information):

  • Windows 10 2004 (Build 19041.329)
  • Latest release binary and go build on lastest master
  • Version 1.0.0 and dev

Logs
These are the logs repeating the crash a few times. Nothing to speak of really.

2020/06/10 15:59:15 [INFO] logged in!
2020/06/10 15:59:15 [INFO] checking for live session
2020/06/10 15:59:18 [INFO] no live session found
2020/06/10 15:59:36 [INFO] logged in!
2020/06/10 15:59:36 [INFO] checking for live session
2020/06/10 15:59:38 [INFO] no live session found
2020/06/10 16:02:34 [INFO] logged in!
2020/06/10 16:02:34 [INFO] checking for live session
2020/06/10 16:02:37 [INFO] no live session found
2020/06/10 16:04:43 [INFO] logged in!
2020/06/10 16:04:43 [INFO] checking for live session
2020/06/10 16:04:44 [INFO] New version found!
2020/06/10 16:04:46 [INFO] no live session found
2020/06/10 16:39:38 [INFO] logged in!
2020/06/10 16:39:38 [INFO] checking for live session
2020/06/10 16:39:39 [INFO] New version found!
2020/06/10 16:39:40 [INFO] no live session found

$name for commands

I would really like to have the name of the event i'm playing as a variable when issuing a command. For example if i'm playing back the "Formula 1 Gran Premio De Mexico - F1 Race - Main Feed" i would like to have the $name parameter to be exactly that. This would make saving files a lot more convenient.

Thanks in advance.

Login with my own account?

I have an F1TV Pro account, trying to work out how to sign into this with my own account?

If it requires recompiling that's fine, I can do that.

Change video quality in MPV

I play the video in MPV and they are all in 1080p. Is it possible to get the other streams like 720p, 576p ?

F1viewer crashes

After few seconds it crashes, logs say there's missing config.json. Tried to create this config and nothing helped.
edit: Ok, i fixed config thing but it still crashes. logs are:
found 0 custom commands
checking for live session
no update available
That’s all, it worked for the whole 2019 season. It started crashing early 2020, yesterday after reinstall i’ve had that config problem however, i fixed it by saving the file as .json and it’s crashing again like in the past

Race spoilers

Within the full info for full race weekends, the podium finishers appear as 'Winner1URL', 'Winner2URL' and 'Winner3URL'. Anyone using this tool to catchup on a very recent race will thus get the result spoiled.

APIs for F1Viewer

What APIs are you using for this project? Where it's possible to read their documentations?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.