winvid – A slim YouTube to WMV converter
Posted in Other Projects March 18th, 2021 by dotcomboom

A couple days ago I hacked together winvid, a site that lets you download YouTube videos as 144p or 240p wmvs that you can play on Windows Mobile phones or other suitably older equipment.

The backend is a very simple Flask application that runs youtube-dl for downloading the video, and then ffmpeg to convert it into two qualities of WMV. First, it converts the downloaded mp4 into the 240p version, and then that is sampled down to an additional 144p mono version. This is done to save processing time, as the conversion from mp4 to wmv is actually the longest part of the process. Longer videos, naturally, will take a longer time to convert than shorter ones. Just hold on the line a few minutes. Once it’s done, it refreshes the index which lists out all the videos cached.

Regrettably, the site itself will not work on mobile IE due to Replit’s new encryption practices—yet another victim of the ever-spreading “HTTPS-first” philosophy. It will still work on RetroZilla and Opera Mini 5.1 however, so old PCs and pocket devices can still download to their hearts’ content, at least for now.

On mobile, remember that data charges may apply if you’re not downloading over Wi-Fi. If you’re on a prepaid plan like I am, you may find it beneficial to transfer the videos through Bluetooth/microSD/USB, what have you. I have gotten it down to about 2mb per minute for the 144p mono version so it’s just about as efficient as it could be on data, though results will still vary.

As well as Windows Mobile and Pocket PCs, I’m confident that this would be very useful for less equipped, retro processors as well–think your Pentium II-era, and potentially your XP-era machines. People throw 1080p video at these things and when they start skipping frames, deem them useless. In reality, 240p and even 144p are still quite watchable for a lot of videos so long as you aren’t narrowed into the details. I’m looking forward to trying it out under RetroZilla and WMP on some bare metal when I get the time.

It’s a small and niche pet project, but also pretty hackable and adaptable. If you’re the type, I encourage you to fork it, make changes to it, that good stuff. I’ll note that this definitely can be run over a local network as well with a bit of setup. I’ve found it useful, and hope it is for you too.

A collage of the personal web
Posted in Software, Tutorials April 4th, 2020 by dotcomboom

Here’s a collage I did of the sites in the xxiivv webring. Screenshots were taken and downloaded using this script I hacked up:

import requests
import json
import time

with open("sites.json", "r") as read_file:
    sites = json.load(read_file)
    
    x = -1
    for site in sites:
        x += 1
        print(x, site['url'])
        try:
            r = requests.get("http://image.thum.io/get/noanimate/" + site['url'])
        except:
            time.sleep(2)
            r = requests.get("http://image.thum.io/get/noanimate/" + site['url'])
        title = ""
        try:
            title = "_" + site['title'].replace('\\', '')
        except:
            pass
            
        with open('images/' + str(x) + title + '.png', 'wb') as f:
            f.write(r.content)

They were then fed into this collage maker script to produce the output. Some sites displayed as blank; the only way to work around that would be to use thum.io‘s /wait/ feature; unfortunately that’s only for their registered plans. It still came out neat and I now know of a quick way to make collages.