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

wicknix

macrumors 68030
Original poster
Jun 4, 2017
2,599
5,256
Wisconsin, USA
Tested under linux on a DP 2Ghz G5, but should work on Tiger/Leopard as well.

First, using a mozilla derived browser (TFF, AF, IW, SW, PM etc) install the GreaseMonkey extension. Then go grab this user script: https://greasyfork.org/en/scripts/8114-stream-url-grabber and install it.

Then load up twitch.tv in your browser. Give it some time to load. Our PPC's aren't always speed demons. Once you find a stream you want to see click on the "Grabber" button, then click on the "Download" button that pops up next to the Grabber button. Save the m3u8 file.

twitch2.png

Open downloaded blahblah.m3u8 file in any text editor and comment out # the higher resolutions. I find 480p is a happy medium for me without taxing the cpu.

twitch4.png

Now right click on blahblah.m3u8 and open with your favorite video player. I use mpv, but vlc and mplayer work just as well. Boom! Your stream will start playing. Enjoy. ;)

twitch5.png

Cheers
 

wicknix

macrumors 68030
Original poster
Jun 4, 2017
2,599
5,256
Wisconsin, USA
Ok, so the previous way kind of sucked, and didn't work with any 10.4/10.5 browsers, so i created an app/script to make it easy. This is tested and working on Leopard. It may work on 10.4 if you edit the script to use mplayer. By default VLC is used as it starts the stream instantly, while mplayer takes a good 20-30 seconds to play.

Requirements: Current youtube-dl, FFmpeg from macports (does the smtube mplayer.pkg include it?), VLC 2.0.10 or higher, and OS X 10.5 or higher (10.4 is untested).

TPlay.png


480p fluctuates 60-90% cpu on PowerBook G4. 360p sits around 53%.
Screenshot-480p-G4.png


Cheers
 

Attachments

  • TwitchPlay.zip
    993.6 KB · Views: 109

NewbiePPC

macrumors member
Mar 21, 2021
58
35
Hi wicknix, I'm not sure if you're still supporting this app but it doesn't work for me at the moment, I try to download youtube-dl but doesn't work so I updated it from PPCMC but still no luck. I'm doing something wrong?


Untitled.jpg



Thanks for your work on PPC!
 

Jack Severity

macrumors newbie
Jul 9, 2022
6
5
@NewbiePPC i finally got around to fixing it (i hope as it works for me again).
Give it spin. http://macintoshgarden.org/apps/twitchplay

Cheers
Hi Wicknix.
I tried the version you have on MacGarden but havent had any luck getting it going. PPCMC twitch streaming works fine as I understand they are kinda the same? but yeah no luck with TwitchPlay.
When trying to update youtube dl with the included terminal command " /Applications/TwitchPlay.app/dist/bin/youtube-dl -U" I get "Error cant find the current version, please try again later.

When trying to watch a stream, put in streamers name and the res and I get all this....
"ERROR: Unable to download JSON metadata: <urlopen error [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol> (caused by URLError(SSLError(1, '_ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol'),))
pipe:: Invalid data found when processing inputKB sq= 0B f=0/0"

Twitchplay app is in my applications folder as told to do so. Also have python2.7 installed from your provided link
If i can offer anymore info please let me know. OS. Tiger, Mac G4 Cube 450mhz
 

juanstdio

macrumors member
Jun 3, 2021
50
97
Argentina
Looks like the bin youtube-dl got corrupted, I downloaded it from the garden, verified the md5, all good. but when I tried to update, it output
powerbook-g4-12-de-juan:/Library juanstdio$ /Applications/TwitchPlay.app/dist/bin/youtube-dl -U
sys:1: DeprecationWarning: Non-ASCII character '\x97' in file /Applications/TwitchPlay.app/dist/bin/youtube-dl on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
File "/Applications/TwitchPlay.app/dist/bin/youtube-dl", line 2
PK▒▒t5▒▒E▒▒▒▒bsv6▒▒▒]:e'
7▒r▒▒▒▒/▒-▒▒▒▒Rq▒▒▒b▒Ι|▒ƛp▒
^
SyntaxError: invalid syntax
 

juanstdio

macrumors member
Jun 3, 2021
50
97
Argentina
So I got an idea.. if you switch youtube-dl and use yt-dlp (From PPMC) you can still use the app.
I have edited twitch-play script (added some certs) and I was able to bypass the error
Also disabled some debug info from yt-dlp ffmpeg
I attached the modded twitch-play script, download and replace it under /Applications/TwitchPlay.app/dist/bin and you are ready to go



1657993647166.png
 

Attachments

  • twitch-play.zip
    932 bytes · Views: 60

Jack Severity

macrumors newbie
Jul 9, 2022
6
5
So I got an idea.. if you switch youtube-dl and use yt-dlp (From PPMC) you can still use the app.
I have edited twitch-play script (added some certs) and I was able to bypass the error
Also disabled some debug info from yt-dlp ffmpeg
I attached the modded twitch-play script, download and replace it under /Applications/TwitchPlay.app/dist/bin and you are ready to go



View attachment 2030636
awesome mate. Ill give it a go on my cube and see how i go. I was trying to do the same but bit 2 advanced for me. Ill edit this post with my results.

EDIT...
I managed to get it working kind of. It wouldnt work just downloading your edit but i moved a few files around in ppc media player and manged to get it to sort of work. video is playing but the colors are all wrong.
Currently downloading ppc media player again. 7.2.6 for tiger. will try it again when its downloded
 
Last edited:
  • Like
Reactions: juanstdio

juanstdio

macrumors member
Jun 3, 2021
50
97
Argentina
awesome mate. Ill give it a go on my cube and see how i go. I was trying to do the same but bit 2 advanced for me. Ill edit this post with my results.

EDIT...
I managed to get it working kind of. It wouldnt work just downloading your edit but i moved a few files around in ppc media player and manged to get it to sort of work. video is playing but the colors are all wrong.
Currently downloading ppc media player again. 7.2.6 for tiger. will try it again when its downloded
Exactly, it will look for yt-dlp, ffmpeg and python3.6 from PPMC folder.. Glad it worked :)

I tested it on my G4 12" 1ghz DVI and I was able to play streams up to 480p, highly recommed to install brew for tiger (tigerbrew) if you want to play around with the OS
 

wicknix

macrumors 68030
Original poster
Jun 4, 2017
2,599
5,256
Wisconsin, USA
Thanks for messing with it. I figured it had to be youtube-dl or certs related. Just haven't had a lot of time to look in to it again. Glad you got it working. I'll try to update it this coming week possibly if i get a chance.

Cheers
 
  • Like
Reactions: juanstdio

Dronecatcher

macrumors 603
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
Currently downloading ppc media player again. 7.2.6 for tiger. will try it again when its downloded
The script won't work with 7.2.6 as that version has yt-dlp pre-expanded - the prior version of PPCMC7 unpacks yt-dlp upon each execution.

If you use 7.2.6 replace "/Applications/PPCMC.app/bin/yt-dlp --rm-cache-dir" with this:

/Applications/PPCMC.app/bin/yt-dlp/yt_dlp/__main__.py --rm-cache-dir
 
Last edited:

Jack Severity

macrumors newbie
Jul 9, 2022
6
5
The script won't work with 7.2.6 as that version has yt-dlp pre-expanded - the prior version of PPCMC7 unpacks yt-dlp upon each execution.

If you use 7.2.6 replace "/Applications/PPCMC.app/bin/yt-dlp --rm-cache-dir" with this:

/Applications/PPCMC.app/bin/yt-dlp/yt_dlp/__main__.py --rm-cache-dir
Thank you Dronecatcher. That got it up and running but still getting the green & pink. Tried swapping a few files with ppc media but no luck. Works fine on ppcmc. Thanks for the help.
 

Attachments

  • IMG_20220717_231244478.jpg
    IMG_20220717_231244478.jpg
    673.7 KB · Views: 48
  • Like
Reactions: Dronecatcher

Dronecatcher

macrumors 603
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
Thank you Dronecatcher. That got it up and running but still getting the green & pink. Tried swapping a few files with ppc media but no luck. Works fine on ppcmc. Thanks for the help.
Adding this for FFPlay should fix the colours:

ffplay -vf scale=in_color_matrix=yuva420p,format=rgb32

I'm taking this from my youtube scripts so haven't tested it for the Twitch stuff - as I'm not a "Twitcher" :D
 

Jack Severity

macrumors newbie
Jul 9, 2022
6
5
Looks like the "new fix doesn't work anymore" :( it stopped working today for me. So opened PPCMC to download the lastest youtube-dl and looks like python is too far out of date. 3.7 looks like its the oldest supported now.
Is there an easy fix?
Many Thanks
 

Dronecatcher

macrumors 603
Jun 17, 2014
5,209
7,783
Lincolnshire, UK
Looks like the "new fix doesn't work anymore" :( it stopped working today for me. So opened PPCMC to download the lastest youtube-dl and looks like python is too far out of date. 3.7 looks like its the oldest supported now.
Is there an easy fix?
Many Thanks

Are you getting youtube-dl and yt-dlp mixed up? PPCMC7 now uses the latter.

Version 7.2.6 still works for me with the original yt-dlp it was bundled with - updating it would cause the Python trouble.

Incidentally, youtube-dl still appears to work but it's incredibly slow now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.