-
Notifications
You must be signed in to change notification settings - Fork 0
/
hockey.py
36 lines (25 loc) · 876 Bytes
/
hockey.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from getchallenge import challenge
from PIL import Image
from io import BytesIO
clue = "hockey.html"
problem = challenge(clue)
print(problem.text)
'''
Its in the air. Look at the letters if we look at the letters
that make up hockey they spell oxygen so lets try that one
'''
clue2 = 'oxygen.html'
problem = challenge(clue2)
print(problem.text)
'''
a png file, looks like image processing may be needed
so the image has a band of grey pixels this bad must be my encoded data
I need to figure out a way to read it.
'''
clue3 = 'oxygen.png'
problem = challenge(clue3)
pic = Image.open(BytesIO(problem.content))
# loaded image into an image object , now the real work begins
data = [pic.getpixel((i, 45)) for i in range(0, pic.size[0], 7)]
ords = [r for r, g, b, a in data if r == g == b]
print("".join(map(chr, map(int, re.findall("\d+", "".join(map(chr, ords)))))))