so instead of learning i reverse engineered the learning platform i was using. just webdev with ADHD things
the site is studyflix! starting the reverse engineering, i looked up their tech stack:

just a regular NGINX server, no cloudflare, no nothing. nice! looking up their IP confirmed my suspicion that they host it on a dedicated server and don't use any proxies like CF:


so that means we can access everything without having to do captchas or other BS!
digging a bit into the network debugger, i found this endpoint: https://studyflix.de/subject_area_switcher. we can parse that with a simple HTML parser without any hassle, so thats nice. from there you can get the playlists, parse those again and you have the IDs.
for downloading videos: the video URLs always have this pattern: https://studyflix.de/[subject]/[lesson-name]-[numerical-video-id]
here are two quirks though:
-
as long as the subject field is a valid subject, it will just use the numerical video id. so for example, https://studyflix.de/informatik/something-entirely-different-4131 points to https://studyflix.de/chemie/atome-einfach-erklart-4131.
-
the video IDs are incremental. ohohohoho
if a video does not exist, you get 302d to https://studyflix.de/?error=not_found. so you can just use this to scrape all video ids:
let videoID = 0;
let videos = []
let u = "https://studyflix.de"
while (++videoID) {
let res = await fetch(`${u}/chemie/z-${videoID}`);
if (res.url === "${u}/?error=not_found") continue;
let [_, subject, name,id] =
res.url.match(/de\/([^\/])\/(.+)-([0-9]+)$/)
videos.push({subject, name, id, url: res.url});
}
scraping the text is pretty straightforward, just parse the HTML and query <div class='description-section--text'>'s innerHTML and you got it. the videos are a bit more complicated: you need to fetch the HTML page and find this:
<div class="player -sixteen-to-nine" player="" up-data="{"video":{"id":[video id],"stream_urls":["[video link].m3u8"]
then you just put that m3u into yt-dlp and boom you have video and text for all videos on studyflix!
also, i built a CLI lol
