lexi

i like breaking computers

  • it/its, #[deprecated] she/her
  • ./a.out

i like rust, nix, linux, infosec, webdev and i shitpost a lot. ctf player and so-called "security researcher". aroace, agender, nb, nd, disabled, &, ΘΔ :3 🏳️‍⚧️ 🟨⬜️🟪⬛️

picrew: #1322863


so instead of learning i reverse engineered the learning platform i was using. just webdev with ADHD things

read more - details for nerds

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:

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="{&quot;video&quot;:{&quot;id&quot;:[video id],&quot;stream_urls&quot;:[&quot;[video link].m3u8&quot;]

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


You must log in to comment.

in reply to @lexi's post: