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

alenu

macrumors member
Original poster
Jul 8, 2020
52
93
After many months of waiting for an "official" release, I have updated the PPCMC app myself with Python 3.11 and the latest yt-dlp, which now can be again automatically downloaded from the app´s menu as it was intended before it started to ask for a newer version of Python.

Python 3.11 was obtained via the incredible package manager made by @cellularmitosis , leopard.sh

I have uploaded the necessary files and instructions for a manual update to my Google Drive account in case anyone wants to try it. I have tested this in all my PPC Macs and it works just fine.

Consider this a little workaround until Alex releases a new version of the app.

Cheers.

EDIT: as @Doq pointed out, this will not work without leopard.sh Python installed on your machine.

See https://forums.macrumors.com/threads/leopard-sh-and-tiger-sh.2379622/

EDIT 2: @cellularmitosis wrote a script for grabbing the needed packages in case you don´t want to install leopard.sh -see comments below-

 
Last edited:

Doq

macrumors 6502a
Dec 8, 2019
533
798
The Lab DX
Should probably point out that the leopard.sh Python 3.11 is required, else it dies-- this hotfix is not self-contained, but it does work.
 

Attachments

  • Picture 2.png
    Picture 2.png
    99 KB · Views: 165
  • Like
Reactions: cellularmitosis

cellularmitosis

macrumors regular
Mar 6, 2010
150
245
Should probably point out that the leopard.sh Python 3.11 is required, else it dies-- this hotfix is not self-contained, but it does work.
ehhhh yeah unfortunately the python-3.11.2 package requires a lot of dependencies, partly because it required gcc-4.9.4 to build.

If I wipe out /opt and then install python-3.11.2, here's what I end up with:

Code:
$ ls /opt/
ca-certificates-20230110 leopard.sh               openssl-1.1.1t
cloog-0.18.1             libffi-3.4.2             python-3.11.2
expat-2.5.0              libiconv-1.16            readline-8.2
gcc-4.9.4                libiconv-bootstrap-1.16  sqlite3-3.40.1
gdbm-1.23                libunistring-1.0         tcl-8.6.12
gettext-0.21             mpc-1.0.3                tigersh-deps-0.1
gmp-4.3.2                mpfr-3.1.6               tk-8.6.12
isl-0.12.2               ncurses-6.3              xz-5.2.5

However, you don't actually need leopard.sh to install any of this, you could write a targeted script which just grabs those packages.
 
  • Love
Reactions: alenu

cellularmitosis

macrumors regular
Mar 6, 2010
150
245
However, you don't actually need leopard.sh to install any of this, you could write a targeted script which just grabs those packages.
Ok, as a proof of concept, I did this.

A user running a stock install of Leopard should be able to just paste this into a terminal, assuming that /opt exists and they have permission to write to it:

Code:
set -e -x

cd /opt
touch .write-check
rm .write-check

for pkgspec in \
cloog-0.18.1 \
expat-2.5.0 \
gcc-4.9.4 \
gdbm-1.23 \
gettext-0.21 \
gmp-4.3.2 \
isl-0.12.2 \
libffi-3.4.2 \
libiconv-1.16 \
libiconv-bootstrap-1.16 \
libunistring-1.0 \
mpc-1.0.3 \
mpfr-3.1.6 \
ncurses-6.3 \
openssl-1.1.1t \
python-3.11.2 \
readline-8.2 \
sqlite3-3.40.1 \
tcl-8.6.12 \
tk-8.6.12 \
xz-5.2.5 \
; do
    url=http://leopard.sh/binpkgs/$pkgspec.leopard.g4e.tar.gz
    curl --fail $url | nice gunzip | tar x
done

url=http://leopard.sh/dist/ca-certificates-20230110.tar.gz
curl --fail $url | nice gunzip | tar x

/opt/python-3.11.2/bin/python3 -c 'print("Hello, world!")'

I can't remember if /opt exists on a stock Leopard install. If not:

Code:
sudo mkdir -p /opt
sudo chown $USER /opt

EDIT: Hmmm, maaaaybe might also need Xcode installed, not really sure if anything gets linked against libs which only exist after installing Xcode. http://leopard.sh/dist/orig/xcode314_2809_developerdvd.dmg

Anyway, this approach might be useful for someone who wants to leverage the compiled packages from leopard.sh without forcing their users to go through the leopard.sh setup.
 
Last edited:
  • Love
Reactions: alenu

alenu

macrumors member
Original poster
Jul 8, 2020
52
93
Should probably point out that the leopard.sh Python 3.11 is required, else it dies-- this hotfix is not self-contained, but it does work.
That´s right. I didn´t notice because leopard.sh was already installed on my machines. It seems that the Python 3.11 executable points to some libraries at /opt. The original Python 3.6 exec in PPCMC points to /Applications/PPMC instead. So you need leopard.sh for this hack to work.
 
  • Like
Reactions: Doq

alenu

macrumors member
Original poster
Jul 8, 2020
52
93
Ok, as a proof of concept, I did this.

A user running a stock install of Leopard should be able to just paste this into a terminal, assuming that /opt exists and they have permission to write to it:

Code:
set -e -x

cd /opt
touch .write-check
rm .write-check

for pkgspec in \
cloog-0.18.1 \
expat-2.5.0 \
gcc-4.9.4 \
gdbm-1.23 \
gettext-0.21 \
gmp-4.3.2 \
isl-0.12.2 \
libffi-3.4.2 \
libiconv-1.16 \
libiconv-bootstrap-1.16 \
libunistring-1.0 \
mpc-1.0.3 \
mpfr-3.1.6 \
ncurses-6.3 \
openssl-1.1.1t \
python-3.11.2 \
readline-8.2 \
sqlite3-3.40.1 \
tcl-8.6.12 \
tk-8.6.12 \
xz-5.2.5 \
; do
    url=http://leopard.sh/binpkgs/$pkgspec.leopard.g4e.tar.gz
    curl --fail $url | nice gunzip | tar x
done

url=http://leopard.sh/dist/ca-certificates-20230110.tar.gz
curl --fail $url | nice gunzip | tar x

/opt/python-3.11.2/bin/python3 -c 'print("Hello, world!")'

I can't remember if /opt exists on a stock Leopard install. If not:

Code:
sudo mkdir -p /opt
sudo chown $USER /opt

EDIT: Hmmm, maaaaybe might also need Xcode installed, not really sure if anything gets linked against libs which only exist after installing Xcode. http://leopard.sh/dist/orig/xcode314_2809_developerdvd.dmg

Anyway, this approach might be useful for someone who wants to leverage the compiled packages from leopard.sh without forcing their users to go through the leopard.sh setup.
I can confirm this works :). Thanks! Also, /opt doesn´t exist on stock Leopard, so it must be created first.
 
  • Like
Reactions: cellularmitosis

juanstdio

macrumors member
Jun 3, 2021
55
99
Argentina
Today I spent a few hours trying to get in work in Tiger, but unfortunately I was not able to make it work it the way I liked.. PPCMC is a great solution to combine multiple types of media

However 95% of the times I use my G4 with a 480p video music of 10hs or something like that (office hours :) ) and I want to keep it simple.. so I grabed the latest binary version of yt-dlp and renamed yt-dlp-bin, and placed it into /bin folder of PPCMC.app , two scripts (360 and 480, in another folder) which I open them from the dock.

To search videos I use Safari with "home" set as http://iteroni.com/search
My routine is just search a video, copy the link of the video and click 360 or 480 in the dock, the rest is done via the script..
Here is the PPMC with the yt-dlp binary, plus these two scripts😁

https://1drv.ms/u/s!Asv2hO547RwEgoJd0pijumVmus24qA?e=LG5YLc
 

socom_22

macrumors member
Dec 28, 2022
61
42
Just wanted to confirm that the Python update combined with latest youtube-dl has been working really really well. Excellent work @alenu and thanks to @cellularmitosis for that quick and easy script to install Python 3.11!

I wonder if anyone with extensive knowledge on how youtube-dl works might be able to help me out. These days, many high resolution YT videos (usually 2K, 4K, etc) are no longer encoded in H.264 but instead use the new VP9 (or VP09?) codec. Of course this codec is NOT supported by any player on OSX PPC (as far as I am aware).

I've never been interested in hi-res YT but given that I use a G5 Quad, I do download videos using the 1080p option in PPCMC. This always produced a nice 1080p30 H.264 MP4 video that plays back flawlessly on a Quad. At least until recently.

There appear to be more and more videos now which yield the following error when attempting to download with the 1080p preset in PPCMC:

1693364950861.png


The reason for this is because on some videos, there is no 1080p30 quality option available as you can see:

1693369410624.png


Can someone please walk me through how to go about modifying the PPCMC script to add a 1080p60 download option? I am not certain on this, but I believe the 1080p60 videos are still using H.264 as the codec, so ideally I would like the resulting file to be H.264 codec saved within an MP4 container if possible. The G5 Quad can surprisingly handle 1080p60 video using some of the more efficient video players such as VLC 2.0.10 and CorePlayer.

Thanks!
 
Last edited:

Dronecatcher

macrumors 603
Jun 17, 2014
5,244
7,880
Lincolnshire, UK
@socom_22
The 60fps format is 312 - I don't know which script you're using but this is how it would look on one of my old ones:
export SSL_CERT_FILE=/Applications/PPCMC.app/certs/cacert.pem export REQUESTS_CA_BUNDLE=/Applications/PPCMC.app/certs/cacert.pem; /Applications/PPCMC.app/bin/python3.6 /Applications/PPCMC.app/bin/youtube-dl -o "~/Movies/Youtube/download" --rm-cache-dir --prefer-ffmpeg --ffmpeg-location=/Applications/PPCMC.app/bin/ffmpeg -f 312+140 "$(pbpaste)" /Applications/PPCMC.app/bin/ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32 -loglevel quiet -skip_frame 8 -skip_loop_filter 48 ~/Movies/Youtube/download.mp4 rm ~/Movies/Youtube/download.mp4 killall Terminal

You will have to change it to accomodate how you've patched Python and check whether ffmpeg can actually mux the 312 video and 140 audio together, I haven't tested it yet.
 
  • Like
Reactions: socom_22

Dronecatcher

macrumors 603
Jun 17, 2014
5,244
7,880
Lincolnshire, UK
Ok, I've tested this and it's working on my Powerbook - 1080P@60FPS with audio.
My version assumes that Python is in /opt/ and downloads/muxes the video as download.mp4 to ~/Movies/Youtube/
 

Attachments

  • DWN1080.zip
    11.1 KB · Views: 67

socom_22

macrumors member
Dec 28, 2022
61
42
Thanks @Dronecatcher! The 312+140 format code you posted was the key to figuring this out as I was not too familiar with how to configure youtube-dl.

So I wanted to try and add this functionality while maintaining as much of the original script as possible in its stock configuration. What I did was modify 'main.scpt' which is the AppleScript file that runs the PPCMC GUI. First I revised the GUI to have two distinct 1080p options based on desired framerate:

1693449171585.png

Next, I copied the existing code used for the other quality settings and adapted it with your 60FPS youtube-dl format string. I really wasn't sure whether the resulting video downloaded from YouTube's servers would be encoded in H.264 format, but yes it certainly is!! This is so excellent!

I even modified the terminal outputs accordingly for the cleanest look:

1693449380896.png

1693449460845.png


If anyone wants this, I am posting my modified 'main.scpt' file. It should work as a drag-and-drop solution if you installed Python 3.11 using the method posted above by @cellularmitosis.
 

Attachments

  • main.scpt.zip
    69.2 KB · Views: 98

the mars volta

macrumors newbie
Mar 7, 2008
5
0
Today I spent a few hours trying to get in work in Tiger, but unfortunately I was not able to make it work it the way I liked.. PPCMC is a great solution to combine multiple types of media

However 95% of the times I use my G4 with a 480p video music of 10hs or something like that (office hours :) ) and I want to keep it simple.. so I grabed the latest binary version of yt-dlp and renamed yt-dlp-bin, and placed it into /bin folder of PPCMC.app , two scripts (360 and 480, in another folder) which I open them from the dock.

To search videos I use Safari with "home" set as http://iteroni.com/search
My routine is just search a video, copy the link of the video and click 360 or 480 in the dock, the rest is done via the script..
Here is the PPMC with the yt-dlp binary, plus these two scripts😁

https://1drv.ms/u/s!Asv2hO547RwEgoJd0pijumVmus24qA?e=LG5YLc
Hi, everytime I run the scripts I get HTTP Error 403: Forbidden, but with PPMC it works fine.
 

Aprifox

macrumors newbie
Nov 14, 2021
2
1
I updated 'main.scpt' to work for me in 2024. I'm uploading it here in hopes that others will find it helpful too.
 

Attachments

  • main.scpt.zip
    62.2 KB · Views: 38
  • Like
Reactions: Raging Dufus

socom_22

macrumors member
Dec 28, 2022
61
42
I updated 'main.scpt' to work for me in 2024. I'm uploading it here in hopes that others will find it helpful too.
The script has been working perfectly for me since the Python 3.11 update. Including the 60 FPS H264 option I added to the script last year. What updates did you need to make to the script and what issues were you having?

The only thing I’ve noticed is that sometimes YouTube changes things on their end and the latest YouTube-dl needs to be installed to get things working again. Very easy to do using the built-in feature within PPCMC. Kudos to those who maintain the yt-dlp project.
 

Aprifox

macrumors newbie
Nov 14, 2021
2
1
The script has been working perfectly for me since the Python 3.11 update. Including the 60 FPS H264 option I added to the script last year. What updates did you need to make to the script and what issues were you having?

The only thing I’ve noticed is that sometimes YouTube changes things on their end and the latest YouTube-dl needs to be installed to get things working again. Very easy to do using the built-in feature within PPCMC. Kudos to those who maintain the yt-dlp project.
PPCMC would pass on an error message from yt-dlp saying: "ERROR: Requested format is not available". I figured it was something after the -f argument that yt-dlp didn't like.
 

socom_22

macrumors member
Dec 28, 2022
61
42
PPCMC would pass on an error message from yt-dlp saying: "ERROR: Requested format is not available". I figured it was something after the -f argument that yt-dlp didn't like.
This was part of the reason why I edited the script to include a 60 fps option. I noticed that some videos are not available in 1080p30 but are available in 720p or 1080p60. I will have a look at your script later, I’m very curious if there is a “fix” for this. I always thought the content simply wasn’t available in certain formats.
 

juanstdio

macrumors member
Jun 3, 2021
55
99
Argentina
today I had a bit of time to review the original 360.command that I was using, after getting the 500 error it was because yt-dlp cannot resolve a pasted address, BUT.. it can resolve if you pass the VideoID from youtube..
Solution:

first, take advantage of the super tiger.sh package manager, and run:
tiger.sh python-3.11.2

after that, you can update yt-dlp from PPCMC and update the 360.comand:
export SSL_CERT_FILE=/Applications/PPCMC.app/certs/cacert.pem export REQUESTS_CA_BUNDLE=/Applications/PPCMC.app/certs/cacert.pem; /usr/local/bin/python3.11 /Applications/PPCMC.app/bin/yt-dlp/yt-dlp --rm-cache-dir --prefer-ffmpeg --ffmpeg-location=/Applications/PPCMC.app/bin/ffmpeg -f 18 "$(pbpaste | sed 's/.*v=//')" -o -|/Applications/PPCMC.app/bin/ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32 -loglevel quiet -

the major update is the pbpaste | sed 's/.*v=//' command, which gets the videourl from an iteroni video. (which works under safari on 10.4, the rest is quite similar :)
example, from "https://iteroni.com/watch?v=xXD_IEcZbMI" it will just get "xXD_IEcZbMI", which is enough for yt-dlp to find out where it is
 

juanstdio

macrumors member
Jun 3, 2021
55
99
Argentina
today I had a bit of time to review the original 360.command that I was using, after getting the 500 error it was because yt-dlp cannot resolve a pasted address, BUT.. it can resolve if you pass the VideoID from youtube..
Solution:

first, take advantage of the super tiger.sh package manager, and run:
tiger.sh python-3.11.2

after that, you can update yt-dlp from PPCMC and update the 360.comand:
export SSL_CERT_FILE=/Applications/PPCMC.app/certs/cacert.pem export REQUESTS_CA_BUNDLE=/Applications/PPCMC.app/certs/cacert.pem; /usr/local/bin/python3.11 /Applications/PPCMC.app/bin/yt-dlp/yt-dlp --rm-cache-dir --prefer-ffmpeg --ffmpeg-location=/Applications/PPCMC.app/bin/ffmpeg -f 18 "$(pbpaste | sed 's/.*v=//')" -o -|/Applications/PPCMC.app/bin/ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32 -loglevel quiet -

the major update is the pbpaste | sed 's/.*v=//' command, which gets the videourl from an iteroni video. (which works under safari on 10.4, the rest is quite similar :)
example, from "https://iteroni.com/watch?v=xXD_IEcZbMI" it will just get "xXD_IEcZbMI", which is enough for yt-dlp to find out where it is

Last update! Here is a version to watch youtube live under 360p (recommend to use a LAN Connection, the poor airport will have a bad time to get on time with the frames):
export SSL_CERT_FILE=/Applications/PPCMC.app/certs/cacert.pem export REQUESTS_CA_BUNDLE=/Applications/PPCMC.app/certs/cacert.pem; /usr/local/bin/python3.11 /Applications/PPCMC.app/bin/yt-dlp/yt-dlp --rm-cache-dir --prefer-ffmpeg --ffmpeg-location=/Applications/PPCMC.app/bin/ffmpeg -f 93 "$(pbpaste | sed 's/.*v=//')" -o -|/Applications/PPCMC.app/bin/ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32 -loglevel quiet -

I'm running all of this under a G4 DVI with 768 MB of RAM
 

juanstdio

macrumors member
Jun 3, 2021
55
99
Argentina
During recent times, our friend YT has changed some rules to visualize Livestreams. Don't worry I got cover for this!

After Reading some issues on YT-DLP github https://github.com/yt-dlp/yt-dlp/issues/10206 I got a way to yet still get livestreams via ffplay.. trick is to combinate the proper values for each format.. for example
229+234
229 = 426x240
234 = mp4 audio only

Bash:
export SSL_CERT_FILE=/Applications/PPCMC.app/certs/cacert.pem
export REQUESTS_CA_BUNDLE=/Applications/PPCMC.app/certs/cacert.pem; /usr/local/bin/python3.11 /Applications/PPCMC.app/bin/yt-dlp/yt-dlp --rm-cache-dir --prefer-ffmpeg --ffmpeg-location=/Applications/PPCMC.app/bin/ffmpeg -f 229+234 "$(pbpaste | sed 's/.*v=//')" -o -|/Applications/PPCMC.app/bin/ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32 -loglevel quiet  -

Tested with LoFi Girl YT Livestream:

Imagen 1.png
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.