 Hey everyone, welcome back to another Python challenge. We're still back at our little Python programming kind of riddle that we have online here. We just finished the fifth challenge, now we're moving on to the sixth challenge. We're on channel.html and there's nothing on the page other than, I don't even know what this is, a picture of someone's fly? What is this? There's a donate button down here. Let's take a look at the source. The title is Now There Are Pares. I don't know what that means, but I'll find out, I guess. And the image is simply the image. I don't think there's anything more to that. And there's a comment here that the following and nothing to do with the riddle itself would be the right point to ask you to donate. Nice. Okay, yeah, that's super nice. Hey, special request to all you guys watching, I guess it would be pretty cool if we donated. Keep that in mind as you go through the series, I guess. I don't see any hints here whatsoever. There's literally nothing about the challenge being stated. What do you guys think? Oh hey, look at the top here. There's an HTML tag for declaration, because obviously this is HTML. It should be. And there's a comment like literally right after it, normally where a dog type would be. There's a comment of zip. What is that supposed to mean? Other than the fact that there's a person's fly on the screen right now. Zip. There could be zip files. And this is an HTML file, channeled at HTML. Ooh, I wonder, hang on, hang on. Go up to the URL bar and change HTML to zip. Hey, yep, yep, that file exists. All right, I'm going to save this. I'm going to save it in my desktop as usual. And let's take a look at it. This is my video recording thing, and there's our zip file. Let's take a look. Oh, that's a lot of text files. What are you guys doing? Look at this, look at this. Oh, all right, go away, Winrar. It doesn't matter. 910 files of just text files. Holy crap. Look at the size of my scroll bar. That is absurd. And they're just all numbered. This is like the link list challenge. This is like challenge number four or something. All right, I'm going to hit the end button. See, all the way at the end. Okay, there is a readme file. Take a look at this. Welcome to my zip list. Thanks. Hint one, start from 9,052. 90,052, sorry. Answer is inside the zip. Okay, that's a plus. We don't have to do anything else. Do we like want to extract all this stuff? I mean, I guess. I feel like we should. I'm going to create a new folder. Zipped. Zipped. And let's just extract literally like everything in there. There's a source. There's a zip file. Extract everything to zipped. And it can take a few seconds. Moving it all. Okay, that was not bad. I mean, they're all text files, so they should happen pretty quickly. There are 910 of them, but all right. Look, it's given Windows Explorer is going to give us a nice little preview. Next nothing is 29888, so. Huh, okay. Let's see what we find. Start to write some code to go through this. I should resave my Python file into the zipped one. So let's start, I guess. First equals open. They said start with 90,052, right, dot text. Contents equals first dot read. Next nothing is that thing. Okay. What we'll do is I guess we'll do a function. Define next nothing. So we'll have kind of like a similar setup to our linked list challenge. Don't challenge number four. And the argument should be file name. Open file name. Oh, sorry. File name is a variable. And then we can, I should be able to close it once I'm done. Handle dot close. Contents equals file name dot read. Next can equal contents dot split. And we'll split it like by the spaces. And we'll get the very last one with like Python indexing. And if we print next, we'll see what we're doing here. And now we'll just use this next nothing function on the first one that we wanted, 90,052 dot text. I'll just read it. Oh, sorry. Handle dot read. Not file name. Sorry, guys. And then, okay, it says the next one is that. So what we can do, we can just go next nothing with next and get a little recursive function there. What we'll do is we'll print that next and we'll keep moving. Oh, yeah. And we need to add a dot text at the end of it in our opening file name. Let's go. Oh boy. Okay. That went through a whole lot of stuff. And it stopped at 36542. I probably went through too many files. Too many files, 36542. All right. That's cool. I mean, I don't mind. Let's take a look at the 36542. Is that a thing? Is 36542 a file? 36542. What if I search for it? 36. Yeah. Okay. Yeah, it is. We're each going. Okay. So let's try it one more time. Comments dot text. Ooh. Ooh. Wait, there's an extra period there. That means that it wasn't supposed to have a, it wasn't supposed to have that one there. We're getting somewhere. What do we get here? Comments. So the last, the previous one we were at was 46145. Let's check this out. 46145. Collect the comments. What does that mean? What comments? Were there comments in all of these things? I don't think so. 46145. Is that like part of Python Challenge 46145 dot HTML? Nope. That's not real. What do I do? What do I do here? In, because there's only one comment in this, in this like the prompt, I guess. Maybe some of these things like actually have comments in them. I'm looking over at the preview on the side of the windows to explore and I don't see anything whatsoever. Unless like it, the file comes with anything. What if I, all right. I'm going to backtrack one more time. Let's go back to our Python thing here. Let's go back to Python code. 678. And then just goes where it needs to be. Crap. I don't know what it means. I don't know what to do. Hey, wait a second. Collect the comments. Zip files have like comments built into them, don't they? Yeah, I remember now. All right. I'm probably going to need to open up some documentation for this because we're going to need to use Python zip file module import zip file. Python zip file. Objects file. Get info. Get info on a name. Zip info. Zip info. I know that stores like information or info lists. Okay. Hey. So, okay. Zip file can open. Zip file can open files. So that works pretty well for us. Let's set into, let's say that the zip equals zip file.zip file with channel.zip. And I'll just bring the zip file into zip folder so that we can actually see the zip file and handle equals the zip open. Extract a member of the archive and then we can read from it. Can't we? Yeah. Let's try it. Yep. Okay. That works just fine. So we are opening them and now we need to be able to get the comments because I know that each file can be stored with a comment, right? In a zip file. And those are stored in the info. Yeah, yeah, yeah, yeah. Look at this. Okay. Zip file.comment. The comment text is associated with zip file. If assigning to a comment, zip file is included with the mode. What do I do with that? Is it for each and every object? Let's try print the zip. Print the zip file, get info on the file name, which would be next in this case. And then we can get the comment from that. Can't we? Check it out. No. Oh yeah. We got to add our text file suffix. Hey. I saw some stuff there. Whoa. Okay. We're getting letters. We're getting letters. And stars and stars and stuff. Let's add this to a list. Comments goes this. And we should start, I think, back at the beginning. Let's go 952 everywhere. Let's go. Too many files. Yep. Why is it doing that? I feel like there's got to be an easier way. I don't have to open or read all of them. I feel like there's got to be a way within the zip file to get info rather than open the file up. Read. Yeah. Yeah. Yeah. Okay. All it does is just read. So let's try that. Next equals handle. Because now it's just getting the text for us. So I'll just change that to text. And then we don't have to close it. Is that a error for us? Yep. Okay. And now we've got super duper far. And all the comments have been added. So let's check out at the very end. Let's check out the comments. But we've got to stop that error from occurring. So if next, I think is digits, is that a function? Will that work for us? I know that's a, I'm going to fire up idle and check it out. I know is digit, is all numb. Yeah. Maybe that's what I want. All right. Whatever. I'll just test it. If it's not comments. If next does not equal comments. Super like brute force way of programming here. But you know that's the way we get it done with Python Challenge. Check it out. I should have been doing this all along. Maybe that was working to begin with. And I was just missing the line. Whatever. Let's roll. Hey, there we go. Okay. We get our list of comments. And they're all, yeah, they're all in the array. So I know we can use a four comment in comments. I should learn to type print that comment and no new line. Whoa. What? Hockey upside down. Can I reverse it? I wonder if that'll actually change the way it is. Yeah. Wow. Okay. Hockey. Let's take a look at that in Python Challenge. Maybe that's our key. Maybe that's the next flag. Oxygen. You guys caught me. All right. So take a look at this. Hockey is spelled with oxygen. Look at these letters. O X Y G E N. Hockey. What do you think that would have given us? Probably like another hand to like, no, you're an idiot. Take a look at the letters. It's in the air. Look at the letters. Seriously. O X Y G E N. Would you guys have been able to catch that? I know I didn't for a long time. Oxygen. And that's our next challenge, number seven. So, cool. Well, we finally got through it. I know that one was kind of rough. That one pretty much sucked. But it's over now. Thanks for watching, guys. I hope you enjoyed this video, and I hope you were able to at least bear with me. I'll see you in the next video.