]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/commitdiff
Added support for a second filename pattern to the Efukt class.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 30 Aug 2009 02:47:10 +0000 (22:47 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 30 Aug 2009 02:47:10 +0000 (22:47 -0400)
Created a fixture and a test case for the new pattern.

src/websites/efukt.rb
test/efukt_test.rb
test/fixtures/efukt/1592_Riding_Bear_Back.html [new file with mode: 0644]

index 27d20992927dc57cba00b3846611a677e7dedab5..38b5913e0da242daabd80d2fc9b765972072667f 100644 (file)
@@ -60,11 +60,20 @@ class Efukt < Website
   # 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)
+    # There are two formats; try them both one at a time.
     video_url_regex = /&file=(http:\/\/.*\.flv)&/i
     matches = video_url_regex.match(page_data)
 
+    if not (matches.nil? || matches.length < 2)
+      return matches[1]
+    end
+
+    # If we didn't return a match already, try the second format.
+    video_url_regex = /<param name='fileName' value="(.*?)"/i
+    matches = video_url_regex.match(page_data)
+
     if (matches.nil? || matches.length < 2)
-      raise StandardError.new('Could not find the "file" flash variable on the page.');
+      raise StandardError.new('Could not find the "file" Flash variable, nor the "fileName" object parameter.');
     end
     
     return matches[1]
index 33b1bf2cca0a73b98d6458cc24be4a25905ce7db..b90c9863708a25192f984ac5dd605165f3427582 100644 (file)
@@ -64,6 +64,17 @@ class EfuktTest < Test::Unit::TestCase
     
     test_result = ef.send('parse_video_url', page_data)
     assert_equal('http://64.62.222.195/video/370c4a4662071261ccd5b833c4d83201/4918d88d/63563562.flv', test_result)
+
+    # There are two different filename patterns.
+    # This tests the second one. No, there aren't
+    # any non-embarrasing videos on eFukt that I could
+    # use for fixtures.
+    File.open('test/fixtures/efukt/1592_Riding_Bear_Back.html') do |f|
+      page_data = f.read
+    end
+    
+    test_result = ef.send('parse_video_url', page_data)
+    assert_equal('http://74.82.53.202/video/798309ad4e6b598204aae617bbdf3090/4a99e23f/158.wmv', test_result)
   end
 
 end
diff --git a/test/fixtures/efukt/1592_Riding_Bear_Back.html b/test/fixtures/efukt/1592_Riding_Bear_Back.html
new file mode 100644 (file)
index 0000000..1a85514
--- /dev/null
@@ -0,0 +1,246 @@
+\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+<title>eFukt.com - porn you wish you never saw  - Riding Bear Back</title>\r
+<link rel="stylesheet" href="/main.css" />\r
+<link rel="stylesheet" href="/inner.css" />\r
+<link rel="meta" href="http://www.efukt.com/labels.rdf" type="application/rdf+xml" title="ICRA labels" /> <meta http-equiv="pics-Label" content='(pics-1.1 "http://www.icra.org/pics/vocabularyv03/" l gen true for "http://efukt.com" r (n 2 s 2 v 0 l 2 oa 1 ob 1 oc 1 od 0 oe 0 of 1 og 1 oh 0 c 3) gen true for "http://www.efukt.com" r (n 2 s 2 v 0 l 2 oa 1 ob 1 oc 1 od 0 oe 0 of 1 og 1 oh 0 c 3))' />\r
+<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />\r
+\r
+        </head>\r
+\r
+<body >\r
+
+<script language="javascript">
+var puShown = false;
+
+        function doOpen(url)
+        {
+                if ( puShown == true )
+                {
+                        return true;
+                }
+
+                win = window.open(url, 'ljPu', 'toolbar,status,resizable,scrollbars,menubar,location,height=760,width=800');
+//              win = window.open(url, 'ljPu', 'height=680,width=790');
+                if ( win )
+                {
+                        win.blur();
+                        puShown = true;
+                }
+                return win;
+        }
+        
+        
+        function setCookie(name, value, time)
+        {
+               var expires = new Date();
+               
+               expires.setTime( expires.getTime() + time );
+               
+               document.cookie = name + '=' + value + '; expires=' + expires.toGMTString();
+        }
+        
+        
+        function getCookie(name) {
+               var cookies = document.cookie.toString().split('; ');
+               var cookie, c_name, c_value;
+               
+               for (var n=0; n<cookies.length; n++) {
+                       cookie  = cookies[n].split('=');
+                       c_name  = cookie[0];
+                       c_value = cookie[1];
+                       
+                       if ( c_name == name ) {
+                               return c_value;
+                       }
+               }
+               
+               return null;
+        }
+
+
+        function initPu()
+        {
+                       if ( document.attachEvent )
+                       {
+                               document.attachEvent( 'onclick', checkTarget );
+                       }
+                       else if ( document.addEventListener )
+                       {
+                               document.addEventListener( 'click', checkTarget, false );
+                       }
+        }
+
+
+        function checkTarget(e)
+        {
+               if ( !getCookie('popundr') ) {
+                var e = e || window.event;
+                var win = doOpen('http://promo.awempire.com/tr/?id=29');
+                       
+                       setCookie('popundr', 1, 24*60*60*1000);
+               }
+        }
+
+initPu();
+</script>
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+</script>
+<script type="text/javascript">
+_uacct = "UA-405365-1";
+urchinTracker();
+</script>
+
+\r
+<script language="javascript" type="text/javascript" src="favorites.js"></script>\r
+\r
+<!-- Movie Switch AJAX Function -->\r
+<script language="javascript" type="text/javascript" src="js/movieSwitch.js"></script>\r
+\r
+       <div id="container">\r
+               <div id="innerContainer" style="width:790px">\r
+                <div id="age">THIS SITE IS STRICTLY FOR ADULTS. IF YOU ARE NOT 18 THEN GET THE FUCK OUT!</div>\r
+<div id="header"><div id="header_menu"><a class="header_menu" href="http://www.efukt.com">HOME</a> | <a class="header_menu" href="http://www.efukt.com/search/">VIDEOS</a> | <a class="header_menu" href="http://www.efukt.com/pics/">PICTURES</a> | <a class="header_menu" href="/contact.php">CONTACT</a> | <a class="header_menu" href="http://www.efukt.com/submit/">SUBMIT</a> | <a class="header_menu" href="http://www.efukt.net/">FORUMS</a></div></div>
+            <div id="leftColumn">\r
+               <div id="columnHeader">\r
+                       <h2>DATING</h2>\r
+                </div>\r
+                <div id="content" align="center">\r
+               <table border="0" cellspacing="1" width="100%" cellpadding="3">\r
+<tr>\r
+<td align="center">\r
+<a target="_blank" href="http://www.fuckbookdating.com/?t=bookefuk">\r
+<img src="http://www.efukt.com/out/fuckbook.jpg" border="0"></a></td>\r
+</tr>\r
+</table>                     </div>\r
+               <div id="columnHeader">\r
+                       <h2>WTF</h2>\r
+                </div>\r
+                <div id="content" align="center">\r
+               <iframe id='a3515d19' name='a3515d19' src='http://ads.crakmedia.com/www/delivery/afr.php?zoneid=184&amp;cb=INSERT_RANDOM_NUMBER_HERE' framespacing='0' frameborder='no' scrolling='no' width='140' height='600'><a href='http://ads.crakmedia.com/www/delivery/ck.php?n=aeb20761&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.crakmedia.com/www/delivery/avw.php?zoneid=184&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aeb20761' border='0' alt='' /></a></iframe>                </div>\r
+              </div>\r
+            <div id="middleColumn">\r
+\r
+\r
+               <!-- HEAD BANNER -->\r
+                               <div style="padding:5px;" align="center">               <div align="center">\r
+                        <table border="0" width="100%" cellpadding="0">\r
+                <tr>\r
+                  <td align="center" colspan="4"><font face="Courier New" style="font-size: 20pt"><b><a target="_blank" href="http://www.dancingbear.com/t1/pps=destray"><font face="Arial" style="font-size: 15pt" color="#000000">MOLESTED BY MALE STRIPPERS</font></a></b></font></td>\r
+                </tr>\r
+<tr>\r
+                  <td align="center"><a target="_blank" href="http://www.dancingbear.com/t1/pps=destray"> <img height="96" alt="" src="http://www.efukt.com/images/db/1.jpg" width="135" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.dancingbear.com/t1/pps=destray"> <img height="96" alt="" src="http://www.efukt.com/images/db/2.jpg" width="135" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.dancingbear.com/t1/pps=destray"> <img height="96" alt="" src="http://www.efukt.com/images/db/3.jpg" width="135" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.dancingbear.com/t1/pps=destray"> <img height="96" alt="" src="http://www.efukt.com/images/db/4.jpg" width="135" border="1"></a></td>\r
+                </tr>\r
+</table>\r
+</div></div>\r
+\r
+       <div style="width:550px;padding-left:12px;margin-top:-5px;" align="center">\r
+                <h1><div id="movie_title" style="margin-bottom:-15px;font-size:24px;">"Riding Bear Back"</div></h1>\r
+               <div style="width:525;font-size:17px;padding-top:6px;padding-bottom:15px;">This is probally the most fucked up thing I'll ever post here. This shit is fucking lame...</div>\r
+       <div>   <OBJECT id='mediaPlayer' width="398" height="370"\r
+                                        classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'\r
+                                        codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'\r
+                                        standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>\r
+                                <param name='fileName' value="http://74.82.53.202/video/798309ad4e6b598204aae617bbdf3090/4a99e23f/158.wmv">\r
+                                <param name='animationatStart' value='true'>\r
+                                <param name='transparentatStart' value='true'>\r
+                                <param name='autoStart' value="false">\r
+                                <param name='showControls' value="true">\r
+                                <param name='loop' value="false">\r
+                                <param name='showstatusbar' value="true">\r
+                                <EMBED type='application/x-mplayer2'\r
+                                pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'\r
+                                id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'\r
+                                bgcolor='darkblue' showcontrols="false" showtracker='-1'\r
+                                showdisplay='0' showstatusbar='1' videoborder3d='-1' width="398" height="370"\r
+                                src="http://74.82.53.202/video/798309ad4e6b598204aae617bbdf3090/4a99e23f/158.wmv" autostart="false" designtimesp='5311' loop="false">                                </EMBED>\r
+                                </OBJECT><!-- <div id="location"><div id="loc_prev"><a class="header_menu" href="/view.php?id=1591">Previous</a></div><div id="loc_next"><a class="header_menu" href="/view.php?id=1593">Next</a></div></div>-->\r
+               </div><div style="width:500px;text-align:left;font-size:14px;"><div style="float:right;"><strong>Download: <font color="red">\r
+                       <a href="http://join.efuktpremium.com/track/MjoxMDE6Mjc/join" title="High-Quality AVI" style="color:red"><u>HQ AVI</u></a> &nbsp;\r
+                       <a href="http://join.efuktpremium.com/track/MjoxMDE6Mjc/join" title="High-Quality WMV" style="color:red"><u>HQ WMV</u></a> &nbsp;\r
+                       <a href="http://join.efuktpremium.com/track/MjoxMDE6Mjc/join" title="iPod & PSP Compatible Video" style="color:red"><u>IPOD/PSP</u></a> &nbsp;\r
+                       <a href="http://join.efuktpremium.com/track/MjoxMDE6Mjc/join" style="color:red"><u>Normal</u></a></strong></font></div>\r
+                       <strong>Watch: </strong><a href="http://join.efuktpremium.com/track/MjoxMDE6Mjc/join" title="High Definition" style="color:red"><strong><u>High Definition</u></strong></a></div><br />         </div>\r
+                <!-- RANDOM VIDEO -->\r
+                <div id="random_header">------------------------------------- RANDOM VIDS -------------------------------------</div>\r
+<div id="random_content"><a class="bodylink" href="http://www.efukt.com/2438_Stump_Grinder.html"><img height="90" src="http://74.82.53.202/media/video_thumb/785068688.jpg" width="90" border="1" alt="Stump Grinder"></a>
+<a class="bodylink" href="http://www.efukt.com/1768_Sexual_Telekinesis.html"><img height="90" src="http://74.82.53.202/media/video_thumb/4566.jpg" width="90" border="1" alt="Sexual Telekinesis"></a>
+<a class="bodylink" href="http://www.efukt.com/20462_Orgasm_Renders_Wife_Unconscious.html"><img height="90" src="http://74.82.53.202/media/video_thumb/9496962996.jpg" width="90" border="1" alt="Orgasm Renders Wife Unconscious"></a>
+<a class="bodylink" href="http://www.efukt.com/2265_This_Hooker_Hates_Anal_Sex.html"><img height="90" src="http://74.82.53.202/media/video_thumb/76786.jpg" width="90" border="1" alt="This Hooker Hates Anal Sex"></a>
+<a class="bodylink" href="http://www.efukt.com/1936_Fucked_Up_Gameshow.html"><img height="90" src="http://74.82.53.202/media/video_thumb/6605.jpg" width="90" border="1" alt="Fucked Up Gameshow"></a>
+<a class="bodylink" href="http://www.efukt.com/2447_LOL_I_Made_My_Wife_Prolapse.html"><img height="90" src="http://74.82.53.202/media/video_thumb/5477777333.jpg" width="90" border="1" alt="LOL I Made My Wife Prolapse"></a>
+<br /><a class="bodylink" href="http://www.efukt.com/1623_Alice_In_Wonderland_2.html"><img height="90" src="http://74.82.53.202/media/video_thumb/774.jpg" width="90" border="1" alt="Alice In Wonderland 2"></a>
+<a class="bodylink" href="http://www.efukt.com/1827_Masterbation_Lessons.html"><img height="90" src="http://74.82.53.202/media/video_thumb/0441.jpg" width="90" border="1" alt="Masterbation Lessons"></a>
+<a class="bodylink" href="http://www.efukt.com/2126_Fucked_Up_Gameshow_7.html"><img height="90" src="http://74.82.53.202/media/video_thumb/66000.jpg" width="90" border="1" alt="Fucked Up Gameshow 7"></a>
+<a class="bodylink" href="http://www.efukt.com/2043_Entire_Dress_Inserted_Into_Vagina.html"><img height="90" src="http://74.82.53.202/media/video_thumb/45.jpg" width="90" border="1" alt="Entire Dress Inserted Into Vagina"></a>
+<a class="bodylink" href="http://www.efukt.com/2260_Search_Her_Pussy_For_Drugs.html"><img height="90" src="http://74.82.53.202/media/video_thumb/35616.jpg" width="90" border="1" alt="Search Her Pussy For Drugs"></a>
+<a class="bodylink" href="http://www.efukt.com/2198_Pornstar_Attacks_Male_Performer.html"><img height="90" src="http://74.82.53.202/media/video_thumb/775668.jpg" width="90" border="1" alt="Pornstar Attacks Male Performer"></a>
+</div>
+\r
+               <div id="random_header">------------------------------- FUCKED UP FAVORITES -------------------------------</div>
+<div id="random_content"><a class="bodylink" href="http://www.efukt.com/1849_Crazy_Strip_Club_Sex.html"><img height="90" src="http://74.82.53.202/media/video_thumb/8609.jpg" width="90" border="1" alt="Crazy Strip Club Sex"></a>
+<a class="bodylink" href="http://www.efukt.com/2446_Ouch!_It_Hurts!.html"><img height="90" src="http://74.82.53.202/media/video_thumb/647478888.jpg" width="90" border="1" alt="Ouch! It Hurts!"></a>
+<a class="bodylink" href="http://www.efukt.com/1902_Black_Stripper_Party.html"><img height="90" src="http://74.82.53.202/media/video_thumb/4939.jpg" width="90" border="1" alt="Black Stripper Party"></a>
+<a class="bodylink" href="http://www.efukt.com/2349_Is_This_Your_Mom?.html"><img height="90" src="http://74.82.53.202/media/video_thumb/4367895792.jpg" width="90" border="1" alt="Is This Your Mom?"></a>
+<a class="bodylink" href="http://www.efukt.com/1940_Molested_By_Black_Strippers.html"><img height="90" src="http://74.82.53.202/media/video_thumb/005.jpg" width="90" border="1" alt="Molested By Black Strippers"></a>
+<a class="bodylink" href="http://www.efukt.com/2033_Molested_By_Black_Strippers_2.html"><img height="90" src="http://74.82.53.202/media/video_thumb/6891.jpg" width="90" border="1" alt="Molested By Black Strippers 2"></a>
+<br /><a class="bodylink" href="http://www.efukt.com/2286_Deaf_Girl_Still_Wants_To_Be_A_Pornstar.html"><img height="90" src="http://74.82.53.202/media/video_thumb/56632.jpg" width="90" border="1" alt="Deaf Girl Still Wants To Be A Pornstar"></a>
+<a class="bodylink" href="http://www.efukt.com/2045_Stripper_Attacked_By_Granny.html"><img height="90" src="http://74.82.53.202/media/video_thumb/79.jpg" width="90" border="1" alt="Stripper Attacked By Granny"></a>
+<a class="bodylink" href="http://www.efukt.com/2127_Deaf_Girl_Wants_To_Be_A_Pornstar.html"><img height="90" src="http://74.82.53.202/media/video_thumb/60271.jpg" width="90" border="1" alt="Deaf Girl Wants To Be A Pornstar"></a>
+<a class="bodylink" href="http://www.efukt.com/2103_Girls_Should_Never_Go_To_This_Club.html"><img height="90" src="http://74.82.53.202/media/video_thumb/3057.jpg" width="90" border="1" alt="Girls Should Never Go To This Club"></a>
+<a class="bodylink" href="http://www.efukt.com/2314_The_Bilingual_Whore.html"><img height="90" src="http://74.82.53.202/media/video_thumb/6566546.jpg" width="90" border="1" alt="The Bilingual Whore"></a>
+<a class="bodylink" href="http://www.efukt.com/2340_Pornstar_Cant_Stop_Orgasming.html"><img height="90" src="http://74.82.53.202/media/video_thumb/55654646.jpg" width="90" border="1" alt="Pornstar Cant Stop Orgasming"></a>
+<br /></div>
+\r
+               <div align="center">\r
+                        <table border="0" width="100%" cellpadding="0">\r
+<tr>\r
+                  <td align="center"><a target="_blank" href="http://newsfilter.org"> <img height="90" alt="" src="http://www.efukt.com/out/5.jpg" width="90" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.deviantclip.com"> <img height="90" alt="" src="http://www.efukt.com/plugs/ok.gif" width="90" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.extremefuse.com"> <img height="90" alt="" src="http://www.efukt.com/out/4.jpg" width="90" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.m90.org"> <img height="90" alt="" src="http://www.efukt.com/out/2.jpg" width="90" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.kaktuz.com"> <img height="90" alt="" src="http://www.efukt.com/out/3.jpg" width="90" border="1"></a></td>\r
+                  <td align="center"><a target="_blank" href="http://www.wetpussygames.com"> <img height="90" alt="" src="http://www.efukt.com/out/1.jpg" width="90" border="1"></a></td>\r
+                </tr>\r
+<tr>\r
+<td align="center" colspan="6">\r
+<a target="_blank" href="http://www.masterwanker.com">\r
+<img src="http://www.efukt.com/out/play.jpg" border="0"></a></td>\r
+</tr>\r
+<tr>\r
+<td align="center" colspan="6">\r
+<a target="_blank" href="http://www.dancingbear.com/t1/pps=destray">\r
+<img src="http://www.efukt.com/images/db/haha.jpg" border="0"></a></td>\r
+</tr>\r
+</table>\r
+</div>\r
+               </div>\r
+            <div id="breaker"></div>\r
+           </div>\r
+        <div id="footer_enclosure">\r
+                                <div id="footer_content"><table border="0" cellspacing="1" width="100%" cellpadding="3">\r
+<tr>\r
+<td align="center">\r
+<a target="_blank" href="http://www.dancingbear.com/t1/pps=destray">\r
+<img src="http://efukt.com/images/db/big.jpg" border="0"></a></td>\r
+</tr>\r
+</table>       </div>                <div id="footer_content">\r
+                <font color="white">\r
+                <table width="100%" align="center" id="friends"><tr><td width="120px"><a class="footer" target="_blank" href="http://www.dancingbear.com/t1/pps=destray"><b>STRIPPER PORN</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.masterwanker.com">Master Of Pr0n</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.phun.org"><b>Phun</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.entensity.net">Entensity</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.fucd.com"><b>FUCD</b></a></td></tr><tr><td width="120px"><a class="footer" target="_blank" href="http://www.wtfpeople.com"><b>WTF PEOPLE</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.extremefuse.com"><b>FUCKED UP</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.humornsex.com">Humor N' Sex</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.inhumanity.com"><b>EXTREME PORN</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.uselessjunk.com">Useless Junk</a></td></tr><tr><td width="120px"><a class="footer" target="_blank" href="http://www.uniquepeek.com">Unique Peek</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.wetpussygames.com">Porn Games</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.fuckbookdating.com/?t=bookefuk"><b>FACEBOOK XXX</b></a></td><td width="120px"><a class="footer" target="_blank" href="http://www.newsfilter.org">News Filter</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.deviantclip.com">Deviant Clip</a></td></tr><tr><td width="120px"><a class="footer" target="_blank" href="http://www.crazyshit.com/links/in.php?site=1177965264">Crazy Shit</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.kaktuz.com">Kaktuz</a></td><td width="120px"><a class="footer" target="_blank" href="http://emo-porn.com">Emo Porn</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.heaven666.org">Heaven 666</a></td><td width="120px"><a class="footer" target="_blank" href="http://www.youramateurporn.com">Your Amateur Porn</a></td></table>                </font>\r
+                </div>\r
+                <div id="footer_content">\r
+                <a href="/tos/" style="color:white;">Terms Of Service</a> /\r
+                <a href="/privacy/" style="color:white;">Privacy Policy</a> /\r
+                <a href="/rss.php" style="color:white;">RSS</a>\r
+                </div>\r
+        </div>\r
+       </div>\r
+</body>\r
+</html>\r