Skip to content

Instantly share code, notes, and snippets.

@justfoolingaround
Last active January 13, 2022 14:50
Show Gist options
  • Save justfoolingaround/6168a25a598870199aee389c12896c53 to your computer and use it in GitHub Desktop.
Save justfoolingaround/6168a25a598870199aee389c12896c53 to your computer and use it in GitHub Desktop.
An indefinite archillect.com generator
import httpx
import regex
import ujson
URL_FIND = regex.compile(r'"url":"(.+?)"')
ENDPOINT = "https://archillect.com/socket.io/"
def get_sid(session):
return ujson.loads(session.get(ENDPOINT, params={'EIO': '3', 'transport': 'polling'}).text[4:-4]).get('sid')
def get_image(session, sid):
response = session.get(ENDPOINT, params={'EIO': '3', 'transport': 'polling', 'sid': sid}).text
if response == '1:1':
return get_image(session, get_sid(session))
return URL_FIND.search(response).group(1), sid
def get_images(session, sid):
while 1:
image, sid = get_image(session, sid)
yield image
client = httpx.Client(headers={'referer': 'https://archillect.com/tv'}, timeout=None)
sid = get_sid(client)
for image in get_images(client, sid):
print(image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment