]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/commitdiff
Added the ability to download FuckedTube (http://www.fuckedtube.com/) videos.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Mar 2009 23:09:13 +0000 (19:09 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Mar 2009 23:09:13 +0000 (19:09 -0400)
src/websites/fuckedtube.rb [new file with mode: 0644]
test/fixtures/fuckedtube/3.html [new file with mode: 0644]
test/fuckedtube_remote_test.rb [new file with mode: 0644]
test/fuckedtube_test.rb [new file with mode: 0644]
test/remote_test_suite.rb
test/test_suite.rb

diff --git a/src/websites/fuckedtube.rb b/src/websites/fuckedtube.rb
new file mode 100644 (file)
index 0000000..dfde083
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright Michael Orlitzky
+#
+# http://michael.orlitzky.com/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# http://www.fsf.org/licensing/licenses/gpl.html
+#
+
+require 'src/website'
+
+class Fuckedtube < Website
+
+  VALID_FUCKEDTUBE_URL_REGEX = /^(http:\/\/)?(www\.)?fuckedtube\.com\/video\/\d+\/(.+)$/
+
+  def self.owns_url?(url)
+    return url =~ VALID_FUCKEDTUBE_URL_REGEX
+  end
+
+  
+  def get_video_url()
+    page_data = self.get_page_data(@url)
+    video_url = self.parse_video_url(page_data)
+    return video_url
+  end
+
+
+  protected;
+
+  # Get the FLV file URL from the HTML page for this movie.
+  # It's stored in some Flash variable.
+  def parse_video_url(page_data)
+    video_url_regex = /\?movie=([a-z0-9\-_]+\.flv)&/i
+    matches = video_url_regex.match(page_data)
+
+    if (matches.nil? || matches.length < 2)
+      raise StandardError.new('Could not find the "movie" flash variable on the page.');
+    end
+    
+    return "http://www.fuckedtube.com/videos/br_#{matches[1]}"
+  end
+
+
+  # Just make a normal HTTP "get" request.
+  def get_page_data(url)
+    uri = URI.parse(url)
+    
+    response = Net::HTTP.start(uri.host, uri.port) do |http|
+      http.get(uri.path)
+    end
+    
+    return response.body
+  end
+
+end
diff --git a/test/fixtures/fuckedtube/3.html b/test/fixtures/fuckedtube/3.html
new file mode 100644 (file)
index 0000000..b008bdb
--- /dev/null
@@ -0,0 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>A Different Kind Of Breast Exam  | Fucked Tube - porn you shouldnt watch, ever</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Script-Type" content="text/javascript">
+<meta name="Author" content="Fucked Tube">
+<meta name="Description" content="Girl goes into a store and scans her breasts and ass on the photocopier. Lucky day for the store attendant.">
+<meta name="Keywords" content="voyeur porn videos, voyeur sex videos, public upskirt, upskirt in shop, hidden camera porn">
+<meta name="Robots" content="index,follow">
+<link rel="icon" href="http://www.fuckedtube.com/favicon.ico" type="image/x-icon">
+<link rel="shortcut icon" href="http://www.fuckedtube.com/favicon.ico" type="image/x-icon">
+<link href="http://www.fuckedtube.com/css.css" rel="stylesheet" type="text/css">
+<script src="http://www.fuckedtube.com/addbookmark.js" type="text/javascript"></script>
+</head>
+<body>
+<div id="container">
+<div id="header">
+  <div class="headerLogo1"><a href="http://www.fuckedtube.com/" title="Return to the homepage"><img src="http://www.fuckedtube.com/images/logo_title.png" alt="Welcome to the internets most fucked up porn tube" width="458" height="101"></a></div>
+</div>
+<div id="menu">
+  <div class="menuButton1">
+    <div class="menuLink"></div>
+  </div>
+  <div class="menuButton2">
+    <div class="menuLink" id="addBookmarkContainer"></div>
+  </div>
+  <div class="menuButton3">
+    <div class="menuLink"><a href="http://www.fuckedtube.com/" title="Return to the homepage">Home</a></div>
+  </div>
+</div>
+<div class="colMask threeCol">
+<div class="colMid">
+<div class="colLeft">
+<div class="col1">
+  <div id="main">
+    <h1 class="mainTitle">A Different Kind Of Breast Exam</h1>
+    <a href="http://www.mate1.com/rd/856/362443/?AFFID=8518" title="FREE Signup!" rel="nofollow" target="_blank"><img src="http://crtv.mate1.com/ad/856/385081/21886/" width="468" height="60" alt="FREE Signup!"></a>
+    <div class="videoBox"><object type="application/x-shockwave-flash" data="http://www.fuckedtube.com/player.swf?movie=scan.flv&amp;bgcolor=0x051615&amp;fgcolor=0x13ABEC&amp;volume=80&amp;autoplay=off&amp;autoload=on&amp;loop=off&amp;clickurl=&amp;clicktarget=" width="468" height="391" id="flvPlayer"><param name="movie" value="http://www.fuckedtube.com/player.swf?movie=scan.flv&amp;bgcolor=0x051615&amp;fgcolor=0x13ABEC&amp;volume=80&amp;autoplay=off&amp;autoload=on&amp;loop=off&amp;clickurl=&amp;clicktarget="></object><br>
+      <p>[<b>Humorous</b>] Girl goes into a store and scans her breasts and ass on the photocopier. Lucky day for the store attendant.</p>
+      <br>
+            <input type="text" size="74" value="http://www.fuckedtube.com/video/3/A-Different-Kind-Of-Breast-Exam/">
+    </div>
+  </div>
+</div>
+
+<div class="col2">
+  <h3 class="mainTitle">Our Porn Friends</h3>
+  <div class="partnerDivLeft">
+  <ul>
+        <li><a href="http://www.dumpz.net" title="Porn Tube" onClick="window.open('/outcounter.php?type=trade&amp;id=36'); return false;" target="_blank">Porn Tube</a></li>
+        <li><a href="http://www.shooshtime.com" title="ShooshTime" onClick="window.open('/outcounter.php?type=trade&amp;id=95'); return false;" target="_blank">ShooshTime</a></li>
+        <li><a href="http://www.matureporndump.com" title="Mature Porn Dump" onClick="window.open('/outcounter.php?type=trade&amp;id=109'); return false;" target="_blank">Mature Porn Dump</a></li>
+        <li><a href="http://www.porndirectory.com/cgi-bin/topvlog.cgi?1217675087" title="Porn Directory" onClick="window.open('/outcounter.php?type=trade&amp;id=87'); return false;" target="_blank">Porn Directory</a></li>
+        <li><a href="http://www.porn2.com" title="Porn Videos" onClick="window.open('/outcounter.php?type=trade&amp;id=100'); return false;" target="_blank">Porn Videos</a></li>
+        <li><a href="http://www.fuckingfunnyshit.com" title="Funny Porn" onClick="window.open('/outcounter.php?type=trade&amp;id=94'); return false;" target="_blank">Funny Porn</a></li>
+        <li><a href="http://gggvideoshop.com/" title="GGG 666 Bukkake Vids" onClick="window.open('/outcounter.php?type=trade&amp;id=130'); return false;" target="_blank">GGG 666 Bukkake Vids</a></li>
+        <li><a href="http://www.idozed.com" title="Home Porno Videos" onClick="window.open('/outcounter.php?type=trade&amp;id=108'); return false;" target="_blank">Home Porno Videos</a></li>
+        <li><a href="http://www.toppornpictures.com" title="Free Porn" onClick="window.open('/outcounter.php?type=trade&amp;id=102'); return false;" target="_blank">Free Porn</a></li>
+        <li><a href="http://www.allpornmodels.com/top-rated-porn-site-reviews.php" title="Porn Site Reviews" onClick="window.open('/outcounter.php?type=trade&amp;id=113'); return false;" target="_blank">Porn Site Reviews</a></li>
+        <li><a href="http://www.sexyplugs.com" title="Teen Sex" onClick="window.open('/outcounter.php?type=trade&amp;id=110'); return false;" target="_blank">Teen Sex</a></li>
+        <li><a href="http://www.pornolimits.com" title="Porn" onClick="window.open('/outcounter.php?type=trade&amp;id=112'); return false;" target="_blank">Porn</a></li>
+        <li><a href="http://www.lustspiel.org/" title="Hardcore Porno" onClick="window.open('/outcounter.php?type=trade&amp;id=131'); return false;" target="_blank">Hardcore Porno</a></li>
+      </ul>
+  </div>
+  <div class="adDivLeft">
+    <script type="text/javascript" src="http://cluster3.adultadworld.com/roturl.js"></script>
+    <script type="text/javascript">displayBan('8518', '~/banners/1/1/160x600', 'gNcdv%2fmwhskVxLi%2bQNJhAfgJYFlJTJ%2f9Tq73nMQwXjD5hfENhjycy20jEkk2AD5ou6Te83wPL3frPJeCmVGhg4oHKN8CRt9iB1uakjicdqQ%3d');</script>
+  </div>
+  <h3 class="mainTitle">More Great Sites</h3>
+  <div class="partnerDivLeft">
+  <ul>
+      </ul>
+  </div>
+</div>
+<div class="col3">
+  <h3 class="mainTitle">Video Categories</h3>
+  <ul>
+    <li>
+      <h2><a href="http://www.fuckedtube.com/" title="New porn videos" rel="nofollow">Latest videos</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Bizarre/" title="Bizarre porn videos">Bizarre porn</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Plugged/" title="Plugged porn videos">Plugged porn</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Violent/" title="Violent porn videos">Violent porn</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Grotesque/" title="Grotesque porn videos">Grotesque porn</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Humorous/" title="Humorous porn videos">Humorous porn</a></h2>
+    </li>
+        <li>
+      <h2><a href="http://www.fuckedtube.com/cat/Objects/" title="Objects porn videos">Objects porn</a></h2>
+    </li>
+      </ul>
+  <h3 class="mainTitle">Random Videos</h3>
+  <ul>
+        <li><a href="http://www.fuckedtube.com/video/155/Absexing/" title="Absexing"><img src="http://www.fuckedtube.com/thumbs/th_extremesex.jpg" width="130" height="97" alt="Absexing"></a></li>
+        <li><a href="http://www.fuckedtube.com/video/151/Creepy-Old-Fondler/" title="Creepy Old Fondler"><img src="http://www.fuckedtube.com/thumbs/th_seedysex.jpg" width="130" height="97" alt="Creepy Old Fondler"></a></li>
+        <li><a href="http://www.fuckedtube.com/video/137/Quick-And-Dark-Anal-Ravaging/" title="Quick And Dark Anal Ravaging"><img src="http://www.fuckedtube.com/thumbs/th_takeiteasy.jpg" width="130" height="97" alt="Quick And Dark Anal Ravaging"></a></li>
+        <li><a href="http://www.fuckedtube.com/video/141/Stumped-About-Anal/" title="Stumped About Anal"><img src="http://www.fuckedtube.com/thumbs/th_stumped.jpg" width="130" height="97" alt="Stumped About Anal"></a></li>
+      </ul>
+  <div class="adDiv"><a href="http://www.mate1.com/rd/856/362443/?AFFID=8518" title="FREE Signup!" rel="nofollow" target="_blank"><img src="http://crtv.mate1.com/ad/856/385078/21883/" alt="Signup FREE!"></a></div>
+</div>
+</div>
+</div>
+</div>
+<div id="footer">
+  <div class="footerIQ69"><a href="http://iq69.com/cheaters/" title="IQ69 Cheaters List" rel="nofollow" target="_blank"><img src="http://iq69.com/cheaters/iq697.gif" alt="IQ69 Cheaters List"></a></div>
+  <div class="footerTP">
+  </div>
+  <div class="footerCopyright">&copy; 2009 <a href="mailto:contact@fuckedtube.com" title="Email Fucked Tube" rel="nofollow" target="_blank">FuckedTube</a><br>
+        Generated by BadCMS in 0.0053 seconds </div>
+  <div class="footerW3C"><a href="http://validator.w3.org/check?uri=referer" title="Valid HTML 4.01 Transitional" rel="nofollow" target="_blank"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" width="88" height="31"></a><a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS" rel="nofollow" target="_blank"><img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS" width="88" height="31"></a></div>
+</div>
+<div class="headerLogo2"><a href="http://www.fuckedtube.com/" title="Fucked Tube nasty videos, bizarre porn, fucked porn" rel="nofollow"><img src="http://www.fuckedtube.com/images/logo_tv.png" alt="Fucked Tube nasty videos, bizarre porn, fucked porn" width="274" height="214"></a></div>
+</div>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("UA-2844044-1");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+</body>
+</html>
diff --git a/test/fuckedtube_remote_test.rb b/test/fuckedtube_remote_test.rb
new file mode 100644 (file)
index 0000000..eeca066
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Copyright Michael Orlitzky
+#
+# http://michael.orlitzky.com/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# http://www.fsf.org/licensing/licenses/gpl.html
+#
+
+require 'test/unit'
+require 'src/websites/fuckedtube'
+
+
+class FuckedtubeRemoteTest < Test::Unit::TestCase
+
+  def test_get_video_filename_works_on_good_urls
+    ft = Fuckedtube.new('http://www.fuckedtube.com/video/161/Pumped-Pussy/')
+    expected_filename = 'br_pumpedpussy.flv'
+    actual_filename = ft.get_video_filename()
+    assert_equal(expected_filename, actual_filename)
+  end
+
+end
diff --git a/test/fuckedtube_test.rb b/test/fuckedtube_test.rb
new file mode 100644 (file)
index 0000000..21d4319
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright Michael Orlitzky
+#
+# http://michael.orlitzky.com/
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# http://www.fsf.org/licensing/licenses/gpl.html
+#
+
+require 'test/unit'
+require 'src/websites/fuckedtube'
+
+
+class FuckedtubeTest < Test::Unit::TestCase
+
+  def test_owns_fuckedtube_urls
+    assert(Fuckedtube.owns_url?('http://www.fuckedtube.com/video/161/Pumped-Pussy/'))
+    assert(Fuckedtube.owns_url?('http://www.fuckedtube.com/video/152/Hits-From-The-Pong'))
+    assert(Fuckedtube.owns_url?('http://www.fuckedtube.com/video/143/Hot-n-Spicy-Jizz/'))
+    assert(Fuckedtube.owns_url?('http://www.fuckedtube.com/video/4/I-Spy-A-Cervix'))
+  end
+
+  
+  def test_doesnt_own_infoq_urls
+    assert(!Fuckedtube.owns_url?('http://www.infoq.com/interviews/jim-weirich-discusses-rake'))
+  end
+
+  
+  def test_doesnt_own_efukt_urls
+    assert(!Fuckedtube.owns_url?('http://www.efukt.com/2308_How_To_Fuck_Like_A_King.html'))
+    assert(!Fuckedtube.owns_url?('http://www.efukt.com/2304_The_Dumbest_Porno_Ever_Made.html'))
+  end  
+
+  
+  def test_parse_video_url
+    ft = Fuckedtube.new(nil)
+    
+    page_data = nil
+    
+    File.open('test/fixtures/fuckedtube/3.html') do |f|
+      page_data = f.read
+    end
+    
+    test_result = ft.send('parse_video_url', page_data)
+    assert_equal('http://www.fuckedtube.com/videos/br_scan.flv', test_result)
+  end
+
+end
index 46c75a5f306711fba71145ea87b7f1d553c56714..5068cf1dea4e1fcae16267d1802a2a09667830c6 100644 (file)
@@ -16,6 +16,7 @@
 # http://www.fsf.org/licensing/licenses/gpl.html
 #
 
+require 'test/fuckedtube_remote_test'
 require 'test/infoq_remote_test'
 require 'test/uri_utilities_remote_test'
 require 'test/youporn_remote_test'
index 41f1f8c9c57818762d308c46f94147fc5def2954..a1a43905333707ec7e68294c9fb3212c705c10be 100644 (file)
@@ -17,6 +17,7 @@
 #
 
 require 'test/efukt_test'
+require 'test/fuckedtube_test'
 require 'test/howcast_test'
 require 'test/infoq_test'
 require 'test/redtube_test'