YouTube Downloader Patch [ Jitter ]

Nick Briz's icon

Hey everyone,

I wrote a patch a bit ago that would rip youtube videos directly into my Max patches, and I've used it on countless projects ever since from real-time performance patches to artgames to artware. It's a very useful patch as any Jitter folk might imagine, and so I figured I'd share it with the wonderful Max community.

download app + patch + corresponding files here: http://nickbriz.com/blog/?p=495

I've made many variations on this patch for different projects, but I did my best to clean this up and comment it a bit before posting so that it be clear for anyone interested in adding it to their video projects/patches. I've also posted a built application called Sample Chest (using this patch in a straight forward way, serves as a good example/demo).

let me know what yawl think!

-nick-
nickbriz.com

Peter Nyboer's icon

Nice idea! I tried the standalone, and it seemed to start downloading, (the "start" button blinks a couple of times, then posts "done" in the Max window) but I get nothing. OSX 10.68. Perhaps some sort of python or path issues? I tried the url http://www.youtube.com/watch?v=VWDc9oyBj5Q

Max Patch
Copy patch and select New From Clipboard in Max.

I looked at the source code, and I have some suggestions on how to better assemble the message for shell. This avoids atoi, and better accommodates using the patch in a standalone vs. Max5. I hope the suggestions help make future endeavors easier for you! I'm pretty sure they are all doing the same thing as your patch...hard to say, since I can't give it a final test!

gavspav's icon

Sample Chest didn't work for me (10.6.3).

Paste in the url and nothing happens.

Thanks anyway!

In the max window I get dialog:extra arguments for message "symbol" when I hit the start ripping button

yair reshef's icon

wicked@! this is v nice addition. thanks for sharing

sharing some more youtube hacks >

i use a combo of umph (perl, http://code.google.com/p/umph/) and youtube-dl (python, current dev in github.com/phihag/youtube-dl) for day to day youtube channel(!) ripping. you will need to install perl and python for this to work. and windows, but adapt for unix is easy

here is my command line string, save to bat file.
`
@echo off
set yt-dl-path=M:binyoutube-dl
set umph-path=M:binyoutube-dlumph
echo this script accpets a youTube user name and will d/l all user uploads.
set /p userName=Enter channel name (user):
set http_proxy=http://xxxx:xxxxx@xxxxx.cc:8888
md M:_sort%userName%
pushd M:_sort%userName%
perl %umph-path% -t u -a %userName% >> %userName%_uploads.log
python %yt-dl-path%youtube-dl.py -a "%userName%_uploads.log" -u user -p pwd -o %%(autonumber)s-%%(stitle)s-%%(id)s-%%(uploader)s.%%(ext)s -c -i --console-title -w --write-info-json

yair reshef's icon

:D i see you also use youtube-dl :)

yair reshef's icon

here is a windows version of pnyboer patch revision
i removed a few objects (does folder handling in mac so convoluted?) and subpatches, so no standalone love for now.
notice a trick to kill the python process from inside max (taskkill)

Max Patch
Copy patch and select New From Clipboard in Max.

*install python
* you will need DOShack (http://francois.eudes.free.fr/software/DOShack.zip) to replace the shell object.
* place youtube-dl.py script in the maxpat directory (or anywhere in %path%)

@pnyboer - there is a missing/broken parameter in your shell string. it should be -o and not 0 before the , maybe thats the problem.

yair reshef's icon
Max Patch
Copy patch and select New From Clipboard in Max.

removed some more code
added param -w (no overwrite) to youtube-dl
added subpatch with more params for yt-dl

Nick Briz's icon

@pnyboer + @yair reshef thnx for the remixes!!!
I'm going to take a serious look at them this weekend when I have some time + incorporate your edits.
-nick-

yair reshef's icon

dont touch my latest code, its broken