Skip to content

Instantly share code, notes, and snippets.

@charlie-collard
Created November 15, 2022 12:56
Show Gist options
  • Save charlie-collard/d586b4db5ac02ba8c06211cb3e9769ff to your computer and use it in GitHub Desktop.
Save charlie-collard/d586b4db5ac02ba8c06211cb3e9769ff to your computer and use it in GitHub Desktop.
import requests
import re
import bs4
import base64
import time
# mkfifo mypipe
# ffmpeg -f image2pipe -c:v mjpeg -i mypipe output.mp4
with open("mypipe", "wb") as f:
while True:
r = requests.get("https://crowd-jpeg.vercel.app/")
soup = bs4.BeautifulSoup(r.text, 'html.parser')
f.write(base64.b64decode(soup.find_all('img')[0]["src"]))
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment