Jump to content

Youtube on a 68K Macintosh - 68KTube


Recommended Posts

  • 68kMLA Supporter
Posted (edited)

Hi everyone,

 

In my latest quest to turn my SE/30 in day-to-day machine, and with help from users from @omgmonsters's discord community, I've made a PHP script that download and converts youtube videos into a format playable on a 68K macintosh and quicktime, inside the browser. So far it's extremely simple but it works especially when paired with @mactjaap's MacIP Pi. 

 

In order to use it you need access to a Linux web server (including a raspberry pi) with the following things installed on it:

- A webserver (apache, lighttpd, etc)

- PHP module

- Youtube-DL

- FFMPeg.

 

On your mac side you need Netscape (2+) and QuickTime 4 installed (videos work even in QuickTime 2 but not in the browser). 

 

Here's a video of it running while hosted on my new 68K Network website:

 

Hosting it on a local server (like the aforementioned MacIP Pi) yields faster transfer times to the quicktime plugin. The php script is composed out of two files:

- index.php that contains the input form and ends up receiving the <embed> tag.

- ytdownload.sh which receives the youtube URL from the page, calls youtube-dl and runs ffmpeg to encode the video with the cinepak codec. 

 

I'm looking to extend 68K Tube this weekend by using DuckDuckGo's API to allow for you to search for youtube videos (instead of having to paste the URL) and select the one to watch. In the future, I hope to provide this as a service on my 68K Network so people wouldn't have to self-host it. With a bit of luck @mactjaap might also include it in a future MacIP release for an even more hassle free setup.

 

So far I've tested it on a Macintosh SE/30 at stock speeds and it works. Using it on my accelerated SE/30 is even better as download speeds seem to be even greater due to the CPU being a bottle neck. Still, it should be usable on anything that has an 030 and up (maybe even an 020 mac). And of course, PPC macs should have no problems and enjoy a even better performance.

 

Note: if your installing youtube-dl from macip do not rely on the internal repositories. Instead do 

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

 

The youtube-dl available in the debian repositories for raspbian is old and not compatible with the current youtube api.

 

Download v0.0.1.

 

Edit: I use FrogFind to search for youtube videos I want to see and copy the URL from there when on my SE/30. In the future, I'll try and get searching to work in the script itself.

Edited by BacioiuC
Link to post
Share on other sites
  • 68kMLA Supporter
Posted (edited)

I can confirm that the videos play (outside of the browser) with no issues in System 7.1 with Quicktime 2.1.

Quicktime 1.6.2 throws a "data reference not found" error when trying to open the files.

Edited by rsolberg
Link to post
Share on other sites
  • 68kMLA Supporter
Posted (edited)

Love this!

 

I wonder about ways to make it perform better. Right now it looks like you're using youtube-dl to download the whole video and then encode, which depending on the speed of your internet and linux machine may be quite slow. Instead, you *may* be able to build this to download only small chunks (~1-5 min each) as this is a youtube-dl feature, and then build an alternative to Quicktime's timeline scrubber UI in HTML so you could click ahead or behind to load different chunks. And if you just let the video play, when its done you load the next chunk - not sure if this forces a page refresh or not though, this is pre-AJAX internet after all. Another possibility would be to explore whether you can feed quicktime a constant stream and encode on the fly, but I'm not sure about the limitations of old systems. Anyway, something to consider?

 

A related project you may be interested in is this web render proxy project which takes modern sites and turns them into clickable GIFs so they can be rendered on old computers. Its a brilliant solution.

 

Another project you may be interested in is @ants' MacAuth which he used to authenticate with his 68k Spotify controller

 

Another idea I'd love to see built is making a local copy of internet archive for a given early internet date (e.g. ~1996), letting us browse the web as though we're in that time.

 

Ultimately I'd love to see all these projects get bundled into a single "Internet in a Box" software package that could run on a raspberry pi stuffed inside our mac. Looks like you're on the way to doing that with your 68k Network. 

 

Anyway keep up the awesome work!

Edited by nickpunt
Link to post
Share on other sites
  • 68kMLA Supporter
On 4/3/2021 at 9:18 AM, nickpunt said:

I wonder about ways to make it perform better. Right now it looks like you're using youtube-dl to download the whole video and then encode, which depending on the speed of your internet and linux machine may be quite slow. Instead, you *may* be able to build this to download only small chunks (~1-5 min each) as this is a youtube-dl feature, and then build an alternative to Quicktime's timeline scrubber UI in HTML so you could click ahead or behind to load different chunks.

I'm not sure how well I can control QuickTime from within the browser, I couldn't find any references for it. However, your post gave me an idea. Setting up 68K as it is now on PI and coupling it with a QT-based player on a mac where you point it to folder to folder that contains the split chunks. This way, as the movie is playing I can check if the next chunk exists and automatically load to continue playing.

 

Going to prototype something today and go over the QuickTime API to see what I can do for this.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...