hTobi02 / f1tv-rtmp

Play live content from F1TV with any RTMP Player
10 stars 4 forks source link

Captcha #6

Open laurenshoogendijk opened 2 years ago

laurenshoogendijk commented 2 years ago

Hi! Unfortunately, got another problem:

Are you running into this as well? Connecting with a browser from the same IP results in another error (which is understandable): {"fault":{"faultstring":"Failed to resolve API Key variable request.header.apikey","detail":{"errorcode":"steps.oauth.v2.FailedToResolveAPIKey"}}}

/etc/docker# curl -s --request POST --url https://api.formula1.com/v2/account/subscriber/authenticate/by-password --header 'Content-Type: application/json' --header 'User-Agent: RaceControl' --header 'apiKey: fCUCjWrKPu9ylJwRAv8BpGLEgiAuThx7' --data "$DATA"
<!DOCTYPE html>
<html>
    <head>
        <noscript>
            <title>Pardon Our Interruption</title>
        </noscript>

        <meta name="viewport" content="width=1000">
        <meta name="robots" content="noindex, nofollow">
        <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="expires" content="0">

        <style>
            .container { max-width: 800px; margin: auto; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; color: #7a838c; }
            h1 { color: #2a2d30; font-weight: 500; }
            li { margin: 0 0 10px; }
            a { color: #428bca; }
            a:hover, a:focus { color: #2a6496; }
        </style>

        <script>
            function showBlockPage() {
                document.title = "Pardon Our Interruption"
                document.getElementsByClassName("container")[0].style.display = "block";
            }
            setTimeout(showBlockPage, 10000);

            // Language configuration for captcha. See each specific captcha provider for which
            // languages are supported
            // window.geetestLang = "en";
            // window.recaptchaLang = "en";
        </script>

        <!-- This head template should be placed before the following script tag that loads the challenge script -->
        <script>window.addEventListener('load', showBlockPage)</script>
        <script type="text/javascript" src="/6657193977244c13" async defer></script>

    </head>
    <body>

        <div class="container">
            <script>document.getElementsByClassName("container")[0].style.display = "none";</script>

            <h1>Pardon Our Interruption</h1>
            <p>As you were browsing something about your browser made us think you were a bot. There are a few reasons this might happen:</p>
            <ul>
                <noscript><li>You've disabled JavaScript in your web browser.</li></noscript>
                <li>You're a power user moving through this website with super-human speed.</li>
                <li>You've disabled cookies in your web browser.</li>
                <li>A third-party browser plugin, such as Ghostery or NoScript, is preventing JavaScript from running. Additional information is available in this <a title='Third party browser plugins that block javascript' href='https://help.distilnetworks.com/hc/en-us/articles/212154438-Third-Party-Browser-Plugins-That-Block-JavaScript' target='_blank'>support article</a>.</li>
            </ul>

            <!-- These paragraphs are displayed depending on if an identify or captcha page is returned  -->
            <p id="identify-msg" style="display: none">To regain access, please make sure that cookies and JavaScript are enabled before reloading the page.</p>

            <p id="captcha-msg" style="display: none">After completing the CAPTCHA below, you will immediately regain access to the site again.</p>

            <p id="extraUnblock"><small style="font-size: 8pt">IP: x.x.x.x</small></p>`
        </div>
    </body>
</html>
laurenshoogendijk commented 2 years ago

After some digging, it seems that a cookie is required within the POST request:

https://documenter.getpostman.com/view/11462073/TzY68Dsi

image

hTobi02 commented 2 years ago

Alright, thanks for letting me know! I'm working on it right now!

hTobi02 commented 2 years ago

Unfortunately, it's not quite that simple. Formula 1 has significantly hardened their token system and also integrated a DRM system in the process, which makes watching the races much more difficult if not impossible. As you can read here (RaceControl) and here (f1viewer).

I'm trying my best but I don't think I'll get it done before this weekend's race or in general.

laurenshoogendijk commented 2 years ago

Damn Formula 1... Thanks for looking into it though!