New Youtube Player/Downloader..even For G3

Discussion in 'PowerPC Macs' started by Dronecatcher, Feb 7, 2017.

  1. Dronecatcher, Feb 7, 2017
    Last edited: Sep 30, 2017

    Dronecatcher macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #1
    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 mplayer into Applications - I've supplied two versions of mplayer, the later one (svn version) is the best and most efficient but doesn't agree with some machines (I couldn't get it working on my G3 imac). Remember to rename the svn version to mplayer.

    Drag 240, 360, 720 and YT into any folder you wish and from there drag to the right hand side of the Dock to make shortcuts.

    dock.jpg

    240 downloads 240P video, 360 downloads 360P and 720 is 720P.
    YT is to stream the video only.

    Make a folder in Movies called Youtube - this is the default download folder for 240, 360 and 720 - but you can edit these scripts to point to any folder you wish.

    Drag TonVid into Applications and make a shortcut in the Dock - this is a TenFourFoxBox app so TenFourFoxBox must already be installed.

    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.

    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 on the YT icon in the dock - a terminal window will open and youtube-dl will grab the URL and pipe the video into mplayer. The default quality is 240P which is ideal for G3s and G4 portables but as I'll explain later, you can change the streaming quality to 360 or 720.
    Note there is a delay while youtube-dl does it's stuff before launching mplayer - for short videos it's quicker to download the files and play from the folder.

    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
    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.
    A Terminal window will open and start downloading - when complete, the download folder will open automatically so you can play your file.

    Customizing the scripts.

    YT, 240, 360 and 720 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.

    This is YT opened up:

    youtube-dl -f "best[height <=240]" "$(pbpaste)" -o -|/Applications/mplayer -really-quiet -framedrop -cache 256 -
    killall Terminal


    A quick edit would be to change 240 to 360 or 720.

    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

    I've also included mView and mViewX - these are droplets that can be placed in Applications and the Dock. 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.

    I've tested the scripts on:

    G3 iMac - 500Mhz, 512Mb RAM, Tiger

    imac1.jpg

    G4 Powerbook 12" 1.33Ghz, 768Mb RAM, Tiger

    12YT.jpg

    G4 Powerbook 17" 1.67Ghz, 2Gb RAM, Leopard

    167360.jpg


    As you can see, 30% CPU for video playback on a 500Mhz G3 is not bad!

    I'm no coder so this is all rough and ready - maybe someone can refine it further?

    Oh, and before anyone asks, I tried this with VLC, Quicktime and Coreplayer - only mplayer would do it.

    Download

    EDIT: SEE POST 26 FOR UPDATED STREAMING APP (TO PREVENT FAILED WEBM SELECTION) - NOW UPDATED IN DOWNLOAD IN FIRST POST

    EDIT: REGULARLY PERFORM UDATE CHECK IN TERMINAL - YOUTUBE IS CONSTANTLY CHANGING: youtube-dl -U

    EDIT: VLC CAN PLAY WITH THIS AS LONG AS IT'S THE LAST VERSION AVAILABLE FOR POWERPC - WHICH I TEND NOT TO USE ON G4S AS IT'S SLIGHTLY LESS EFFICIENT.
     
  2. dustinschings macrumors 6502

    dustinschings

    Joined:
    Sep 3, 2015
  3. CooperBox macrumors 6502a

    CooperBox

    Joined:
    Nov 28, 2010
    Location:
    France - between Ricard & Absinthe
    #3
    I too plan to try this. Just wondering whether I'll make home-base though......
     
  4. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #4
    Wow, impressive work, glad that something on Tiger is working but don't write off SMtube on Tiger yet, I just need more time to get it working :)
     
  5. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #5
    I'm sure it's only a matter of time..

    The bar for SMtube on Tiger for me is space - my Tiger machines have smaller disks so that extra 2.5Gb would be noticed!
     
  6. LightBulbFun macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #6
    any idea how this will run on something like a 604? :)
     
  7. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #7
    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....
     
  8. sawpits macrumors member

    Joined:
    Feb 28, 2014
    #8
  9. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #9
    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.
     
  10. Imixmuan macrumors 6502

    Joined:
    Dec 18, 2010
    #10
    Very, very impressive work Dronecatcher! PowerPC not dead, not dead even a little.
     
  11. bobesch macrumors 6502a

    bobesch

    Joined:
    Oct 21, 2015
    Location:
    Kiel, Germany
    #11
    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!
     
  12. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #12
    It would be great if some coder could wrap all this up into one app :)
     
  13. QSDP-User, Feb 7, 2017
    Last edited: Feb 7, 2017

    QSDP-User macrumors regular

    QSDP-User

    Joined:
    Jan 13, 2015
    Location:
    California, USA
    #13
    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
     
  14. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #14
    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.
     
  15. QSDP-User, Feb 8, 2017
    Last edited: Feb 8, 2017

    QSDP-User macrumors regular

    QSDP-User

    Joined:
    Jan 13, 2015
    Location:
    California, USA
    #15
    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.
     
  16. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #16
    Here we go....300Mhz iBook Clamshell streaming 240P Youtube - at 57% CPU.
    Can anyone go any lower?
    :)

    1.jpg
     
  17. LightBulbFun macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #17
    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)
     
  18. Dronecatcher, Feb 9, 2017
    Last edited: Feb 9, 2017

    Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #18
    If it was connected I think the Kanga could manage it - I suspect 200Mhz might be the limit.
    --- Post Merged, Feb 9, 2017 ---
    Switching to thousands of colours and uninstalling Perian knocks 10% off CPU....

    1b.jpg
     
  19. LightBulbFun macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #19
    CPU maybe but what are the min ram requirements? :D

    upload_2017-2-9_22-22-21.png
     
  20. philgxxd macrumors member

    philgxxd

    Joined:
    Feb 11, 2017
    Location:
    Malaga, Spain
    #20
    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?
     
  21. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #21
    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 :)
     
  22. philgxxd macrumors member

    philgxxd

    Joined:
    Feb 11, 2017
    Location:
    Malaga, Spain
    #22
    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.
     
  23. Slix macrumors 6502a

    Slix

    Joined:
    Mar 24, 2010
    #23
    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
     
  24. Slix macrumors 6502a

    Slix

    Joined:
    Mar 24, 2010
    #24
    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?
     
  25. Dronecatcher thread starter macrumors 68000

    Dronecatcher

    Joined:
    Jun 17, 2014
    Location:
    Lincolnshire, UK
    #25
    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
     

Share This Page