#!/usr/bin/env python3 """Debug probe — dumps raw MPD XML after login.""" import json, os, sys, requests from bs4 import BeautifulSoup URL = 'https://www.cda.pl/video/56706683e/vfilm' VIDEO_ID = '56706683e' UA = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' HEADERS = {'User-Agent': UA, 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest'} username = os.environ.get('CDA_USER') password = os.environ.get('CDA_PASS') if not username or not password: sys.exit('Set CDA_USER and CDA_PASS env vars first.') s = requests.Session() s.post('https://www.cda.pl/login', data={'username': username, 'password': password}, headers={'User-Agent': UA}, allow_redirects=True, timeout=15) vi = json.loads(BeautifulSoup( s.get(URL, headers=HEADERS, timeout=15).text, 'html.parser' ).find('div', id=f'mediaplayer{VIDEO_ID}')['player_data'])['video'] mpd_url = vi['manifest'] print('MPD URL:', mpd_url) r = s.get(mpd_url, headers={'User-Agent': UA}, timeout=15) print('MPD status:', r.status_code) print(r.text)