hulu.sh

Steam recording with RTMPDump or FFmpeg.
svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

hulu.sh

Post by svnpenn » Wed Feb 20, 2013 7:17 am

This is a Bash script for downloading from Hulu

github.com/svnpenn/a/blob/98ab611/hulu.sh

In simple terms it works like this

- copy hulu cookies to temp folder (for Hulu+)
- launch Firefox with a temp profile, this prevents any changes to your normal
profile and will not disturb any existing Firefox windows
- dump Firefox process memory and search for available videos
- download selected video

If you need Bash for Windows you can try Baby Cygwin

http://code.google.com/p/any/downloads

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Wed Feb 20, 2013 7:18 am

I just need it to save with proper filename now (episode title). Still working
on that.

WillJ
Posts: 6
Joined: Thu Feb 14, 2013 7:23 am

Re: hulu.sh

Post by WillJ » Sun Feb 24, 2013 12:58 am

Hey Svnpenn
I tried running this version of hulu.sh but this is what I get:

$ hulu.sh
usage: /usr/bin/hulu.sh [CDN FILETYPE] URL

CDN content delivery network
FILETYPE quality

Nothing further happens.
I am using Firefox 19, in the program files folder.
What have I done incorrectly? Your assistance would be appreciated.
Thanks

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Sun Feb 24, 2013 1:13 am

At least for right now, the URL is required. This is shown clearly with the "usage" printout.

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Thu Mar 07, 2013 10:57 am

Script now has preliminary support for episode titles.
github.com/svnpenn/a/commit/63ab

It will save in this format
Frasier 6x1 Good Grief.flv

However you will need "jq" in your /usr/local/bin
stedolan.github.com/jq

If you do not have "jq" it will be saved in this format
441362.flv

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Fri Mar 08, 2013 8:35 am

Add MP4 support

If FFmpeg is found at /usr/local/bin, then remux to MP4 from FLV

github.com/svnpenn/a/commit/18e0

User avatar
Zeranoe
Site Admin
Posts: 627
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: hulu.sh

Post by Zeranoe » Fri Mar 08, 2013 3:20 pm

svnpenn wrote:Add MP4 support

If FFmpeg is found at /usr/local/bin, then remux to MP4 from FLV

github.com/svnpenn/a/commit/18e0
Why search only in /usr/local? Might work better to run something like:

Code: Select all

if ! type -P ffmpeg >/dev/null; then
  log ffmpeg -i "$flv.flv" -c copy -v warning "$flv.mp4"
  log rm "$flv.flv"
fi
So any FFmpeg found within the PATH will work.

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Fri Mar 08, 2013 5:16 pm

Zeranoe wrote: Why search only in /usr/local? Might work better to run something like:

Code: Select all

if ! type -P ffmpeg >/dev/null; then
  log ffmpeg -i "$flv.flv" -c copy -v warning "$flv.mp4"
  log rm "$flv.flv"
fi
Of course I did think of this, however /dev/null just makes me feel icky. I know it is strange.

User avatar
Zeranoe
Site Admin
Posts: 627
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: hulu.sh

Post by Zeranoe » Fri Mar 08, 2013 5:35 pm

Sending the output of type -P to /dev/null should be safe. You only care about the exit code of type -P, and not the printed output.

On a side note, lines 26-35 could be shortened to:

Code: Select all

usage ()
{
cat <<EOF
usage: $0 [CDN FILETYPE] URL

CDN       content delivery network
FILETYPE  quality

run with just URL to get CDN and FILETYPE params
EOF
exit 0
}
It also looks like you aren't using exit codes with your commands, which might be helpful to add for the users who wish to run further commands based on if your script failed/succeeded.

Lastly, you seem to be mixing in sh with bash, which should be avoided.

It's a great script though, very helpful, thanks!

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: hulu.sh

Post by svnpenn » Fri Mar 08, 2013 5:55 pm

Zeranoe wrote: Lastly, you seem to be mixing in sh with bash, which should be avoided.
I assume you are talking about the process substitution?

Code: Select all

<()
Perhaps a better way is available?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests