diff --git a/DefaultConstants.py b/DefaultConstants.py index b922f3e..60d98f1 100644 --- a/DefaultConstants.py +++ b/DefaultConstants.py @@ -24,10 +24,18 @@ class Constants: CONFESSION_COMMAND_ID = 1159423004346957835 CONFESS_REVIEW_COMMAND_ID = 1159423004346957834 - KICK_PROXY = "" - FANS_PROXY = "127.0.0.1:8888" - OF_PROXY = "" + KICK_PROXY = "" #Chrome/Chromium doesn't support authenticated proxies + FANS_PROXY = "127.0.0.1:8888" #Chrome/Chromium doesn't support authenticated proxies + OF_PROXY = "" #Chrome/Chromium doesn't support authenticated proxies + #CB_PROXY = "" # Everything below assumed is a socks5 proxy. Commented out lines don't support proxies yet MV_PROXY = "" + BC_PROXY = "" + SC_PROXY = "" + EP_PROXY = "" + CAM4_PROXY = "" + MFC_PROXY = "" + #YT_PROXY = "" + #TWITCH_PROXY = "" else: GUILD_ID =1058859922219081778 #Guild ID of the discord server whiteListedRoleIDs = [1062179283705020486,145802742647095296,1100148453792813086,245364417783398400] # IDs of Roles you wish to be white listed for some commands. You can also add user IDs if you want to add an individual without a role @@ -49,10 +57,18 @@ class Constants: CONFESSION_COMMAND_ID = 1159321755270250571 CONFESS_REVIEW_COMMAND_ID = 1159321755270250570 - KICK_PROXY = "" - FANS_PROXY = "127.0.0.1:8888" - OF_PROXY = "" + KICK_PROXY = "" #Chrome/Chromium doesn't support authenticated proxies + FANS_PROXY = "127.0.0.1:8888" #Chrome/Chromium doesn't support authenticated proxies + OF_PROXY = ""#Chrome/Chromium doesn't support authenticated proxies + #CB_PROXY = "" # Everything below assumed is a socks5 proxy MV_PROXY = "" + BC_PROXY = "" + SC_PROXY = "" + EP_PROXY = "" + CAM4_PROXY = "" + MFC_PROXY = "" + #YT_PROXY = "" + #TWITCH_PROXY = "" WAIT_BETWEEN_MESSAGES = 1800 # minimum amount of time in seconds the stream has to be offline before new notification messages. MIN_TIME_BEFORE_AVATAR_CHANGE = 48 # Minimum time before avatar changes -- in hours diff --git a/README.MD b/README.MD index 621e7d1..0b46807 100644 --- a/README.MD +++ b/README.MD @@ -98,9 +98,11 @@ 4. If the requesting ip is in a state that requires age verification, some of these checkers wont work. ### Update History -- 10/20/2024 +- 10/21/2024 - Added ManyVids Support - Because of this many things have changed in Default/App Constants so they will need to be updated with new vars + - Added proxy support for most of the checkers. Anything that doesn't use nodriver will use socks5 + - changed requirements update them with 'pip install -U -r requirements.txt' - Change nodriver temp file behavior. Uses default behavior in windows - 10/19/2024 - Improvements on Twitch checker to hopefully work more quickly diff --git a/checkers/Bongacams.py b/checkers/Bongacams.py index cb8d69b..262fcf6 100644 --- a/checkers/Bongacams.py +++ b/checkers/Bongacams.py @@ -9,6 +9,7 @@ from utils.NoDriverBrowserCreator import getUserAgent import logging from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies logger = logging.getLogger(__name__) logger.setLevel(Constants.SASSBOT_LOG_LEVEL) @@ -21,7 +22,10 @@ def isModelOnline(bcUserName): agent = getUserAgent() headers = {"User-Agent": agent} try: - page = requests.get(f'https://bongacams.com/{bcUserName}',headers=headers) + if Constants.BC_PROXY: + page = requests.get(f'https://bongacams.com/{bcUserName}',headers=headers, proxies=GetProxies(Constants.BC_PROXY)) + else: + page = requests.get(f'https://bongacams.com/{bcUserName}',headers=headers) time.sleep(1) if page.status_code == 200: soup = BeautifulSoup(page.content, "html.parser") diff --git a/checkers/Cam4.py b/checkers/Cam4.py index 5bb5e46..bbb5895 100644 --- a/checkers/Cam4.py +++ b/checkers/Cam4.py @@ -9,6 +9,7 @@ from utils.NoDriverBrowserCreator import getUserAgent import logging from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies logger = logging.getLogger(__name__) logger.setLevel(Constants.SASSBOT_LOG_LEVEL) @@ -21,7 +22,10 @@ def isModelOnline(cam4UserName): agent = getUserAgent() try: headers = {"User-Agent": agent} - results = requests.get(f"https://www.cam4.com/rest/v1.0/search/performer/{cam4UserName}", headers=headers) + if Constants.CAM4_PROXY: + results = requests.get(f"https://www.cam4.com/rest/v1.0/search/performer/{cam4UserName}", headers=headers, proxies=GetProxies(Constants.CAM4_PROXY)) + else: + results = requests.get(f"https://www.cam4.com/rest/v1.0/search/performer/{cam4UserName}", headers=headers) time.sleep(1) try: cam4Json = results.json() diff --git a/checkers/Eplay.py b/checkers/Eplay.py index f1538d4..78a92f3 100644 --- a/checkers/Eplay.py +++ b/checkers/Eplay.py @@ -8,6 +8,7 @@ import json import logging from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies logger = logging.getLogger(__name__) logger.setLevel(Constants.SASSBOT_LOG_LEVEL) @@ -18,13 +19,19 @@ def isModelOnline(epUserName): tempThumbUrl = "" icon = Constants.defaultIcon try: - request = requests.get(f"https://eplay.com/{epUserName}") + if Constants.EP_PROXY: + request = requests.get(f"https://eplay.com/{epUserName}", proxies=GetProxies(Constants.EP_PROXY)) + else: + request = requests.get(f"https://eplay.com/{epUserName}") time.sleep(1) soup = BeautifulSoup(request.content, "html.parser") profileJson = soup.find_all("script", type="application/json") profileJson = json.loads(profileJson[0].text) isOnline = profileJson["props"]["pageProps"]["dehydratedState"]["queries"][0]["state"]["data"]["live"] title = profileJson["props"]["pageProps"]["dehydratedState"]["queries"][0]["state"]["data"]["title"] + title = title.replace('\u200b', '') + title = title.replace('\r', '') + title = title.replace('\n', '') tempThumbUrl = profileJson["props"]["pageProps"]["dehydratedState"]["queries"][0]["state"]["data"]["ss"] + "?" + str(int(time.time())) icon = profileJson["props"]["pageProps"]["dehydratedState"]["queries"][0]["state"]["data"]["avatar"] except requests.exceptions.ConnectTimeout: diff --git a/checkers/Manyvids.py b/checkers/Manyvids.py index 07047f3..cdcde36 100644 --- a/checkers/Manyvids.py +++ b/checkers/Manyvids.py @@ -5,6 +5,7 @@ except ImportError: from DefaultConstants import Constants as Constants from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies import logging import re @@ -18,7 +19,7 @@ def isModelOnline(mvUserName): icon = Constants.defaultIcon pageUrl = f"https://www.manyvids.com/live/cam/{mvUserName.lower()}" if Constants.MV_PROXY: - page = requests.get(pageUrl, proxies=GetProxies()) + page = requests.get(pageUrl, proxies=GetProxies(Constants.MV_PROXY)) else: page = requests.get(pageUrl) soup = BeautifulSoup(page.content, "html.parser") @@ -40,10 +41,3 @@ def GetIcon(soup:BeautifulSoup, mvUserName): if icon: icon = icon.group() return icon - -def GetProxies(): - proxies = { - 'http': f'{Constants.MV_PROXY}', - 'https': f'{Constants.MV_PROXY}', - } - return proxies diff --git a/checkers/Myfreecams.py b/checkers/Myfreecams.py index abfb824..109cb04 100644 --- a/checkers/Myfreecams.py +++ b/checkers/Myfreecams.py @@ -7,6 +7,7 @@ from bs4 import BeautifulSoup import logging from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies logger = logging.getLogger(__name__) logger.setLevel(Constants.SASSBOT_LOG_LEVEL) @@ -17,7 +18,10 @@ def isModelOnline(mfcUserName): tempThumbUrl = "" icon = Constants.defaultIcon try: - request = requests.get(f"https://share.myfreecams.com/{mfcUserName}") + if Constants.MFC_PROXY: + request = requests.get(f"https://share.myfreecams.com/{mfcUserName}", proxies=GetProxies(Constants.MFC_PROXY)) + else: + request = requests.get(f"https://share.myfreecams.com/{mfcUserName}") time.sleep(1) soup = BeautifulSoup(request.content, "html.parser") vidPreview = soup.find(class_='campreview d-none') diff --git a/checkers/Stripchat.py b/checkers/Stripchat.py index 1b22422..320960a 100644 --- a/checkers/Stripchat.py +++ b/checkers/Stripchat.py @@ -8,6 +8,7 @@ from utils.NoDriverBrowserCreator import getUserAgent import logging from utils.StaticMethods import GetThumbnail +from utils.StaticMethods import GetProxies logger = logging.getLogger(__name__) logger.setLevel(Constants.SASSBOT_LOG_LEVEL) @@ -20,7 +21,10 @@ def isModelOnline(scUserName): agent = getUserAgent() headers = {"User-Agent": agent} try: - page = requests.get(f'https://stripchat.com/api/vr/v2/models/username/{scUserName}', headers=headers) + if Constants.SC_PROXY: + page = requests.get(f'https://stripchat.com/api/vr/v2/models/username/{scUserName}', headers=headers, proxies=GetProxies(Constants.SC_PROXY)) + else: + page = requests.get(f'https://stripchat.com/api/vr/v2/models/username/{scUserName}', headers=headers) time.sleep(1) if page.status_code == 200: try: diff --git a/requirements.txt b/requirements.txt index 7274ae0..4231695 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/utils/StaticMethods.py b/utils/StaticMethods.py index ff74993..35b55b5 100644 --- a/utils/StaticMethods.py +++ b/utils/StaticMethods.py @@ -283,3 +283,10 @@ def GetThumbnail(tempThumbUrl, constantsThumbnail): thumbnail = tempThumbUrl return thumbnail + +def GetProxies(proxyIpPort): + proxies = { + 'http': f'socks5://{proxyIpPort}', + 'https': f'socks5://{proxyIpPort}' + } + return proxies