hulu.sh
hulu.sh
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
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
Re: hulu.sh
I just need it to save with proper filename now (episode title). Still working
on that.
on that.
Re: hulu.sh
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
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
Re: hulu.sh
At least for right now, the URL is required. This is shown clearly with the "usage" printout.
Re: hulu.sh
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
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
Re: hulu.sh
Add MP4 support
If FFmpeg is found at /usr/local/bin, then remux to MP4 from FLV
github.com/svnpenn/a/commit/18e0
If FFmpeg is found at /usr/local/bin, then remux to MP4 from FLV
github.com/svnpenn/a/commit/18e0
Re: hulu.sh
Why search only in /usr/local? Might work better to run something like: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
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
Re: hulu.sh
Of course I did think of this, however /dev/null just makes me feel icky. I know it is strange.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
Re: hulu.sh
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:
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!
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
}
Lastly, you seem to be mixing in sh with bash, which should be avoided.
It's a great script though, very helpful, thanks!
Re: hulu.sh
I assume you are talking about the process substitution?Zeranoe wrote: Lastly, you seem to be mixing in sh with bash, which should be avoided.
Code: Select all
<()