Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
I've put together some scripts, a TenFourFoxBox, youtube-dl and mplayer and come up with tools to let you watch and/or download Youtube videos at any quality on any Mac that runs Tiger or Leopard - and that includes G3s!

All the components are in the dropbox link - the only other requirement is that Python 2.7 is installed, you can do this independently but the best way is to install PPC Media Center as this installs it for you (and keeps youtube-dl up to date also).

Whilst not as refined as PPC Media Centre it does offer video streaming via mplayer which is far more efficient than Quicktime and fewer clicks to get there.
It's not as slick as SMtube either but it works without installing xcode and macports and it works on Tiger too.

How to install:

On Leopard
Drag TonVid, mView, mViewX, mplayer and streamer into Applications - streamer is actually mplayer too but renamed as this version works best for streaming, whilst the other is best for playback.
You must have TenFourFoxBox already installed before using TonVid - drag it and mView/mViewX to the dock.

Copy Source to any location - these are the various scripts for downloading and streaming Youtube.

240, 360 & 720 will download videos at those respective resolutions.

Grab... will download, play then delete a video at the indicated resolution - worst being the smallest possible size Youtube has.

xGrab... is the same but with hard frame drop parameters applied to mplayer to reduce CPU.

Stream... will stream and play a video at the indicated resolution and xStream...is the same with the hard frame drop options.

Ideally choose the script(s) that suit your needs and copy out of the Source folder, rename and drag shortcuts to the dock (righthand side as they are scripts).

Make a folder in Movies called Youtube - this is the default download folder but you can edit the scripts to point to any folder you wish.


On Tiger
Exactly as above but with one extra step.
From Finder menu: Go/Go to Folder and type /usr/local/bin from the Finder window locate youtube-dl and copy it to the Desktop.
From Finder menu: Go/Go to Folder and type /bin in the Finder window, drag youtube-dl from the Desktop into it - you will probably have to type your user password to do this.

It is crucial to have the latest version of youtube-dl installed, this can be updated via Terminal with the command: youtube-dl -U
If this fails, the file can be downloaded directly from the website:
https://rg3.github.io/youtube-dl/download.html

For G3s
Use the included G3 mplayer version

How to use:

Streaming
Launch TonVid and search for your chosen video and right click on it and copy link location. (Note, TonVid default background is white - scroll to the preferences to change colours and layout).
To stream the video, click your chosen streaming shortcut in the dock.
Note there is a delay while youtube-dl does it's stuff before launching mplayer - I'd personally only recommend streaming for long videos, for shorter clips downloading is quicker.

Whilst the video is streaming mplayer can be controlled by keyboard shortcuts:

9 - volume down
0 - volume up
command + 0 - half size
command + 1 - original size
command + 2 - double size
space - pause/play
cursor right - forward 10 seconds
cursor up - forward 1 minute
f - full screen
esc - quit


When the video finishes, mplayer and Terminal will quit.

Downloading/Grabbing
As before right click on a video and copy the link location, click on the Dock shortcut that corresponds with the quality of video you want to download.
A Terminal window will open and start downloading - when complete, the download folder will open automatically so you can play your file.
Grabbing downloads the video in similar fashion but plays it back on completion then deletes it - full credit goes to @TheMrKocour for this, as he came up with it.

Customizing the scripts.

All the scripts can be edited in TextEdit or similar - here you will see the command line options for youtube-dl and mplayer, anyone with experience of command line can then edit away to achieve the result they want.

I've included the mplayer command list and the youtube-dl commands can be seen here:

https://github.com/rg3/youtube-dl/blob/master/README.md

mView and mViewX are droplets that facilitate playback in mplayer. To use, simply drag a video file onto them and mplayer will launch it - I've found this is essential for 360P video playback on my G3 iMac.
mView plays the file at it's full quality while mViewX applies some hard frame dropping to make unplayable files work - particularly useful on G4s that struggle with 720P.

Download here.


EDIT 25/10/18

Found out today that by using the new Mplayer from the SMTube thread

https://forums.macrumors.com/thread...ew-mactubes-mobile-youtube-installer.2030035/

the time until the video starts streaming is halved! All one has to do is open the scripts in TextEdit and change the path to the new Mplayer. Note this can't be used on G3s as the latest MPlayer isn't compiled for G3.

1Ghz G4 Titanium Powerbook 360P streaming
Picture 1.jpg

1Ghz G4 Titanium Powerbook 240P streaming
Picture 2.jpg

1Ghz G4 Titanium Powerbook "worst" streaming
Picture 3.jpg

1Ghz G4 Titanium Powerbook 720P playback
Picture 4.jpg
 
Last edited:

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
any idea how this will run on something like a 604? :)

If it's running Tiger it might work. On my G3 iMac it's not the video playback that's hard, it's youtube-dl doing it's thing that takes a while.
The iMac plays 240P at 30% CPU but you can go to a lower resolution using "worst" parameter in the youtube-dl command line - your video is the size of a postage stamp however....
 

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
Interesting, will give it a try for streaming, and thanks. But for downloading on TFF I use an app called Download YouTube Videos as MP4. https://github.com/gantt/downloadyoutube

Yes, I've tried lots of extensions but the problem is browsing Youtube on TFF - even with most of the javascript blocked (NoScript) my 1.67Ghz Powerbook struggles and is often pushing 100% CPU.
I wanted streaming, downloading and a browser that is speedy, for G4s mainly.
 

Imixmuan

Suspended
Dec 18, 2010
526
424
Yes, I've tried lots of extensions but the problem is browsing Youtube on TFF - even with most of the javascript blocked (NoScript) my 1.67Ghz Powerbook struggles and is often pushing 100% CPU.
I wanted streaming, downloading and a browser that is speedy, for G4s mainly.

Very, very impressive work Dronecatcher! PowerPC not dead, not dead even a little.
 
  • Like
Reactions: Dronecatcher

bobesch

macrumors 68020
Oct 21, 2015
2,130
2,207
Kiel, Germany
Yes, I've tried lots of extensions but the problem is browsing Youtube on TFF - even with most of the javascript blocked (NoScript) my 1.67Ghz Powerbook struggles and is often pushing 100% CPU.
I wanted streaming, downloading and a browser that is speedy, for G4s mainly.
Thanks for that big stuff - I will certainly need a weekend to try that.
For my G4-Books I'm going to stay with "webkit plus ClickToPlugin / download / CorePlayer" - the way to enjoy YT-video I've also learned from You and other'S - bright people here in this forum.
The latest webkit doesn't support webkit anymore, so I stick with a version 6.1... from December 2016 to keep ClickToPlugin-Support.

I'm definitively looking forward to try out your current enhancements!
 
  • Like
Reactions: Dronecatcher

QSDP-User

macrumors regular
Jan 13, 2015
144
89
California, USA
iBook G4 [1.07 GHz 512 RAM] Tiger 10.4.11

This laptop is a bit banged up, missing a couple keys - Sister found it someplace outside abandoned.
Got an $8 power adapter & found it booted up with Debian.
Battery is a lost cause, the 99% icon must mean 99% defective ;)
...unplug the adapter & the charge lasts about 20 seconds.

The downloaded 240p runs smooth. Quicktime opened it by default.
MenuMeters CPU @ 45%

Edit: A downloaded T-Raider walkthrough 360p ran smooth with mplayer.
CPU average ~56%

The 1 GHz cpu struggles with browser-based videos, even the 240p versions.
RAM could be upgraded, but I'll pass on spending more for this iBook G4.

Thanks for the work, Dronecatcher!


Conan TR Gameplay.jpg
 
Last edited:
  • Like
Reactions: Dronecatcher

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
The downloaded 240p runs smooth. Quicktime opened it by default.
MenuMeters CPU @ 45%

Glad you can use it and it's been helpful.

Doesn't my mView app you've got in the dock open the 240P 3gp files - it should? It will open fullscreen but pressing f will return it to a window.
VLC is also good for 3gp.
 

QSDP-User

macrumors regular
Jan 13, 2015
144
89
California, USA
Doesn't my mView app you've got in the dock open the 240P 3gp files - it should?
It will open fullscreen but pressing f will return it to a window.
VLC is also good for 3gp.

Ah yes, it had been a while since I used your earlier scripting contributions & video app suggestions.
I think for a G3 I'd changed the script so mView wouldn't automatically pop into play.
I must have file transferred over the changed script.
Any downloaded video when dragged on mView plays great.
vlc also sits in the arsenal of goodies.

Edit: For clarity regarding my 1st post about Quicktime opening the downloaded 240p 3gp file by default:
When the 3gp file finished downloading it sat idle in the downloads folder.
I double-clicked on it & Quicktime happened to open the file & then waited for me to click on the play button.
Possibly a script change by me made that "downloaded idleness" happen
(if it wasn't supposed to),
but any further recalling of all this processing has made my brain implode.
 
Last edited:
  • Like
Reactions: Dronecatcher

LightBulbFun

macrumors 68030
Nov 17, 2013
2,808
3,125
London UK
its a shame my Kanga does not have any means of an internet connection :D (the PC Card slots dont work in tiger and it has the ethernet only ethernet card that does not work under any version of OS X)
 
  • Like
Reactions: Dronecatcher

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
its a shame my Kanga does not have any means of an internet connection :D (the PC Card slots dont work in tiger and it has the ethernet only ethernet card that does not work under any version of OS X)

If it was connected I think the Kanga could manage it - I suspect 200Mhz might be the limit.
[doublepost=1486659100][/doublepost]Switching to thousands of colours and uninstalling Perian knocks 10% off CPU....

1b.jpg
 
Last edited:

philgxxd

macrumors 6502
Feb 11, 2017
407
336
Malaga, Spain
Thanks a lot.
So far the streaming function is not working for me. Terminal just quits but i can not say what it is throwing out as error message as it closes so fast.
How can i edit it so it doesn´t close the Terminal window?
 

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
Thanks a lot.
So far the streaming function is not working for me. Terminal just quits but i can not say what it is throwing out as error message as it closes so fast.
How can i edit it so it doesn´t close the Terminal window?

You can edit YT in TextEdit - remove killall Terminal then it will remain open.

Chances are your video isn't available at 240P resolution, if you look through the youtube-dl command line parameters it may be possible to write the script so it selects the next quality along - I never went that far, as I said, I'm not a coder :)
 

philgxxd

macrumors 6502
Feb 11, 2017
407
336
Malaga, Spain
Thanks for the quick response. It is working. Possibly it was just the youtube channel I was trying to watch some episodes from. Some random tries and it started right away.
 

Slix

macrumors 65816
Mar 24, 2010
1,442
1,990
Tried this out today on my Power Mac G3 300 MHz running Tiger with 256 MB RAM. I didn't use the TenFourFoxBox, but after trying it a few times, it never seemed to progress the loading percentage in the terminal window... I'll try this later with my MDD or PowerBook G4 and see if it's just that the amount of RAM isn't enough for something like this.

Looking through the documentation for the youtube-dl script, it seems it would be possible to use this to play fast loading audio clips too (for songs, or playlists of songs). Anyone up for the challenge? :) I'll try to look at that once I get the YouTube bit working. :p
 

Slix

macrumors 65816
Mar 24, 2010
1,442
1,990
Don't mean to double post, but since no one has replied, I figured I should so someone will see this.

I just tried this out on my MDD running 10.5, and it seems to be having a different issue now. I'm getting an error:

[youtube] vpAB1NjtGu0: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),))

This happens after the MPlayer text shows up in the terminal, so it's making some progress, but for whatever reason, every video I've tried is doing this. Ideas?
 

Dronecatcher

macrumors 603
Original poster
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
This happens after the MPlayer text shows up in the terminal, so it's making some progress, but for whatever reason, every video I've tried is doing this. Ideas?

I don't know whether this will make a difference but do you have the latest version of youtube-dl installed?
If you also use the PPC Media Center that will update it for you, otherwise in Terminal type:

youtube-dl -U
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.