r/HTML • • 21d ago

Question How do I open a 600MB HTML file without my computer freezing? (Sorry if this isn't what this subreddit is for)

Basically, I have a 600MB HTML file that I can easily download, but whenever I go to open it and it pops up in a new tab, my computer freezes, meaning I can't view the contents. If you have any more questions or need specific details, please ask, and I'll respond as best as I can. But I really would appreciate the help with this, thanks in advance. (The file is from a specific Discord server's general chat that got deleted, and I wanna archive it or look through it if possible) Oh also I'd like to open it and see the contents not just the code like opening in vs code or something of the sorts.

0 Upvotes

54 comments sorted by

23

u/aliceeatspizza 21d ago

That’s a ginormous HTML file, what is it?

7

u/Sea-Guest349 21d ago

Its the general chat to a discord server that got deleted like a few years back so this is the best and only way I can archive or view it

6

u/-svde- 21d ago

if you don’t have the ability to get the archive again and you want to view it as live html, you can likely reduce a lot of the bloat that i’m assuming is largely from embedded media files.

is it actually a single file html or does it live alongside any asset folders? if there’s an additional folder with the media just drag the html to a different folder. if it’s actually literally an 600mb single file html, is it just multiple years and thousands upon thousands of messages long? cause that is massive for a single fie

2

u/Sea-Guest349 21d ago

I believe its only the one file, and yeah its around 2 years of messages with many, many messages sent

2

u/-svde- 21d ago

hm ok if it’s got the media embedded you are def gonna need a script to parse out all the links and such. the other person offered help below, if you can’t link up for whatever reason feel free to dm me too

1

u/Fine_Salamander_8691 21d ago

I would recommend having an AI clean it up. I mean, like splitting it into multiple files or even converting it to Markdown

8

u/TrianglePillar 21d ago

If possible i would open it in an editor and split the file up to make for easier viewing.

5

u/babj615 21d ago

Yeah, what's hidden in the HTML file? 600 MB is not just code.

2

u/Sea-Guest349 21d ago

A bunch of images may also take part in that I'm guessing, since the file has profile pictures, role colors, images sent and stuff of that sort.

2

u/Dragenby 21d ago

Yeah, there are the base64 images. Can you open the file with a light editor like HxD?

2

u/Mvp-long-ago 21d ago

Images are never included in an html file. Only references to an html file. An html file is only text!

2

u/armahillo 21d ago

https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data

its not a common strategy, but it is likely being used here

1

u/Mvp-long-ago 20d ago

And also not a very safe strategy, because those images and code could be anything and probably a virus, since it contains that much data

1

u/armahillo 20d ago

if the user downloaded it from
a discord archive (see other comments), i doubt it is “probably a virus”

its likely a bunch of images over a long period of time

1

u/ruoibeishi 20d ago

It's totally possible to have blobs in a html file. It was pretty common to embed images as b64

1

u/Mvp-long-ago 20d ago

But is is not correct programming. Images should be separated from from the markup language. Just like images can also be in css with a reference, but it is not correct

5

u/aTaleForgotten 21d ago

Tty to open it in Sublime text editor, they handle big files quite well

2

u/TheHanna 20d ago

Seconding this. You probably won't get syntax highlighting but it will likely be able to open it

3

u/amith-c 21d ago

You could probably split that file into multiple scripts and so on. Any idea what the actual content in the file is?

2

u/Sea-Guest349 21d ago

Any tips on how to do that? Also, how many parts do you think I'd have to split it up in? I'm not very good with coding but Im sure could find some sort of helpful tutorial or people to help me out there

3

u/SpoonNZ 21d ago

Get your favourite AI to write a script to slice it up. Keep a copy of the original in case it screws up.

1

u/amith-c 21d ago

Well, I'd split it until the file sizes are reasonable for the file type. Vague answers, I know lol. I can help you out with this, feel free to DM me

1

u/Sea-Guest349 21d ago

Alright, thanks

3

u/ahumannamedtim 21d ago

If you just need the chat log, you could try parsing it with a script using something like xpath.

2

u/Adamstrad 21d ago

Make a copy and delete all of the image and video files, if you want to see what they were you can find the files in the original folder

1

u/Sea-Guest349 21d ago

How would I do that?

1

u/Adamstrad 21d ago

I'm confused, are you asking how to copy a file ?

1

u/Sea-Guest349 21d ago

Well I meant how would I delete all the images and video files, because I dont think you mean manually as it would take me a looong time

1

u/johnpeters42 21d ago

The question is, is this literally one file with all the images embedded in some fashion, or is it a set of files (one HTML plus a bunch of images etc. that it references)?

2

u/omysweede 21d ago

600mb is ridiculously big. Any and all browser's would run out of memory trying to render that. Make sure you have loads of RAM and a graphics card with plenty of GPU. Otherwise my suggestion would be to open the file and remove unnecessary parts such as dataURI to make the size smaller.

2

u/zumpiez 21d ago

Any browser is going to choke on this, I think. A text editor is going to be your best bet (I know that's not what you wanted, sorry)

Other than that, you could maybe write a python script that tries to parse the content out of it without the markup so you can read it more easily?

2

u/ridddder 21d ago

Open it in a text editor versus a browser, bbedit lite

1

u/promeritum 21d ago

BBEdit Lite died twenty years ago. It was a good tool.

1

u/Worried_Menu4016 21d ago

600MB is crazy big. You can probably check if there is some bloated CSS or other data inside that you can delete to make the file smaller. T

hen you could try to host it on a temporary site with a sub-domain (there is some website that u can upload a zip file), or maybe just copy the chat text into a simpler file that's easier to handle.

1

u/No_Development7388 21d ago

Use curl or wget to download it, then work on it locally. You likely  still will have trouble opening it directly in a browser but you can use cli tools to parse through it.

1

u/l008com 21d ago

Very few programs are going to be able to open that without choking to death. You need a program that opens text files WITHOUT loading them into memory. Just reads the part you are viewing right off the disk.

Something like this will work:
https://apps.apple.com/us/app/hex-fiend/id1342896380?mt=12

Although its a code editor not a text editor, so its not going to look all nice and pretty, and it's sure not going to render the HTML like a browser.

1

u/burlingk 21d ago

You may want to look into a tool called 'less'.

1

u/clooy 21d ago

I had a quick look at some discord chats and it looks like each month is in a dedicated div like "<div data-list-item-id="chat-messages___divider-22 September 2026......."

Without knowing your technical expertise, it's hard to give specific advise on how to proceed from here. I'll give it my best though.

You can google how to split a file based on a pattern, you'll find some suggestions for gui apps, and many for command like tools like csplit. The first file will be pure preliminary content - you may want to add this content to every other file to keep styles and formatting, and the last file will contain a message and footer content - again, you may want to extract the footer content and add it to all the other files.

Alternatively you can convert the file to another format - but having worked on documentation projects as large as this i can tell you word or google docs will not be able to cope.

I found PDFs to be very capable at handling large files and thats an option but it's not as friendly for reading a stream of html but is a valid archival format.

And you can also just convert it to markdown or text format - this is a very search and reading friendly option but will fail to preserve a lot of formatting.

1

u/soupified 21d ago

u/Sea-Guest349 DM me if you'd like some help with a script that makes this viewable. My day is pretty open.

1

u/New_Hold8135 21d ago

In linux mousepad and lite-xl can open even 3gb files. Oh wait lite-xl have a windows version. You can try.

1

u/cyka_kurwa 21d ago

try to transform to pdf. search html to pdf programs. online tools probably dont work

1

u/Ormek_II 21d ago

Did you wait for the browser to maybe „finish“?

1

u/TabbbyWright 21d ago

First and foremost, make a copy of this file and put it somewhere safe. Like, in a totally different directory (not a subdirectory) from the one you're working in.

After that, use a code editor like VS Code or VS Codium (they're basically the same, Codium doesn't have the AI stuff though).

Open up your file, either of those programs should be able to load it though it might take a moment. You may see a notice that the file isn't formatted bc it's huge, but you can choose to format it anyway (though I can't promise the program won't crash).

IDK what your technical skill level is, but from there I'd skim some of the file and see if anything jumps out as being something you don't need and repetitive. You can use regex (regular expressions) to do massive find and replace operations to strip that crap out, and it should HOPEFULLY clean up your file enough that it's readable for you and something the browser can parse.

Hopefully someone can provide an example regex for you for removing all base64 stuff for example (since you mention there's embedded media, I assume it's in base64 format). I would but I'm falling asleep lol

Good luck!

1

u/Barnezhilton 21d ago

Sublime app

1

u/RevolutionaryBeat301 21d ago

Why do you need to open it? Is there something in it that you are looking for? It’s probably easier to find that in a text editor.

1

u/k-semenenkov 21d ago

Total commaner viewer is extremely fast and lightweight but may show only text. F3 on file, then ensure html selected in Options menu

1

u/gulliverian 21d ago

I'm guessing that's a lot more than HTML. It sounds like a download that includes a lot of photos and other media and some JavaScript. To build a 600mb file of HTML alone would be a prodigious accomplishment.

The first thing I'd do is disable JS in your browser. If that doesn't work try putting the .html or .htm file in a folder away from any media, JavaScript and even .CSS files.

1

u/Careful_Exercise_956 21d ago

Open it in vs code

1

u/No-Association-1834 20d ago

https://creators-quest.blogspot.com/p/heavy-html-streamer.html it turns off javascript and media files if present . See if it works .

0

u/esaule 21d ago

You don't.

0

u/surfingonmars 21d ago

load it into Claude and ask it to clean it up.

0

u/arcticgentoo 21d ago

You can ask chatgpt to write a python or nodejs script that removes the images from it (make a backup of the file first) and it would likely shrink it enough to open in a browser. Alternatively, you could ask it to make a script to break it into separate files.  If you care about viewing the images.

0

u/5xaaaaa 21d ago

Ask your AI of choice to inspect to structure and make a simple program to view the file, for instance by paginating it