Spaces:
Running
Running
Commit ·
e704f19
1
Parent(s): 40ff791
debug: verbose video POST error logging
Browse files673 unmodified lines674675676677677678679680681680682683684685686687688685689690691692687693694695696697698673 unmodified lines f"{CASTLE_BASE}/film-api/v2.0.1/movie/getVideo?clientType={CLI}&packageName={PKG}&channel={CH}&lang={LANG}", json=body, headers={"Content-Type": "application/json"} ) if vr.status_code != 200: continue if vr.status_code != 200: errors.append(f"Castle: video POST HTTP {vr.status_code} for lang {ln}") continue try: vp = cdec(vr.text) except: continue except Exception as vde: errors.append(f"Castle: video decrypt fail for lang {ln}: {vde}") continue vd = vp.get("data", vp) if isinstance(vd, str): try: vd = json.loads(vd) except: continue if not isinstance(vd, dict): continue if not isinstance(vd, dict): errors.append(f"Castle: video data not dict for lang {ln}: {type(vd)}") continue vurl = vd.get("videoUrl", "") if not vurl: continue if not vurl: errors.append(f"Castle: no videoUrl for lang {ln}, keys={list(vd.keys())[:5]}") continue
vids = vd.get("videos", []) if vids and isinstance(vids, list):main.py+12-4