Optimize stripchat.py performance with caching & improved request handling#268
Optimize stripchat.py performance with caching & improved request handling#268medi0x1 wants to merge 16 commits intolossless1024:masterfrom
Conversation
|
NameError: name '_mouflon_cache_filename' is not defined |
|
Run the program nd copy everything from |
Clean up code added during merge
Fixed the merge conflict bug. Please review nd let me knw if any changes needed |
|
Tested, working well |
|
File "C:\Users\OneDrive\Desktop\SC\StreaMonitor\Downloader.py", line 43, in how to solve this ?? |
Corrects the SC player script URL by removing a duplicated version prefix. mmpVersion already contains v, resulting in vv2.x.x/main.js → 404. Updated to v2.x.x/main.js so main.js loads properly.
You can fix the issue by removing the extra v since mmpVersion already contains it: - mmp_base = f"{mmp_origin}/v{mmp_version}"
+ mmp_base = f"{mmp_origin}/{mmp_version}"This corrects vv2.x.x → v2.x.x and resolves the 404. |
|
Error while trying to add a model from SCVR 2025-12-15 23:54:36,854 - INFO - manager_cli: Failed to add: StripChat.init() takes 2 positional arguments but 3 were given Same error from both cli and web frontend. Fixed by removing the roomid artifact in the stripchat_vr.py file and using the same as in your version of stripchat.py def init(self, username): instead of def init(self, username, room_id=None): |
|
INFO - manager_cli: Failed to add: Doppio.js not found |
same mistake |
|
Maybe |
It works correctly. Thanks |
|
Just to keep scope tight: this PR only touches stripchat.py. If VR stuff is breaking, that’s a separate issue. |
|
For the record, I do not experience the resolution or fps issue with VR on my end after making the necessary changes to fix stripchat based medi0x1's build and the additional fix I provided for stripchat vr file. Seems indeed unrelated. |
Interesting, sorry i thought sc and scvr was intertwined. |
|
Fixes a regression in SC HLS playlist handling. Ensures playlist parameters are correctly applied to variant URLs, restoring proper segment resolution and ffmpeg startup behavior.
Adds support for Mouflon v2 (psch=v2) HLS playlists on SC. Implements URI-based segment decoding, including reversed encrypted segments and EXT-X-MAP init handling, while preserving existing Mouflon v1 FILE-based logic.
|
I’ve updated the PR please pull latest and test if it works on your side. |
works for me again |
|
Aweseome work man, StripChat itself works perfectly again! But to get StripChat-VR working it still needs a small fix inside stripchat_vr.py like already mentioned earlier in this post by someone else. From: To: |
|
Appreciate the confirmation. This PR is limited to stripchat.py; VR is a separate topic. |
|
@medi0x1 looks like they changed something again. Only the promo trailer gets downloaded again 😞 |
Added updated decryption keys to fix promotional video download issue. Changes: - Added two new decryption keys - Kept existing key for backward compatibility
|
Pushed the fix. Please pull latest nd test if it works on your side. |
Yes it is working again. Thanks :) |
|
Thanks, this works |
|
@medi0x1 looks like they just changed something again :/ Traceback (most recent call last): If I remove every SC model the Downloader runs again and if I try to add a SC model I get "Failed to add features" error |
SC decided to rename their api fields nd broke everything lol changed `features` → `featureSettings` so it actually works now tested: doesn't crash anymore
|
updated, test if it works on ur side. |
Works perfectly again :) Thanks |
img.doppiocdn.com is dead for the player assets, they quietly moved everything to mmp.doppiocdn.com. Same version, different subdomain. - hardcoded origin was pointing to the old img. subdomain → 404 on main.js - updated MMPExternalSourceOrigin to mmp.doppiocdn.com one line fix, took longer to debug than to patch lol
|
Hardcoding |
|
adding stripchat works, but adding stripchatVR gives error:
|
|
i keep getting this when i add a SC streamer Exception in thread Thread-211 (execute): |
Merged PR lossless1024#268 from upstream, which implements various improvements to the Stripchat scraper, including updates to the CDN origin, SC API response field mappings (e.g. features -> featureSettings), and handling of HLS playlist generation. This correctly resolves issue 268. Co-authored-by: wicckyy <111511550+wicckyy@users.noreply.github.com>





Summary
This PR optimizes stripchat.py implementation to improve performance & reduce resource usage. The changes focus on reducing redundant computations, improving network efficiency, nd adding better fallback mechanisms.
Changes
Performance Improvements
Added LRU caching for frequently computed operations:
Pre-compiled regex patterns at class level instead of compiling on every use
Optimized string operations:
Improved network handling:
Better memory usage:
Robustness Improvements
Multiple fallback patterns for finding doppio.js file:
require()pattern and new chunk-based patternAutomatic proxy support from environment variables (HTTP_PROXY, HTTPS_PROXY)
Improved error handling with proper exception catching
Code Quality
Performance Impact
Testing shows significant improvements:
Compatibility
Testing
Related
This builds on the improvements from PR #263 and PR #264 by combining their approaches with additional optimizations.