Permalink
Browse files

First commit

  • Loading branch information...
0 parents commit 044637380a3804f00b02f557c67debab63ce48dd @singpolyma committed Nov 20, 2011
Showing with 53 additions and 0 deletions.
  1. +13 −0 COPYING
  2. +1 −0 README
  3. +24 −0 icefilms-download
  4. +15 −0 icefilms-sources
13 COPYING
@@ -0,0 +1,13 @@
+Copyright © 2011, Stephen Paul Weber <singpolyma.net>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1 README
@@ -0,0 +1 @@
+These are some scripts to help in using <http://icefilms.info> without JavaScript.
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+DOWNLOAD_RB='
+f = Nokogiri::parse(STDIN.read).at("form[name=frm]")
+def f.method_missing(att)
+ self.at("input[name=#{att}]").attributes["value"]
+end
+
+puts "id=#{ARGV[1]}&s=120&iqs=#{f.iqs}&url=#{f.url}&m=-35&cap=&sec=37fn8Oklq&t=#{ARGV[0]}"
+'
+
+POSTDATA="`curl -s http://www.icefilms.info/membersonly/components/com_iceplayer/video.php?vid=$1 | ruby -rnokogiri -e"$DOWNLOAD_RB" $1 $2`"
+MEGAUPLOAD="`curl -s http://www.icefilms.info/membersonly/components/com_iceplayer/video.phpAjaxResp.php -d "$POSTDATA" | cut -d= -f2- | cut -d'&' -f1 | ruby -rcgi -e 'puts CGI::unescape(gets)'`"
+MEGAUPLOAD_PAGE="`curl -s "$MEGAUPLOAD"`"
+
+TIMEOUT="`echo "$MEGAUPLOAD_PAGE" | grep 'count=\d*' | cut -d= -f2 | cut -d';' -f1`"
+while [ $TIMEOUT -gt 0 ]; do
+ printf "\r%02d" $TIMEOUT
+ sleep 1
+ TIMEOUT="$(( $TIMEOUT - 1 ))"
+done
+
+echo
+echo "$MEGAUPLOAD_PAGE" | ruby -rnokogiri -e 'puts Nokogiri::parse(STDIN.read).at("#downloadlink").at("a").attributes["href"]'
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+ID="$1"
+if echo "$ID" | grep icefilms; then
+ ID="`echo "$ID" | cut -d= -f2 | cut -d';' -f1`"
+fi
+
+curl -s http://www.icefilms.info/membersonly/components/com_iceplayer/video.php?vid=$ID | ruby -rnokogiri -e '
+Nokogiri::parse(STDIN.read).at("#srclist").search(".ripdiv").each do |el|
+ puts el.at("b").inner_html # section title
+ el.search("a").each do |a|
+ puts "#{ARGV[0]} #{a.attributes["onclick"].to_s.scan(/\d+/)[0]}"
+ end
+end
+' $ID

0 comments on commit 0446373

Please sign in to comment.