Valentin-Metz / tum_video_scraper

Download and jumpcut lecture videos from https://live.rbg.tum.de/ and https://tum.cloud.panopto.eu/
57 stars 5 forks source link

get_playlist_url() throws AttributeError for some tum-live lectures #3

Closed kaieberl closed 2 years ago

kaieberl commented 2 years ago

re.search(prefix + '(.+?)' + postfix, source) does finds nothing for the source attached below. Will create a PR to at least catch the error.

<html lang="en" class="h-full dark"><head><style class="vjs-styles-defaults">
      .video-js {
        width: 300px;
        height: 150px;
      }

      .vjs-fluid {
        padding-top: 56.25%
      }
    </style><style class="vjs-styles-dimensions">
      .my-video-dimensions {
        width: 300px;
        height: 168.75px;
      }

      .my-video-dimensions.vjs-fluid {
        padding-top: 56.25%;
      }
    </style>
    <meta charset="UTF-8">

    <title>Advanced Programming (IN1503):  | TUM Live</title>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/static/assets/css-dist/main.css?v=406aeec" rel="stylesheet">
    <link href="/static/node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet">
    <link href="/static/assets/css/icons.css?v=406aeec" rel="stylesheet">
    <script defer="" src="/static/node_modules/@alpinejs/persist/dist/cdn.min.js"></script>

        <script defer="" src="/static/node_modules/alpinejs/dist/cdn.min.js"></script>

    <script src="/static/assets/ts-dist/global.bundle.js?v=406aeec"></script>
    <script> 
        let darkTheme = localStorage.getItem("darkTheme") ? JSON.parse(localStorage.getItem("darkTheme")) : true;
        if (!darkTheme) {
            document.documentElement.classList.remove("dark");
        }
    </script>
    <style>[x-cloak] { display: none !important; }</style>

    <script>window.HELP_IMPROVE_VIDEOJS = false;</script>
    <script src="/static/assets/ts-dist/watch.bundle.js?v=406aeec"></script>
    <link rel="stylesheet" href="/static/node_modules/video.js/dist/video-js.min.css">
    <link rel="stylesheet" href="/static/node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.css">
    <link rel="stylesheet" href="/static/node_modules/videojs-hls-quality-selector/dist/videojs-hls-quality-selector.css">
</head>

<body x-data="{'paused': false, 'streamID': 3916}" x-on:pausestart.window="paused=true" x-on:pauseend.window="paused=false" x-init="new watch.Watch(); watch.startWebsocket()">
<div x-data="{showMobNav: false, dark: false}" x-init="dark = global.isDark()" class="inline">
    <nav class="flex z-40 lg:z-50 sticky top-0 w-full items-center justify-between dark:bg-secondary bg-white
                    shadow border-b dark:border-0 p-3 h-20 z-40">
        <a title="Start" href="/" class="flex items-center flex-no-shrink text-white mr-6">
            <svg class="mr-2" width="100" height="54" viewBox="0 0 100 54" xmlns="http://www.w3.org/2000/svg">
                <path fill="#3070B3" d="M49.986,7v31h8V7h37v38h-7V14h-8v31h-7V14h-8v31h-22V14h-7v31h-7V14h-7V7H49.986z"></path>
            </svg>
        </a>
        <div class="hidden md:flex grow items-center w-auto">
            <div class="text-sm grow">
                <a href="/" class="block inline-block align-middle mt-0 mr-4 text-5 hover:text-1 font-medium">
                    Start
                </a>

                    <a href="/logout" class="inline-block align-middle mt-0 mr-4 text-5 hover:text-1 font-medium">
                        Logout
                    </a>

                <a href="/about" class="inline-block align-middle mt-0 mr-4 text-5 hover:text-1 font-medium">
                    About
                </a>
            </div>
            <div class="flex">
                <button class="flex my-auto text-xl mr-6" title="Toggle color scheme" onclick="global.toggleColorScheme()" @click="dark = !dark">
                    <i class="text-gray-400 text-xl fas fa-toggle-on" :class="dark ? 'fa-toggle-on' :  'fa-toggle-off'"></i>
                </button>
                <a class="mr-3" rel="noopener" href="https://github.com/joschahenningsen/TUM-Live" aria-label="GitHub"><i class="transition-colors duration-200 hover:text-gray-600
                            dark:hover:text-white text-gray-400 vjs-icon-github"></i></a>
            </div>
        </div>
        <div class="md:hidden mr-3">
            <button class="text-3 text-4xl" @click="showMobNav = true;">
                ≡
            </button>
        </div>
    </nav>
    <div id="hamburger" class="md:hidden z-50 fixed right-0 top-0 h-screen w-full backdrop-blur-sm hidden" :class="showMobNav || 'hidden'">
        <div class="w-10/12 bg-white dark:bg-secondary shadow ml-auto h-full pb-4 rounded-l-lg">
            <div class="pl-5 py-3 border-b h-16 dark:border-gray-600">
                <button class="text-3 text-3xl my-auto" @click="showMobNav = false;">↦</button>
            </div>
            <a href="/" class="block font-semibold text-3 px-5 py-2 border-b dark:border-gray-600">
                <i class="fas fa-home w-8"></i>
                <span class="ml-2 text-sm">Start</span>
            </a>

                <a href="/logout" class="block font-semibold text-3 px-5 py-2 border-b dark:border-gray-600">
                    <i class="fas fa-sign-out-alt w-8"></i>
                    <span class="ml-2 text-sm">Logout</span>
                </a>

            <a href="/about" class="block font-semibold text-3 px-5 py-2 border-b dark:border-gray-600">
                <i class="fas fa-info-circle w-8"></i>
                <span class="ml-2 text-sm">About</span>
            </a>
            <div class="flex justify-end px-5 py-2 border-b dark:border-gray-600">
                <span class="text-sm text-gray-500 uppercase mr-2 my-auto">Dark Mode</span>
                <button class="flex my-auto w-12 justify-end" title="Toggle color scheme" onclick="global.toggleColorScheme()" @click="dark = !dark">
                    <i class="text-3 text-2xl fas fa-toggle-on" :class="dark ? 'fa-toggle-on' :  'fa-toggle-off'"></i>
                </button>
            </div>
            <div class="flex justify-end px-5 py-2 border-b dark:border-gray-600">
                <span class="text-sm text-gray-500 uppercase mr-2 my-auto">GitHub</span>
                <div class="w-12 flex justify-end">
                    <a class="my-auto" rel="noopener" href="https://github.com/joschahenningsen/TUM-Live" aria-label="GitHub">
                        <i class="text-3 vjs-icon-github"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div id="alertBox" class="hidden text-center">
        <div class="p-2 bg-indigo-800 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex" role="alert">
            <span id="alertText" class="font-semibold mx-2 text-left flex-auto"></span>
            <span id="alertOk" onclick="document.getElementById('alertBox').classList.add('hidden')" class="cursor-pointer flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">Dismiss</span>
        </div>
    </div>
</div>

<div id="watchPageMainWrapper" class="w-full md:flex md:flex-nowrap md:justify-between" style="height: calc(100vh - 5rem)">
    <input type="hidden" id="streamID" value="3916">
    <div id="watchWrapper" class="grow overflow-x-hidden h-fit md:h-full">
        <noscript><p class="vjs-no-js">
                To view this video please enable JavaScript.
            </p></noscript>
        <div id="watchContent" class="w-full">
            <div class="bg-indigo-700 bg-opacity-20 border-t-4 border-indigo-700 w-full font-semibold text-2 rounded-t display-none" x-show="paused" style="display: none;">
                <i class="fas fa-info-circle"></i> This lecture is currently paused.
            </div>
            <div poster="/public/default_banner.jpg" preload="auto" class="video-js w-full vjs-theater-mode theater-mode vjs-paused my-video-dimensions vjs-controls-enabled vjs-workinghover vjs-v7 vjs-user-active vjs-hls-quality-selector vjs-seek-buttons vjs-skip-silence" id="my-video" tabindex="-1" lang="en" translate="no" role="region" aria-label="Video Player"><video id="my-video_html5_api" class="vjs-tech" preload="auto" poster="/public/default_banner.jpg" tabindex="-1" src="blob:https://live.rbg.tum.de/4571d688-7b27-4de1-af67-0fd78aa116ef">

                        <source src="https://live.stream.lrz.de/livetum/smil:13-6277431f_all.smil/playlist.m3u8?dvr" type="application/x-mpegURL">

                <p class="vjs-no-js">
                    To view this video please enable JavaScript.
                </p>
            </video><div class="vjs-poster" tabindex="-1" aria-disabled="false" style="background-image: url(&quot;/public/default_banner.jpg&quot;);"></div><div class="vjs-text-track-display" translate="yes" aria-live="off" aria-atomic="true"><div style="position: absolute; inset: 0px; margin: 1.5%;"></div></div><div class="vjs-loading-spinner" dir="ltr"><span class="vjs-control-text">Video Player is loading.</span></div><button class="vjs-skip-silence-control invisible" type="button" aria-disabled="false" title="Skip pause"><span class="vjs-icon-placeholder icon-forward" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Skip pause</span></button><button class="vjs-big-play-button" type="button" title="Play Video" aria-disabled="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Play Video</span></button><div class="vjs-control-bar" dir="ltr"><button class="vjs-seek-button skip-back skip-15 vjs-control vjs-button" type="button" aria-disabled="false" title="Seek back 15 seconds"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Seek back 15 seconds</span></button><button class="vjs-play-control vjs-control vjs-button" type="button" title="Play" aria-disabled="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Play</span></button><button class="vjs-seek-button skip-forward skip-15 vjs-control vjs-button" type="button" aria-disabled="false" title="Seek forward 15 seconds"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Seek forward 15 seconds</span></button><div class="vjs-volume-panel vjs-control vjs-volume-panel-horizontal"><button class="vjs-mute-control vjs-control vjs-button vjs-vol-3" type="button" title="Mute" aria-disabled="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Mute</span></button><div class="vjs-volume-control vjs-control vjs-volume-horizontal"><div tabindex="0" class="vjs-volume-bar vjs-slider-bar vjs-slider vjs-slider-horizontal" role="slider" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" aria-label="Volume Level" aria-live="polite" aria-valuetext="100%"><div class="vjs-mouse-display"><div class="vjs-volume-tooltip" aria-hidden="true"></div></div><div class="vjs-volume-level"><span class="vjs-control-text"></span></div></div></div></div><div class="vjs-current-time vjs-time-control vjs-control"><span class="vjs-control-text" role="presentation">Current Time&nbsp;</span><span class="vjs-current-time-display" aria-live="off" role="presentation">0:00</span></div><div class="vjs-time-control vjs-time-divider" aria-hidden="true"><div><span>/</span></div></div><div class="vjs-duration vjs-time-control vjs-control"><span class="vjs-control-text" role="presentation">Duration&nbsp;</span><span class="vjs-duration-display" aria-live="off" role="presentation">0:00</span></div><div class="vjs-progress-control vjs-control"><div tabindex="0" class="vjs-progress-holder vjs-slider vjs-slider-horizontal" role="slider" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" aria-label="Progress Bar" aria-valuetext="0:00 of 0:00"><div class="vjs-load-progress"><span class="vjs-control-text"><span>Loaded</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span></div><div class="vjs-mouse-display"><div class="vjs-time-tooltip" aria-hidden="true"></div></div><div class="vjs-play-progress vjs-slider-bar" aria-hidden="true" style="width: 0%;"><div class="vjs-time-tooltip" aria-hidden="true" style="right: 0px;">0:00</div></div></div></div><div class="vjs-live-control vjs-control vjs-hidden"><div class="vjs-live-display" aria-live="off"><span class="vjs-control-text">Stream Type&nbsp;</span>LIVE</div></div><button class="vjs-seek-to-live-control vjs-control" type="button" title="Seek to live, currently behind live" aria-disabled="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Seek to live, currently behind live</span><span class="vjs-seek-to-live-text" aria-hidden="true">LIVE</span></button><div class="vjs-remaining-time vjs-time-control vjs-control"><span class="vjs-control-text" role="presentation">Remaining Time&nbsp;</span><span aria-hidden="true">-</span><span class="vjs-remaining-time-display" aria-live="off" role="presentation">0:00</span></div><div class="vjs-custom-control-spacer vjs-spacer ">&nbsp;</div><div class="vjs-playback-rate vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"><div class="vjs-playback-rate-value" id="vjs-playback-rate-value-label-my-video_component_254">1x</div><button class="vjs-playback-rate vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" title="Playback Rate" aria-haspopup="true" aria-expanded="false" aria-describedby="vjs-playback-rate-value-label-my-video_component_254"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Playback Rate</span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">2x</span><span class="vjs-control-text" aria-live="polite"></span></li><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">1.75x</span><span class="vjs-control-text" aria-live="polite"></span></li><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">1.5x</span><span class="vjs-control-text" aria-live="polite"></span></li><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">1.25x</span><span class="vjs-control-text" aria-live="polite"></span></li><li class="vjs-menu-item vjs-selected" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="true"><span class="vjs-menu-item-text">1x</span><span class="vjs-control-text" aria-live="polite">, selected</span></li><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">0.75x</span><span class="vjs-control-text" aria-live="polite"></span></li><li class="vjs-menu-item" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="false"><span class="vjs-menu-item-text">0.5x</span><span class="vjs-control-text" aria-live="polite"></span></li></ul></div></div><div class="vjs-chapters-button vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-hidden"><button class="vjs-chapters-button vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" title="Chapters" aria-haspopup="true" aria-expanded="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Chapters</span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"><li class="vjs-menu-title" tabindex="-1">Chapters</li></ul></div></div><div class="vjs-descriptions-button vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-hidden"><button class="vjs-descriptions-button vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" title="Descriptions" aria-haspopup="true" aria-expanded="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Descriptions</span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"><li class="vjs-menu-item vjs-selected" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="true"><span class="vjs-menu-item-text">descriptions off</span><span class="vjs-control-text" aria-live="polite">, selected</span></li></ul></div></div><div class="vjs-subs-caps-button vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-hidden"><button class="vjs-subs-caps-button vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" title="Captions" aria-haspopup="true" aria-expanded="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Captions</span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"><li class="vjs-menu-item vjs-texttrack-settings" tabindex="-1" role="menuitem" aria-disabled="false"><span class="vjs-menu-item-text">captions settings</span><span class="vjs-control-text" aria-live="polite">, opens captions settings dialog</span></li><li class="vjs-menu-item vjs-selected" tabindex="-1" role="menuitemradio" aria-disabled="false" aria-checked="true"><span class="vjs-menu-item-text">captions off</span><span class="vjs-control-text" aria-live="polite">, selected</span></li></ul></div></div><div class="vjs-audio-button vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-hidden"><button class="vjs-audio-button vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" title="Audio Track" aria-haspopup="true" aria-expanded="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Audio Track</span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"></ul></div></div><div class="vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-quality-selector"><button class="vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-disabled="false" aria-haspopup="true" aria-expanded="false"><span class="vjs-icon-placeholder vjs-icon-hd" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite"></span></button><div class="vjs-menu"><ul class="vjs-menu-content" role="menu"><li class="vjs-menu-title" tabindex="-1">Quality</li></ul></div></div><button class="vjs-picture-in-picture-control vjs-control vjs-button vjs-disabled" type="button" title="Picture-in-Picture" aria-disabled="true" disabled="disabled"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Picture-in-Picture</span></button><button class="vjs-fullscreen-control vjs-control vjs-button" type="button" title="Fullscreen" aria-disabled="false"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Fullscreen</span></button></div><div class="vjs-error-display vjs-modal-dialog vjs-hidden " tabindex="-1" aria-describedby="my-video_component_557_description" aria-hidden="true" aria-label="Modal Window" role="dialog"><p class="vjs-modal-dialog-description vjs-control-text" id="my-video_component_557_description">This is a modal window.</p><div class="vjs-modal-dialog-content" role="document"></div></div><div class="vjs-modal-dialog vjs-hidden  vjs-text-track-settings" tabindex="-1" aria-describedby="my-video_component_563_description" aria-hidden="true" aria-label="Caption Settings Dialog" role="dialog"><p class="vjs-modal-dialog-description vjs-control-text" id="my-video_component_563_description">Beginning of dialog window. Escape will cancel and close the window.</p><div class="vjs-modal-dialog-content" role="document"><div class="vjs-track-settings-colors"><fieldset class="vjs-fg-color vjs-track-setting"><legend id="captions-text-legend-my-video_component_563">Text</legend><label id="captions-foreground-color-my-video_component_563" class="vjs-label">Color</label><select aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563"><option id="captions-foreground-color-my-video_component_563-White" value="#FFF" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-White">White</option><option id="captions-foreground-color-my-video_component_563-Black" value="#000" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Black">Black</option><option id="captions-foreground-color-my-video_component_563-Red" value="#F00" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Red">Red</option><option id="captions-foreground-color-my-video_component_563-Green" value="#0F0" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Green">Green</option><option id="captions-foreground-color-my-video_component_563-Blue" value="#00F" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Blue">Blue</option><option id="captions-foreground-color-my-video_component_563-Yellow" value="#FF0" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Yellow">Yellow</option><option id="captions-foreground-color-my-video_component_563-Magenta" value="#F0F" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Magenta">Magenta</option><option id="captions-foreground-color-my-video_component_563-Cyan" value="#0FF" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-color-my-video_component_563 captions-foreground-color-my-video_component_563-Cyan">Cyan</option></select><span class="vjs-text-opacity vjs-opacity"><label id="captions-foreground-opacity-my-video_component_563" class="vjs-label">Transparency</label><select aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-opacity-my-video_component_563"><option id="captions-foreground-opacity-my-video_component_563-Opaque" value="1" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-opacity-my-video_component_563 captions-foreground-opacity-my-video_component_563-Opaque">Opaque</option><option id="captions-foreground-opacity-my-video_component_563-SemiTransparent" value="0.5" aria-labelledby="captions-text-legend-my-video_component_563 captions-foreground-opacity-my-video_component_563 captions-foreground-opacity-my-video_component_563-SemiTransparent">Semi-Transparent</option></select></span></fieldset><fieldset class="vjs-bg-color vjs-track-setting"><legend id="captions-background-my-video_component_563">Background</legend><label id="captions-background-color-my-video_component_563" class="vjs-label">Color</label><select aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563"><option id="captions-background-color-my-video_component_563-Black" value="#000" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Black">Black</option><option id="captions-background-color-my-video_component_563-White" value="#FFF" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-White">White</option><option id="captions-background-color-my-video_component_563-Red" value="#F00" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Red">Red</option><option id="captions-background-color-my-video_component_563-Green" value="#0F0" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Green">Green</option><option id="captions-background-color-my-video_component_563-Blue" value="#00F" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Blue">Blue</option><option id="captions-background-color-my-video_component_563-Yellow" value="#FF0" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Yellow">Yellow</option><option id="captions-background-color-my-video_component_563-Magenta" value="#F0F" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Magenta">Magenta</option><option id="captions-background-color-my-video_component_563-Cyan" value="#0FF" aria-labelledby="captions-background-my-video_component_563 captions-background-color-my-video_component_563 captions-background-color-my-video_component_563-Cyan">Cyan</option></select><span class="vjs-bg-opacity vjs-opacity"><label id="captions-background-opacity-my-video_component_563" class="vjs-label">Transparency</label><select aria-labelledby="captions-background-my-video_component_563 captions-background-opacity-my-video_component_563"><option id="captions-background-opacity-my-video_component_563-Opaque" value="1" aria-labelledby="captions-background-my-video_component_563 captions-background-opacity-my-video_component_563 captions-background-opacity-my-video_component_563-Opaque">Opaque</option><option id="captions-background-opacity-my-video_component_563-SemiTransparent" value="0.5" aria-labelledby="captions-background-my-video_component_563 captions-background-opacity-my-video_component_563 captions-background-opacity-my-video_component_563-SemiTransparent">Semi-Transparent</option><option id="captions-background-opacity-my-video_component_563-Transparent" value="0" aria-labelledby="captions-background-my-video_component_563 captions-background-opacity-my-video_component_563 captions-background-opacity-my-video_component_563-Transparent">Transparent</option></select></span></fieldset><fieldset class="vjs-window-color vjs-track-setting"><legend id="captions-window-my-video_component_563">Window</legend><label id="captions-window-color-my-video_component_563" class="vjs-label">Color</label><select aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563"><option id="captions-window-color-my-video_component_563-Black" value="#000" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Black">Black</option><option id="captions-window-color-my-video_component_563-White" value="#FFF" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-White">White</option><option id="captions-window-color-my-video_component_563-Red" value="#F00" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Red">Red</option><option id="captions-window-color-my-video_component_563-Green" value="#0F0" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Green">Green</option><option id="captions-window-color-my-video_component_563-Blue" value="#00F" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Blue">Blue</option><option id="captions-window-color-my-video_component_563-Yellow" value="#FF0" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Yellow">Yellow</option><option id="captions-window-color-my-video_component_563-Magenta" value="#F0F" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Magenta">Magenta</option><option id="captions-window-color-my-video_component_563-Cyan" value="#0FF" aria-labelledby="captions-window-my-video_component_563 captions-window-color-my-video_component_563 captions-window-color-my-video_component_563-Cyan">Cyan</option></select><span class="vjs-window-opacity vjs-opacity"><label id="captions-window-opacity-my-video_component_563" class="vjs-label">Transparency</label><select aria-labelledby="captions-window-my-video_component_563 captions-window-opacity-my-video_component_563"><option id="captions-window-opacity-my-video_component_563-Transparent" value="0" aria-labelledby="captions-window-my-video_component_563 captions-window-opacity-my-video_component_563 captions-window-opacity-my-video_component_563-Transparent">Transparent</option><option id="captions-window-opacity-my-video_component_563-SemiTransparent" value="0.5" aria-labelledby="captions-window-my-video_component_563 captions-window-opacity-my-video_component_563 captions-window-opacity-my-video_component_563-SemiTransparent">Semi-Transparent</option><option id="captions-window-opacity-my-video_component_563-Opaque" value="1" aria-labelledby="captions-window-my-video_component_563 captions-window-opacity-my-video_component_563 captions-window-opacity-my-video_component_563-Opaque">Opaque</option></select></span></fieldset></div><div class="vjs-track-settings-font"><fieldset class="vjs-font-percent vjs-track-setting"><legend id="captions-font-size-my-video_component_563" class="">Font Size</legend><select aria-labelledby="captions-font-size-my-video_component_563"><option id="captions-font-size-my-video_component_563-50" value="0.50" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-50">50%</option><option id="captions-font-size-my-video_component_563-75" value="0.75" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-75">75%</option><option id="captions-font-size-my-video_component_563-100" value="1.00" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-100">100%</option><option id="captions-font-size-my-video_component_563-125" value="1.25" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-125">125%</option><option id="captions-font-size-my-video_component_563-150" value="1.50" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-150">150%</option><option id="captions-font-size-my-video_component_563-175" value="1.75" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-175">175%</option><option id="captions-font-size-my-video_component_563-200" value="2.00" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-200">200%</option><option id="captions-font-size-my-video_component_563-300" value="3.00" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-300">300%</option><option id="captions-font-size-my-video_component_563-400" value="4.00" aria-labelledby="captions-font-size-my-video_component_563 captions-font-size-my-video_component_563-400">400%</option></select></fieldset><fieldset class="vjs-edge-style vjs-track-setting"><legend id="my-video_component_563" class="">Text Edge Style</legend><select aria-labelledby="my-video_component_563"><option id="my-video_component_563-None" value="none" aria-labelledby="my-video_component_563 my-video_component_563-None">None</option><option id="my-video_component_563-Raised" value="raised" aria-labelledby="my-video_component_563 my-video_component_563-Raised">Raised</option><option id="my-video_component_563-Depressed" value="depressed" aria-labelledby="my-video_component_563 my-video_component_563-Depressed">Depressed</option><option id="my-video_component_563-Uniform" value="uniform" aria-labelledby="my-video_component_563 my-video_component_563-Uniform">Uniform</option><option id="my-video_component_563-Dropshadow" value="dropshadow" aria-labelledby="my-video_component_563 my-video_component_563-Dropshadow">Dropshadow</option></select></fieldset><fieldset class="vjs-font-family vjs-track-setting"><legend id="captions-font-family-my-video_component_563" class="">Font Family</legend><select aria-labelledby="captions-font-family-my-video_component_563"><option id="captions-font-family-my-video_component_563-ProportionalSansSerif" value="proportionalSansSerif" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-ProportionalSansSerif">Proportional Sans-Serif</option><option id="captions-font-family-my-video_component_563-MonospaceSansSerif" value="monospaceSansSerif" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-MonospaceSansSerif">Monospace Sans-Serif</option><option id="captions-font-family-my-video_component_563-ProportionalSerif" value="proportionalSerif" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-ProportionalSerif">Proportional Serif</option><option id="captions-font-family-my-video_component_563-MonospaceSerif" value="monospaceSerif" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-MonospaceSerif">Monospace Serif</option><option id="captions-font-family-my-video_component_563-Casual" value="casual" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-Casual">Casual</option><option id="captions-font-family-my-video_component_563-Script" value="script" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-Script">Script</option><option id="captions-font-family-my-video_component_563-SmallCaps" value="small-caps" aria-labelledby="captions-font-family-my-video_component_563 captions-font-family-my-video_component_563-SmallCaps">Small Caps</option></select></fieldset></div><div class="vjs-track-settings-controls"><button type="button" class="vjs-default-button" title="restore all settings to the default values">Reset<span class="vjs-control-text"> restore all settings to the default values</span></button><button type="button" class="vjs-done-button">Done</button></div></div><button class="vjs-close-button vjs-control vjs-button" type="button" aria-disabled="false" title="Close Modal Dialog"><span class="vjs-icon-placeholder" aria-hidden="true"></span><span class="vjs-control-text" aria-live="polite">Close Modal Dialog</span></button><p class="vjs-control-text">End of dialog window.</p></div></div>
        </div>
        <div id="streamInfo" class="mx-5 m-auto">
            <div class="flex justify-between align-middle mt-4">
                <h1 class="text-4 text-xl grow" @titleupdate.window="$el.innerText=$event.detail.title">

                        Lecture: November 04. 2021

                </h1>
                <p class="text-4 text-lg flex">

                    <span class="hidden md:inline-block">

    <span class="flex space-x-2 content-center">

    <span class="relative m-auto" x-data="{expand:false}">
        <button @click="expand=!expand" type="button" id="menu-button" aria-expanded="true" aria-haspopup="true">
            <i class="fas fa-cloud-download-alt text-4 text-lg hover:text-1"></i>
        </button>
        <span x-show="expand" @click.outside="expand = false" class="origin-top-left absolute top-full left-0 m-auto w-32
             dark:bg-secondary ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1" style="display: none;">
            <span class="py-1" role="none">

                    <a href="/api/download/1280" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Presentation</a>

                    <a href="/api/download/1283" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Default view</a>

                    <a href="/api/download/1289" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Camera-view</a>

            </span>
        </span>
    </span>

            <a class="m-auto" title="Presentation only" href="/w/AdvProg/3916/PRES">
                <i class="fas fa-edit text-4 text-lg hover:text-1"></i>
            </a>

            <a class="m-auto" title="Camera only" href="/w/AdvProg/3916/CAM">
                <i class="fas fa-camera text-4 text-lg hover:text-1"></i>
            </a>

            <a class="m-auto" title="Combined view" href="/w/AdvProg/3916">
                <i class="fas fa-object-group text-4 text-lg hover:text-1"></i>
            </a>

        <i title="Copy HLS URL" class="m-auto fas fa-link text-4 text-lg dark:hover:text-white hover:text-black cursor-pointer" onclick="global.copyToClipboard('https:\/\/live.stream.lrz.de\/livetum\/smil:13-6277431f_all.smil\/playlist.m3u8?dvr'.replaceAll('\{\{quality\}\}', ''))"></i>

    </span>

                    </span>
                </p>
            </div>
            <div class="flex justify-between">
                <a href="/course/2021/W/AdvProg">
                    <span class="text-5 hover:text-1 hover:underline text-lg">Advanced Programming (IN1503)</span></a>

            </div>

            <div class="flex justify-between align-middle mt-2 md:hidden">

    <span class="flex space-x-2 content-center">

    <span class="relative m-auto" x-data="{expand:false}">
        <button @click="expand=!expand" type="button" id="menu-button" aria-expanded="true" aria-haspopup="true">
            <i class="fas fa-cloud-download-alt text-4 text-lg hover:text-1"></i>
        </button>
        <span x-show="expand" @click.outside="expand = false" class="origin-top-left absolute top-full left-0 m-auto w-32
             dark:bg-secondary ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1" style="display: none;">
            <span class="py-1" role="none">

                    <a href="/api/download/1280" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Presentation</a>

                    <a href="/api/download/1283" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Default view</a>

                    <a href="/api/download/1289" download="" class="hover:bg-gray-100 text-3 dark:hover:bg-gray-600
                       block px-4 py-2 text-sm first:rounded-t-md last:rounded-b-md" role="menuitem" tabindex="-1" id="menu-item-0">Camera-view</a>

            </span>
        </span>
    </span>

            <a class="m-auto" title="Presentation only" href="/w/AdvProg/3916/PRES">
                <i class="fas fa-edit text-4 text-lg hover:text-1"></i>
            </a>

            <a class="m-auto" title="Camera only" href="/w/AdvProg/3916/CAM">
                <i class="fas fa-camera text-4 text-lg hover:text-1"></i>
            </a>

            <a class="m-auto" title="Combined view" href="/w/AdvProg/3916">
                <i class="fas fa-object-group text-4 text-lg hover:text-1"></i>
            </a>

        <i title="Copy HLS URL" class="m-auto fas fa-link text-4 text-lg dark:hover:text-white hover:text-black cursor-pointer" onclick="global.copyToClipboard('https:\/\/live.stream.lrz.de\/livetum\/smil:13-6277431f_all.smil\/playlist.m3u8?dvr'.replaceAll('\{\{quality\}\}', ''))"></i>

    </span>

            </div>
            <div x-data="{descriptionlen: 0, less:true}" class="text-3 p-4 border-t-2 my-3 border-secondary video-description" x-show="descriptionlen > 0" style="display: none;">
                <span class="font-semibold">Video Description:</span>
                <div :class="less &amp;&amp; 'truncate-children'" @descriptionupdate.window="$el.innerHTML=$event.detail.description; descriptionlen=$event.detail.description.length" class="truncate-children">

                </div>
                <button x-show="descriptionlen>128" class="text-xs text-gray-500 dark:text-gray-400 uppercase mt-2" @click="less = !less" x-text="less ? 'show more' : 'show less'" style="display: none;">show more</button>
            </div>

        </div>
    </div>

</div>
<script>
    watch.initPlayer();

    watch.watchProgress( 3916 ,  0 );

    watch.skipSilence("[{\"start\":0,\"end\":1510},{\"start\":1600,\"end\":1665},{\"start\":1740,\"end\":3970},{\"start\":4033,\"end\":4064},{\"start\":4134,\"end\":6423},{\"start\":6458,\"end\":8399}]");

</script>

</body></html>
kaieberl commented 2 years ago

I pushed my version now to this repo. Since I didn't directly fork the repo, I cannot make a PR, but maybe you could have a look at my commits. Besides catching the error, I added compatibility with Python 3.8 (hope it still works with 3.9) and fixed other issues, e.g. pause between requests (else the server sometimes blocks you), the xpath in tum_live.py etc. I also disabled jump cutting and the semaphores because that threw some errors, please feel free to ignore that.

atticus-sullivan commented 2 years ago

I experienced this as well (with panopto). Apparently I didn't even found a m3u8 in the page source. Maybe an alternative would be to use the pendant to the Network-tab in the developer options of the browser. We should be able to access the data via logs = driver.get_log("performance") json.loads(logs[i]["message"])["message"]["params"]["request"]["url"] (and then searching for some master.m3u8 or index.m3u8). But we'd need something like capabilities["goog:loggingPrefs"] = {"performance": "ALL"} # chromedriver 75+ for the selenium setup.

Didn't test this again, just used this some time again (but the code wasn't pretty since not all elements of logs consist of all the members used to extract the url)

EDIT: Oh your problem was with tum_live I see. Well I didn't check on that, but maybe checking the chrome log helps in this case as well.

Valentin-Metz commented 2 years ago

The URL issue with TUM-live is fixed in the latest version. If this reoccurs, please open a new issue.