StreaMonitor
StreaMonitor copied to clipboard
[Feature Request] Recording for hidden accounts on Strip
Many accounts are using Geoblock and IP ban recnetly. This only affects the Strip API, but not the streaming recording. If you know the playlist URL (using VPN), you can record with FFmpeg. Would a new proxy feature or something similar be possible to bypass the block and get the playlist?
just use VPN
This is a temporary solution to obtain the JSON from another location without using a VPN. Patch for #stripchat.py
def getStatus(self):
url = f'https://stripchat.com/api/front/v2/models/username/{self.username}/cam?uniq={StripChat.uniq()}'
r = requests.get(
url,
headers=self.headers
)
try:
data = r.json()
except requests.exceptions.JSONDecodeError:
self.log('Failed to parse JSON response')
return Status.UNKNOWN
if data['user'].get('isGeoBanned') is True:
url_wrapper = 'https://your_api.com/api/proxy'
data_wrapper = {
'url': url,
'method': 'GET',
'headers': {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0',
},
'data': {}
}
r = requests.post(url_wrapper, json=data_wrapper)
if r.status_code != 200:
return Status.UNKNOWN
try:
data = r.json()
except requests.exceptions.JSONDecodeError:
self.log('Failed to parse JSON response from proxy')
return Status.UNKNOWN
if 'cam' not in data:
if 'error' in data:
error = data['error']
if error == 'Not Found':
return Status.NOTEXIST
self.logger.warn(f'Status returned error from proxy: {error}')
return Status.UNKNOWN
self.lastInfo = {'model': data['user']['user']}
if isinstance(data['cam'], dict):
self.lastInfo |= data['cam']
status = self.lastInfo['model'].get('status')
if status == "public" and self.lastInfo["isCamAvailable"] and self.lastInfo["isCamActive"]:
return Status.PUBLIC
if status in ["private", "groupShow", "p2p", "virtualPrivate", "p2pVoice"]:
return Status.PRIVATE
if status in ["off", "idle"]:
return Status.OFFLINE
if self.lastInfo['model'].get('isDeleted') is True:
return Status.NOTEXIST
self.logger.warn(f'Got unknown status: {status}')
return Status.UNKNOWN
To deploy, you could use Render.com or another service. Example with Node.js:
const express = require("express");
const axios = require("axios");
const app = express();
const port = 3000;
app.use(express.json());
app.post("/api/proxy", async (req, res) => {
const { url, method = "GET", headers = {}, data = {} } = req.body;
try {
const response = await axios({
method,
url,
headers,
data,
});
res.json(response.data);
} catch (error) {
console.error("Error en la solicitud:", error.message);
res.status(500).json({ error: "Ocurrió un error al hacer la solicitud" });
}
});
app.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);
});
Brilliant, I'll try it