Playing YouTube via VLC

0th3r

macrumors newbie
Original poster
Jul 30, 2019
2
12
Russia
To play YouTube through VLC you need

1. Install:
  • VLC 2.0.1 (In folder Applications -> "/Applications/VLC.app")
  • MacPorts
2. Install curl-ca-bundle through MacPorts
Code:
sudo port install curl-ca-bundle
3. Add new SSL certs to VLC
Code:
mkdir -p ~/Library/Preferences/org.videolan.vlc/ssl/certs
Code:
ln -s /opt/local/share/curl/curl-ca-bundle.crt ~/Library/Preferences/org.videolan.vlc/ssl/certs/ca-certificates.crt
4. Patch old VLC for support YouTube
Code:
rm -f /Applications/VLC.app/Contents/MacOS/share/lua/playlist/youtube.luac
Code:
curl --insecure https://raw.githubusercontent.com/videolan/vlc/master/share/lua/playlist/youtube.lua -o /Applications/VLC.app/Contents/MacOS/share/lua/playlist/youtube.lua
5. Play video
  • Copy link of video
  • Open VLC
  • In VLC open: File -> Open Network
  • Past URL and press Open
On my DC 2.3 Power Mac G5 works very good
 

z970mp

macrumors 68040
Jun 2, 2017
3,103
3,183
The Matrix
And just like that, without any warning at all, yet another way was found to play YouTube on 15+ year old hardware.

Staggering.
 
Last edited:

netsrot39

macrumors regular
Feb 7, 2018
159
113
Austria
Well VLC for Leopard is from 2014 and pretty much one version behind the latest release. I haven't had any problems with it. However I'm missing newer functions like resuming playback from where I stopped before. Now VLC for Tiger is from 2009 and almost hitting the 10 year mark and still I could play everything I wanted. Has anybody of you tried building a newer version? I don't know too much about compiling and only play around with MacPorts here and there so I really don't know too much about it but I would be surprised if it won't compile. And yes QT is awful on PowerPC except for a G5 maybe. On my G4s I have to pay attention that I don't have too many applications opened because otherwise the file I'm playing is more like the playback of a GIF file^^ XBMC and CorePlayer are the kings IMO. I played 720p on my Mid 2005 iBook G4 for example without any noticable frame drops and honestly I never expected HD video on that computer. Anyways, this thread is about watching YouTube via VLC and I'm sure it does that well but PPC Media Center is my prefered app for such purpose and basically guaranteed to work in the future since it's backend youtube-dl is maintained.
 

0th3r

macrumors newbie
Original poster
Jul 30, 2019
2
12
Russia
I’m surprised no one has compiled a newer version of VLC on leopard. I’m sure it’s possible.
If everything was so easy, then vlc did not remove powerpc support. Just tried to compile vlc2.1 on 10.5.8, sdk leopard is old because of this it is impossible to compile a new version

guaranteed to work in the future
VLC will also be able to support play YouTube in the future if you update the youtube.lua script in a timely manner. Due to design updates, the old script could not get a direct link to the mp4 file
 

wicknix

macrumors 65816
Jun 4, 2017
1,134
1,940
Wisconsin, USA
This works great. Thanks! However i found a way to save you the steps of opening VLC and copy/pasting the url from the browser. This works with tenfourfox and iceweasel-ppc. I've attached an archive where you can install whats needed. First install the mpv-youtube-dlbinding.xpi and yesscript.xpi into either browser. Go to tools -> addons -> extensions and click mpv-youtube-dl-binding preferences. Put this in the "native player location" entry box /Applications/VLC.app/Contents/MacOS/VLC

Now update your existing youtube-dl (sudo youtube-dl -U) or get a copy from here: https://yt-dl.org/downloads/2019.09.28/youtube-dl (chmod a+x it and place in /usr/local/bin)
If you're on a slower machine read the included youtube-dl-config text file. By default i have it set to play 480p or lower.
EDIT: You don't need youtube-dl unless you build and use mpv or mplayer instead of VLC.

Now go to youtube.com. When the page loads block it with the yesscript addon to block JS on youtube (for faster future page loads). Right click on a video (or thumbnail link) and choose "play with mpv". It will now use VLC instead and automatically launch VLC to stream the video without you having leave the browser. :)

Cheers

mpyt.png
 

Attachments

Last edited:

TheShortTimer

macrumors 6502a
Mar 27, 2017
508
690
London, UK
Having some problems with this on my G3... I'd appreciate some clarification please.

I've attached an archive where you can install whats needed. First install the mpv-youtube-dlbinding.xpi and yesscript.xpi into either browser. Go to tools -> addons -> extensions and click mpv-youtube-dl-binding preferences. Put this in the "native player location" entry box /Applications/VLC.app/Contents/MacOS/VLC
I've reached this far but if you prefer Mplayer OS X, you would substitute that as your choice for the entry box?

Now update your existing youtube-dl (sudo youtube-dl -U) or get a copy from here: https://yt-dl.org/downloads/2019.09.28/youtube-dl (chmod a+x it and place in /usr/local/bin)
"chmod a+x it" Meaning enter that command into the Terminal and then move youtube-dl into usr/local/bin?

Speaking of which, I don't have an existing youtube-dl so I downloaded the file from the URL but I cannot find usr/local/bin - even when using the Go option from Finder. ("The folder cannot be found.")

If you're on a slower machine read the included youtube-dl-config text file.
The config file would be placed into /usr/local/bin/?
 

wicknix

macrumors 65816
Jun 4, 2017
1,134
1,940
Wisconsin, USA
1) Yes, but mplayer os x is too old and wont work. You'd need to build a newer version of mplayer from macports. FYI it does not work with the prebuilt smtube / mplayer package (at least not for me on osx, but works fine under linux).
2) Correct. Type that in terminal. E.G. cd /Downloads && chmod a+x youtube-dl
If you don't have /usr/local/bin or /opt/local/bin you can also just put it in /usr/bin
3) The config file should be renamed to config and placed in ~/.config/youtube-dl (you'll have to create the youtube-dl folder first).

Cheers
 

Dronecatcher

macrumors 68040
Jun 17, 2014
3,768
3,741
Lincolnshire, UK
Speaking of which, I don't have an existing youtube-dl so I downloaded the file from the URL but I cannot find usr/local/bin - even when using the Go option from Finder. ("The folder cannot be found.")
youtube-dl in itself doesn't work - you need to have a compatible version of Python installed too.
You might want to try methods I've outlined in the forum - your G3 iBook is unlikely to be able to play Youtube at 360P (unless through MPlayer with web browser minimised.)
 
  • Like
Reactions: TheShortTimer

TheShortTimer

macrumors 6502a
Mar 27, 2017
508
690
London, UK
Ok, I abandoned any further pursuit of youtube-dl, seeing as I'd need to build a newer version of MPlayer and as @Dronecatcher has informed me, Python would have to be installed too anyway and went with VLC instead. It actually works (with persistence) but there's no sound.

Edited to add: "open /usr" finally allowed me to locate the bin folder. Not that I ended up needing it but perhaps this can help others who encounter the same problem.

Also, blocking the page - or trying to, caused me no end of grief.

 
Last edited:

TheShortTimer

macrumors 6502a
Mar 27, 2017
508
690
London, UK
If you try that with my method (on here) you get sound.
This one?

 

Dronecatcher

macrumors 68040
Jun 17, 2014
3,768
3,741
Lincolnshire, UK
This one?

It's in there somewhere - essentially use TFF, FoxBox, ArcticFox with a Nokia user agent, to go to https://m.youtube and clicking on video will launch your streaming player - QuickTime or RealPlayer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.