Extracting Hidden Clues from ZIP Archive Comments in Python Challenge Level 6
Accessing the sixth level at http://www.pythonchallenge.com/pc/def/channel.html reveals a minimal page: an image of a zipper and a PayPal donation button. The donation form is irrelevant to solving the puzzle, so attention shifts to the HTML source.
A key clue appears in the first comment: <!-- <-- zip -->. This strongly hints at handling ZIP archives — not the built-in zip() function, but the zipfile module.
Attempting http://www.pythonchallenge.com/pc/def/zip.html yields only the message "yes. find the zip.", confirming the direction but not the format. Appending .zip instead gives http://www.pythonchallenge.com/pc/def/channel.zip, which downloads a valid archive.
After extracting channel.zip, inspecting readme.txt inside shows:
welcome to my zipped list.
hint1: start from 90052
hint2: answer is inside the zip
Each text file (e.g., 90052.txt) contains a line like Next nothing is 94191. Traversing this chain programmatically leads to the phrase "Collect the comments." — indicating the solution lies not in file contents, but in their metadata.
ZIP files support per-file comments stored in the central directory. Using zipfile.ZipFile, we follow the numeric chain while collecting ZipInfo.comment values from each corresponding entry:
import zipfile
archive = zipfile.ZipFile('channel.zip')
next_id = '90052'
comments = []
while True:
try:
with open(f'channel/{next_id}.txt', 'r') as f:
content = f.read().strip()
# Extract next number from end of line
parts = content.split()
next_id = parts[-1] if parts else None
# Fetch and store comment from ZIP entry
info = archive.getinfo(f'{next_id}.txt')
if info.comment:
comments.append(info.comment.decode('utf-8', errors='ignore'))
if not next_id or not next_id.isdigit():
break
except (FileNotFoundError, KeyError):
break
print(''.join(comments))
Running this outputs an ASCII-art patttern spelling "HOCKEY", followed by repeated "OXYGEN"-themed blocks. The visual repetition and context suggest the real hidden word is oxygen, not hockey — a hint that the letters are layered or misleading. Thus, the next stage URL becomes http://www.pythonchallenge.com/pc/def/oxygen.html.