From 636dd6da97481c02bdd01b5d677d7619b09371a2 Mon Sep 17 00:00:00 2001 From: horacio9a Date: Sun, 23 May 2021 01:33:41 +0200 Subject: [PATCH] v.2.0.0 Cam4 Anonymous Get Online All Models for Python27 --- C4_getOnlineAllModels.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 C4_getOnlineAllModels.py diff --git a/C4_getOnlineAllModels.py b/C4_getOnlineAllModels.py new file mode 100644 index 0000000..b19f0b8 --- /dev/null +++ b/C4_getOnlineAllModels.py @@ -0,0 +1,33 @@ +# Cam4 Anonymous Get Online All Models v.2.0.0 by horacio9a for Python 2.7.18 +# coding: utf-8 + +import sys, os, urllib, ssl, re, json, requests +from sys import exit +offline = False + +def getOnlineUsers(page): + attempt = 1 + while attempt < 3: + try: + results = requests.get("https://www.cam4.com/directoryCams?directoryJson=true&online=true&url=true&page={}".format(page)).json() + return results + except: + attempt = attempt + 1 + +if __name__ == '__main__': + while True: + attempt = 1 + online = [] + while not offline: + results = getOnlineUsers(attempt) + if len(results['users']) > 1: + online.extend([user['username'] for user in results['users']]) + else: + offline = True + attempt = attempt + 1 + offline = False + for username in online: + online_all_model_list = username.lower() + print(online_all_model_list) + if attempt > 3: + exit(0)