API Code Display

Youtube Subscribe Link.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirecting to YouTube</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            background-color: #f8f8f8;
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
        }

        .loading-container {
            text-align: center;
            color: #111;
            max-width: 500px;
            padding: 20px;
            border-radius: 8px;
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #111;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }

        .loading-msg {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .loading-text {
            font-size: 16px;
            color: #666;
            margin-bottom: 20px;
        }

        @media (max-width: 768px) {
            .loading-container {
                padding: 20px 10px;
                width: calc(100% - 100px);
            }

            .spinner {
                width: 40px;
                height: 40px;
            }

            .loading-msg {
                font-size: 20px;
            }

            .loading-text {
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
    <div class='loading-container'>
        <div class='spinner'></div>
        <p class='loading-msg'>Please wait</p>
        <p class='loading-text'>Redirecting you to <b>YouTube</b> for subscription...</p>
    </div>

    <script>
        function getUrlParameter(name) {
            name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
            var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
            var results = regex.exec(location.search);
            return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
        }

        function redirectToYouTube() {
            const channelId = getUrlParameter('channel') || ''; // Default Channel ID for subscription
            const targetUrl = `https://www.youtube.com/channel/${channelId}?sub_confirmation=1`;

            window.location.href = targetUrl;
        }

        window.onload = function() {
            redirectToYouTube();
        };
    </script>
</body>
</html>
Download Code

Notes:

Back to list