Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   rtmpdump (http://stream-recorder.com/forum/forumdisplay.php?f=54)
-   -  

hulu.sh, download from Hulu

(http://stream-recorder.com/forum/showthread.php?t=12801)

svnpenn 06-14-2012 07:04 PM

hulu.sh, download from Hulu


 
The problem I have with RtmpSrv is, it does not have a way to choose quality.

For example on Hulu they will have 1000 stream, 650 stream, and 400 stream. RtmpSrv will only capture the stream that is actually playing, no more.

This script allows you to choose from quality and CDN, before invoking RtmpDump.

It is written in Bash, and should only require rtmpdump.exe and a standard Cygwin installation. Please post if you have problems.

http://github.com/svnpenn/etc/blob/master/hulu.sh

svnpenn 06-16-2012 10:28 AM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/dotfiles/commit/ebbd

Quote:

Support limelight CDN

the RTMP token, as found in the hulu SMIL file uses encoded ampersands, e.g.
"&". limelight CDN does not accept these, they need to be decoded first.

Numerous other fixes
- Search for "plugin-container.exe" instead of "plugin-container"
- Improve Bash SMIL parsing
- Call "/bin/kill" instead of "env kill"
- Use "<" instead of "cat"
- Use array instead of temporary XML file
- Update Hulu SWF

svnpenn 06-16-2012 05:41 PM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/dotfiles/commit/6377

Quote:

Remove call to sed

The sed call in xmlget() was only being used by "token".

Change it to bash string substitution.

svnpenn 06-17-2012 08:35 PM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/dotfiles/commit/fc80

Quote:

Support Flash 11.3

Adobe has made a change to flash player.

blogs.adobe.com/asset/2012/06/inside-flash-player-protected-mode-for-firefox

With version 11.3, flash player now runs as 3 processes.

* plugin-container.exe
* FlashPlayerPlugin_11_3_300_257.exe
* FlashPlayerPlugin_11_3_300_257.exe (2nd instance)

The data for dumping is contained in one of the last two. This patch dumps all 3
process and search all 3. Patch should still work on older versions of flash.

svnpenn 06-17-2012 11:29 PM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/dotfiles/commit/dc03

Quote:

Disable flash player protected mode for Firefox

According to http://forums.adobe.com/thread/1018071

instead of dealing with the new protected mode, which involves 3 processes for
the flash player, you can simply disable it.

This means once again only plugin-container.exe will need to be dumped and not
these new processes. This will speed up the dumping process and parsing process.

svnpenn 06-24-2012 02:21 AM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/dotfiles/commit/44bf

Quote:

Faster parsing of dump file

"cat -v" creates print-friendly output from binary file.

attrget() function rewrite, use string substitution instead of grep for better
speed.

svnpenn 06-25-2012 02:40 AM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/etc/blob/master/hulu.sh

New link, moderator please update.

ka6_jeram 06-25-2012 08:04 AM

Re: hulu.sh, download from Hulu


 
This happened to all Hulu link that I tried. Is it maybe because I use the unofficial rtmpdump?. I use the v2.5 ones.

svnpenn 06-25-2012 04:30 PM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by ka6_jeram (Post 48218)
This happened to all Hulu link that I tried. Is it maybe because I use the unofficial rtmpdump?. I use the v2.5 ones.

You will need to post link to the video, I cannot reproduce.

ka6_jeram 06-25-2012 05:27 PM

Re: hulu.sh, download from Hulu


 
http://www.hulu.com/watch/374154

svnpenn 06-26-2012 06:04 AM

Re: hulu.sh, download from Hulu


 
Working

Code:

$ hulu.sh
Press enter after video starts

Printing results
 1      1000_h264      level3
 2      1000_h264      akamai
 3      650_h264      limelight
 4      650_h264      level3
 5      650_h264      akamai
 6        480_vp6      limelight
 7        480_vp6      level3
 8        480_vp6      akamai
 9      400_h264      limelight
10      400_h264      level3
11      400_h264      akamai
12      1000_h264      limelight
Make choice. Avoid level3.
2
+ rtmpdump -W http://download.hulu.com/huludesktop.swf -a 'ondemand?auth=daEbwai
dXctbjdwcVb2dWc.ambLaPdUaabL-bp6AuD-c0-YnNEAEwZJAo&aifp=sll02152008&slist=hulu11
/610/60088610;.international=false&hgt=OZU7Pvs7j27-nhteNno7wi_3ao6vlYo1COP3BVPp-
aTr3JS75f_gKgnw5UKnHenxv-x-Y1Q9qxtCC_lenq57JHbRNxrum6EuLhwAbGRsfe_lf_RyJv714ST9_
oS6WcVqPNgpyDKMtqHAW2D9o0FTtMyPavFQwjqgoPZcRxhngs-LCixcraz8yh-XyW8a4kTqB9pk1BP49
RdP2OVk_T3lhtRMJqrenuOQ4U_E4OBUtwdcPF73YYlxd8A0nT7d8izk&hgt_ver=331370278' -o ou
t.flv -r rtmpe://cp39466.edgefcs.net/ondemand -y mp4:hulu11/610/60088610/agave50
312932_10669309_H264_1000.mp4
RTMPDump v2.4-34-g7340f6d
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: Type mismatch: client sent 6, server answered 9
INFO: Connected...
Starting download at: 0.000 kB
INFO: Metadata:
INFO:  duration              1524.85
INFO:  moovPosition          36.00
INFO:  width                720.00
INFO:  height                400.00
INFO:  videocodecid          avc1
INFO:  audiocodecid          mp4a
INFO:  avcprofile            100.00
INFO:  avclevel              30.00
INFO:  aacaot                2.00
INFO:  videoframerate        23.98
INFO:  audiosamplerate      22050.00
INFO:  audiochannels        2.00
INFO: tags:
INFO:  ┬⌐too                Hulu v1.11
INFO: trackinfo:
INFO:  length                36593557.00
INFO:  timescale            24000.00
INFO:  language              und
INFO: sampledescription:
INFO:  sampletype            avc1
INFO:  length                67246080.00
INFO:  timescale            44100.00
INFO:  language              und
INFO: sampledescription:
INFO:  sampletype            mp4a
17427.517 kB / 149.65 sec (9.8%)


svnpenn 07-08-2012 08:41 PM

Re: hulu.sh, download from Hulu


 
github.com/svnpenn/etc/commit/a571

Quote:

Use the Bash temporary variable

Bash already has a temporary variable, $_
This can be used instead of an arbitrarily named variable.

I also utilized some more process substitution for better speed of script
execution.

sub7 07-21-2012 05:39 AM

Re: hulu.sh, download from Hulu


 
How can I get this working on ubuntu?

What changes do I need to make?

Thanks.

evol 07-21-2012 07:57 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by sub7 (Post 49617)
How can I get this working on ubuntu?

What changes do I need to make?

Thanks.

At a guess the only thing i can see is this line
Code:

p="plugin-container.exe"
So try........

Code:

p="plugin-container"
or
Code:

p="/usr/lib/firefox-X.X.X/plugin-container"
X.X.X been the version of fifefox. :)

svnpenn 07-21-2012 11:26 AM

Re: hulu.sh, download from Hulu


 
In addition Im pretty sure the dumper.exe is not portable. That is what dumps the process memory of plugin-container.exe

I believe in linux you do something like

Code:

cat /proc/<pid>/mem > dumpfile.dmp

sub7 07-21-2012 11:46 AM

Re: hulu.sh, download from Hulu


 
I managed to make this in PHP: http://69.55.60.143/?url=http://www....m/watch/331326

Change the url to the episode you want and it will spit out an rtmpdump command.

Can you test this command for me as I am having the following issue running it...

Code:

RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: Type mismatch: client sent 6, server answered 9
WARNING: HandShake: Server not genuine Adobe!
ERROR: RTMP_Connect1, handshake failed.


sub7 07-21-2012 12:52 PM

Re: hulu.sh, download from Hulu


 
Sorry for hijacking your thread dude...

I installed the following package which fixed everything.

https://launchpad.net/~mario-sitz/+a...+build/2882813

svnpenn 09-08-2012 05:56 PM

Re: hulu.sh, download from Hulu


 
Quote:

Sort results

Results for Hulu videos are now sorted, and duplicates removed if they exist. In
addition the Regular expression was producing junk in some situations, this has
been fixed.

Tested on
http://hulu.com/watch/360292
http://hulu.com/watch/399375
github.com/svnpenn/etc/commit/ba81

chap 09-09-2012 12:08 AM

Re: hulu.sh, download from Hulu


 
works fine (timeout 3)

svnpenn 09-09-2012 12:23 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by chap (Post 53977)
works fine (timeout 3)

timeout 1, no good?

chap 09-09-2012 12:50 AM

Re: hulu.sh, download from Hulu


 
not on XP
maybe it depends on the configuration of your computer (my old computer:confused: )

svnpenn 09-09-2012 01:16 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by chap (Post 53984)
not on XP
maybe it depends on the configuration of your computer
(my old computer:confused: )

I think some computers are too slow for "timeout 1". I will make a better fix
for this.

svnpenn 09-09-2012 11:11 PM

Re: hulu.sh, download from Hulu


 
Quote:

Wait until memory dump finishes

Before the memory dump was allowed 1 second to complete, which was not enough
time on slower systems. This was causing no results to be diplayed. Now the
script will wait until the memory dump is complete, before continuing.
github.com/svnpenn/etc/commit/58dd

harryniles2 09-12-2012 04:15 PM

Re: hulu.sh, download from Hulu


 
hi svnpenn, thanks for this app. I am getting this after i restart the video:

Killed flash player for clean dump.
Restart video then press enter here

hulu.sh: line 27: syntax error near unexpected token `<'
hulu.sh: line 27: `read < <(pidof $p) || die "$p not found!"'


I used the latest commit and am using cygwin with FF on http://hulu.com/watch/360292
any ideas? thanks!

EDIT: now working but getting this:

/cygdrive/e/rtmpdumphelper
$ ./hulu.sh
Killed flash player for clean dump.
Restart video then press enter here

0 480_vp6 akamai
1 400_h264 akamai
2 1000_h264 akamai
3 1500_h264 akamai
4 2000_h264 akamai
5 650_h264 akamai
6 3200_h264 akamai
7 2500_h264 akamai
8 480_vp6 limelight
9 400_h264 limelight
10 1000_h264 limelight
11 1500_h264 limelight
12 2000_h264 limelight
13 650_h264 limelight
14 3200_h264 limelight
15 2500_h264 limelight
16 480_vp6 level3
17 400_h264 level3
18 1000_h264 level3
19 1500_h264 level3
20 2000_h264 level3
21 650_h264 level3
22 3200_h264 level3
23 2500_h264 level3
Make choice. Avoid level3.
5
+ rtmpdump -W http://download.hulu.com/huludesktop.swf -a 'ondemand?auth=daEa5c1bmdAdncDa1dQbFcJcPdyazaTdLcy-bquq0Q-c0-3pICtFt1Dzv&aifp=sll02152008&slist=darwin/ma/2/60072002;.international=false&hgt=OZU7Pvs7j27-nhteNno7wueF6VUWbadZXncK-ZYDlmRtUTDx0IBZTLU0L5EBqtpRKwhYTUT0JomTlvrsa46gq6X 8Turh1ryBNc6hz0nx5pDon8r9g4fZ38HeiDYjNiHlAdGigtS3p _QvVX2IbaMbybjEd1kt5eilfvAJfy5-oW68tiLM80qST32cChsdDRKDtVuZgb-LWzeMRdTQ-la9AQy5WQqWscTxkD7sXsa8jM23fywukEZtZ0scdJ8AGh2w&hg t_ver=331370278' -o out.flv -r rtmpe://cp39466.edgefcs.net/ondemand -y mp4:darwin/ma/2/60072002/agave50295746_10228553_H264_650.mp4
./hulu.sh: line 52: rtmpdump: command not found

rtmpdump.exe is present in same folder

svnpenn 09-12-2012 04:46 PM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by harryniles2 (Post 54132)
rtmpdump.exe is present in same folder

Ah yes, I made a personal choice to search for rtmpdump.exe on the PATH. Here
are a couple of ways to fix that.

Move rtmpdump.exe to the PATH, for example
C:\cygwin\usr\local\bin\rtmpdump.exe

OR

Adjust the PATH before running the script, for example
PATH=.:$PATH

For the long term I will try to make a fix for this.

harryniles2 09-12-2012 05:00 PM

Re: hulu.sh, download from Hulu


 
AHA! now working :) (should have thought of that)

many thanks svnpenn

svnpenn 09-12-2012 05:27 PM

Re: hulu.sh, download from Hulu


 
Quote:

Search current directory

Script will now search current directory, in addition to the PATH. This is to
allow people to put rtmpdump.exe in same folder as the script.
github.com/svnpenn/etc/commit/25a3

harryniles2 09-12-2012 07:44 PM

Re: hulu.sh, download from Hulu


 
Hi svnpenn cheers for the quick fix. Can i request subtitle support? When i first started using rtmpdump an srt would always dl as well, but never now. The flv ends up hardsubbed. I was able to grab subtitles by looking at contentid in source but they are encrypted smi files. Or if you've any idea how to decrypt. Thanks again

ncfballkid 09-26-2012 11:09 AM

Re: hulu.sh, download from Hulu


 
How were you guys able to solve the

hulu.sh: line 27: syntax error near unexpected token `<'
hulu.sh: line 27: `read < <(pidof $p) || die "$p not found!"'

error?

Thanks, Andrew

svnpenn 09-26-2012 07:20 PM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by ncfballkid (Post 54693)
How were you guys able to solve the

hulu.sh: line 27: syntax error near unexpected token `<'
hulu.sh: line 27: `read < <(pidof $p) || die "$p not found!"'

error?

Thanks, Andrew

"unexpected token" means you arent using Bash. God knows how you were able to even make that happen. You can test your terminal like this

Code:

read < <(pwd)
If running this command make an error, you have done something wrong.

tcatone 10-19-2012 11:50 PM

Re: hulu.sh, download from Hulu


 
Hey, svnpenn.

I just want to thank you for taking the time to work on hulu.sh. I actually have absolutely no background in Linux or programming. However, I had been searching so long for a way to download from Hulu, and after finding my way to this forum, that I decided to suck it up and learn how to use Cygwin.

Anyway, I'm wondering which version of rtmpsrv we are supposed to use with hulu.sh. I have rtmpsrv 2.4 that I got from VideoHelp (rtmpdump), but I am unable to download. I see that there are multiple versions of rtmpsrv that many different people have worked on....

If it makes a difference, I'm using Windows 7 Home Premium SP1 and FireFox 16.0.1. Thanks for your help!!

svnpenn 10-20-2012 12:00 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by tcatone
Anyway, I'm wondering which version of rtmpsrv we are supposed to use with hulu.sh.

hulu.sh does not require RtmpSrv, only RtmpDump.

shamshel 10-26-2012 05:28 PM

Re: hulu.sh, download from Hulu


 
Hate to come outta nowhere and do this, but has something changed in hulu.sh? I'm getting:

Quote:

hulu.sh: line 21: syntax error near unexpected token `<'
hulu.sh: line 21: `until read < <(pidof $pc); do warn "$pc not found!"; done'
EDIT:

Ok, I think I got it. But now, this happens:

Quote:

Killed flash player for clean dump.
Restart video then press enter here.

Make choice. Avoid level3.
As you can see, there are no choices present.

EDIT 2:

I thought I should show what happens after I enter a random number (because no choices appear):

Code:

Make choice. Avoid level3.
2
+ rtmpdump -W http://download.hulu.com/huludesktop.swf -a '?' -o a.flv -r '' -y ''
RTMPDump v2.4 GIT-2012-07-26 (Compiled by KSV)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: RTMP URL: No :// in url!
WARNING: Couldn't parse the specified url ()!
ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname

After that, the video crashes.

I've been searching these forums for a solution, and it seems like someone else had a similar problem to me in the past:

http://stream-recorder.com/forum/sho...3949#post53949

svnpenn 10-26-2012 11:48 PM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by shamshel
As you can see, there are no choices present.

As of this moment, the script is and has been working. If you want more help you will need to provide the Hulu page in question.

Code:

$ hulu.sh
Killed flash player for clean dump.
Restart video then press enter here.

 0      400_h264      akamai
 1      1000_h264      akamai
 2      400_h264      limelight
 3      1000_h264      limelight
 4      400_h264      level3
 5      1000_h264      level3
Make choice. Avoid level3.
1
+ rtmpdump -W http://download.hulu.com/huludesktop.swf -a 'ondemand?auth=daEbvbx
c1cSbibpaVdnbZbBbYcMcva.dXb8-bqI3sG-c0-XoIDuErZIyr&aifp=sll02152008&slist=hulu23
/647/60138647;.international=false&hgt=OZU7Pvs7j27-nhteNno7wle1tifVL5n72ztajNhv8
xOVZB5rGd0inzIqGIf_Lzj4q-v4605WcjlduQg0WmBPb9DER7AEdu2EXkcmlHsHzpg-L5A9XjUOApnPc
_0H_cXXDW34pLn6N17Vk9n21dZdU8LxlewjIiPG_QNrFdWQn2jgI8Q2XEpb_pPN17Xnr1XV49O8De-Qm
_ZcdaYBKTYQd84Bw6gHFPGn2q5RXF1OUTlAz2lhmY5gaOj3zeMEJsIw&hgt_ver=331370278' -o a.
flv -r rtmpe://cp39466.edgefcs.net/ondemand -y mp4:hulu23/647/60138647/agave5036
0969_13022436_H264_1000.mp4
RTMPDump v2.4-49-g6ed7d74
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: Type mismatch: client sent 6, server answered 9
INFO: Connected...
Starting download at: 0.000 kB
INFO: Metadata:
INFO:  duration              1343.02
INFO:  moovPosition          36.00
INFO:  width                720.00
INFO:  height                400.00
INFO:  videocodecid          avc1
INFO:  audiocodecid          mp4a
INFO:  avcprofile            100.00
INFO:  avclevel              30.00
INFO:  aacaot                2.00
INFO:  videoframerate        23.98
INFO:  audiosamplerate      24000.00
INFO:  audiochannels        2.00
INFO: tags:
INFO:  ┬⌐too                Hulu v1.12
INFO: trackinfo:
INFO:  length                32230198.00
INFO:  timescale            24000.00
INFO:  language              und
INFO: sampledescription:
INFO:  sampletype            avc1
INFO:  length                64464896.00
INFO:  timescale            48000.00
INFO:  language              und
INFO: sampledescription:
INFO:  sampletype            mp4a
4669.127 kB / 40.04 sec (2.9%)


shamshel 10-27-2012 12:33 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by svnpenn (Post 55798)
As of this moment, the script is and has been working. If you want more help you will need to provide the Hulu page in question.

None of the videos I'm trying work. I've tried these so far:

http://www.hulu.com/watch/1783
http://www.hulu.com/watch/413189
http://www.hulu.com/watch/220145
http://www.hulu.com/watch/406882

Here's what's I'm getting:

Code:

shamshel@shamshel-PC /usr/local/bin
$ hulu.sh
Killed flash player for clean dump.
Restart video then press enter here.

Make choice. Avoid level3.
1
+ rtmpdump -W http://download.hulu.com/huludesktop.swf -a '?' -o a.flv -r '' -y ''
RTMPDump v2.4-49-g6ed7d74
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: RTMP URL: No :// in url!
WARNING: Couldn't parse the specified url ()!
ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname

I'm using:
rtmpdump from https://github.com/svnpenn/rtmpdump/downloads
hulu.sh from https://github.com/svnpenn/etc/blob/master/hulu.sh (obviously)

svnpenn 10-27-2012 01:55 AM

Re: hulu.sh, download from Hulu


 
Quote:

Do the waiting for the user

Until now the script instructed the user to restart the video, then press enter.
This leaves room for error. If Ads play before the video and the user pressed
enter very quickly, then the script could dump flash player before the actual
video has started.

To prevent this the script no longer allows the user to determine proper
"waiting" time. Script will first try 2 seconds, then keep increasing by one
second until enough time has passed for the actual video to be captured.
github.com/svnpenn/etc/commit/7ee7

chanc 10-27-2012 03:01 AM

Re: hulu.sh, download from Hulu


 
Yes , the previous script requires the users to press enter at the proper time , that is , right after the video begins , not the ad.

chanc 10-27-2012 03:05 AM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by svnpenn (Post 55806)

By the way, after downloading the latest version , I found no rtmp-host.sh in the folder, but rtmp-help.sh .

shamshel 10-27-2012 01:03 PM

Re: hulu.sh, download from Hulu


 
Quote:

Originally Posted by svnpenn (Post 55806)

Thanks for trying to help me. The problem with this is that after the script kills Flash, I go to refresh the page, but the script doesn't provide enough time for the new video to load before killing Flash again.

So, basically, I'm getting an endless cycle of:
(1) "Attempt x, Restart video"
(2) Pressing refresh
(3) The refreshed video play for 2 seconds
(4) Flash crashes
(5) "Attempt x+1, Restart video"
etc.

Code:

shamshel@shamshel-PC /usr/local/bin
$ hulu.sh
This script requires Firefox.
Killed flash player for clean dump.
Attempt 1, Restart video.
Attempt 2, Restart video.
Attempt 3, Restart video.
Attempt 4, Restart video.
Attempt 5, Restart video.
Attempt 6, Restart video.

Quote:

Originally Posted by chanc (Post 55808)
Yes , the previous script requires the users to press enter at the proper time , that is , right after the video begins , not the ad.

Hmmm, I thought I was pressing enter after the real video (not the ad) loads. Maybe I just wasn't waiting long enough.

svnpenn 10-27-2012 05:59 PM

Re: hulu.sh, download from Hulu


 
Quote:

Kill dumper

previous script was killing "plugin-container", but not killing "dumper". This
could cause and issue when the program loops, because a second instance of
dumper could be called before the first instance is killed.
github.com/svnpenn/etc/commit/e6a5


All times are GMT -6. The time now is 07:29 PM.