<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marius van Witzenburg &#187; Download</title>
	<atom:link href="http://mariusvw.com/tag/download/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusvw.com</link>
	<description>We fight for our survival, we fight!</description>
	<lastBuildDate>Tue, 27 Dec 2011 10:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to download sexdumpert.nl photo&#8217;s or video&#8217;s with a simple Bash script</title>
		<link>http://mariusvw.com/2011/07/17/how-to-download-sexdumpert-nl-photos-or-videos-with-a-simple-bash-script/</link>
		<comments>http://mariusvw.com/2011/07/17/how-to-download-sexdumpert-nl-photos-or-videos-with-a-simple-bash-script/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 13:38:53 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Dumpert]]></category>
		<category><![CDATA[Movie]]></category>
		<category><![CDATA[Photo]]></category>
		<category><![CDATA[Porn]]></category>
		<category><![CDATA[Sex]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=235</guid>
		<description><![CDATA[Here is the simple script which downloads all photos from sexdumpert.nl Just save the file as run.sh in a directory and run it. It will save all photos found. #!/bin/bash &#160; if &#91; ! -d 'files' &#93; then mkdir files fi &#160; for &#40;&#40;a = 0; a &#60;= 999; a++&#41;&#41; do ca=`printf &#34;%03d&#34; $a` for [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the simple script which downloads all photos from sexdumpert.nl</p>
<p>Just save the file as run.sh in a directory and run it. It will save all photos found.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'files'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> files
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>a = <span style="color: #000000;">0</span>; a <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; a++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">ca</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$a</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>b = <span style="color: #000000;">0</span>; b <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; b++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">cb</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$b</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>c = <span style="color: #000000;">0</span>; c <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; <span style="color: #c20cb9; font-weight: bold;">c++</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #000000; font-weight: bold;">do</span>      
            <span style="color: #007800;">cc</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$c</span><span style="color: #000000; font-weight: bold;">`</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>d = <span style="color: #000000;">0</span>; d <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; d++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">do</span>      
                <span style="color: #007800;">cd</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
                <span style="color: #007800;">url</span>=<span style="color: #ff0000;">&quot;http://mediadata.sexdumpert.nl/<span style="color: #007800;">$ca</span>/<span style="color: #007800;">$cb</span>/<span style="color: #007800;">$cc</span>/<span style="color: #007800;">$cd</span>.jpg&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$url</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #007800;">$url</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;files/<span style="color: #007800;">$ca</span>-<span style="color: #007800;">$cb</span>-<span style="color: #007800;">$cc</span>-<span style="color: #007800;">$cd</span>.flv&quot;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">done</span>    
        <span style="color: #000000; font-weight: bold;">done</span>    
    <span style="color: #000000; font-weight: bold;">done</span>    
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Here is the simple script which downloads all video's from sexdumpert.nl</p>
<p>Just save the file as run.sh in a directory and run it. It will save all video's found.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'files'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> files
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>a = <span style="color: #000000;">0</span>; a <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; a++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">ca</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$a</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>b = <span style="color: #000000;">0</span>; b <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; b++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">cb</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$b</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>c = <span style="color: #000000;">0</span>; c <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; <span style="color: #c20cb9; font-weight: bold;">c++</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #000000; font-weight: bold;">do</span>      
            <span style="color: #007800;">cc</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$c</span><span style="color: #000000; font-weight: bold;">`</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>d = <span style="color: #000000;">0</span>; d <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">999</span>; d++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">do</span>      
                <span style="color: #007800;">cd</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%03d&quot;</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
                <span style="color: #007800;">url</span>=<span style="color: #ff0000;">&quot;http://mediadata.sexdumpert.nl/<span style="color: #007800;">$ca</span>/<span style="color: #007800;">$cb</span>/<span style="color: #007800;">$cc</span>/<span style="color: #007800;">$cd</span>.flv&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$url</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #007800;">$url</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;files/<span style="color: #007800;">$ca</span>-<span style="color: #007800;">$cb</span>-<span style="color: #007800;">$cc</span>-<span style="color: #007800;">$cd</span>.flv&quot;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">done</span>    
        <span style="color: #000000; font-weight: bold;">done</span>    
    <span style="color: #000000; font-weight: bold;">done</span>    
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Hope this for fills some people their needs <img src='http://mariusvw.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2011/07/17/how-to-download-sexdumpert-nl-photos-or-videos-with-a-simple-bash-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to download a range of files with Curl and Bash</title>
		<link>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/</link>
		<comments>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 18:09:09 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Curl]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Range]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=319</guid>
		<description><![CDATA[This is a really simple sniped how to download a range of files. I found this very useful to download an image range of my old avatar script. I lost my images but remembered an url where I uploaded them once. Happy me 1 2 3 4 5 6 7 #!/usr/local/bin/bash &#160; # Range 1 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a really simple sniped how to download a range of files.</p>
<p>I found this very useful to download an image range of my old avatar script.<br />
I lost my images but remembered an url where I uploaded them once. Happy me <img src='http://mariusvw.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/local/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Range 1 to 75</span>
<span style="color: #000000; font-weight: bold;">for</span> x <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>..<span style="color: #000000;">75</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">do</span>
    curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>my.server.com<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>images_<span style="color: #800000;">${x}</span>.jpg
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2011/06/14/how-to-download-a-range-of-files-with-curl-and-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download Redtube movies with a simple PHP class</title>
		<link>http://mariusvw.com/2011/06/14/download-redtube-movies-with-a-simple-php-class/</link>
		<comments>http://mariusvw.com/2011/06/14/download-redtube-movies-with-a-simple-php-class/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 11:52:07 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Movies]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Porn]]></category>
		<category><![CDATA[Redtube]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=227</guid>
		<description><![CDATA[For donations I build everything... Simply put this file on a server where you want and start downloading class RedTube &#123; function form&#40;&#41; &#123; echo '&#60;form method=&#34;post&#34;&#62;&#60;input type=&#34;text&#34; name=&#34;url&#34;&#62;&#60;input type=&#34;submit&#34;&#62;&#60;/form&#62;'; &#125; &#160; function download&#40;$url = null&#41; &#123; if &#40;$this-&#62;validate&#40;$url&#41;&#41; &#123; $content = $this-&#62;fetch&#40;$url&#41;; &#160; preg_match&#40;'#&#60;h1 class=&#34;videoTitle&#34;&#62;(.*)&#60;/h1&#62;#', $content, $d1&#41;; //preg_match('#&#60;source src=\'(.*)\' type=\\\&#34;video/mp4\\\&#34;&#62;#', $content, $d2); preg_match&#40;'#&#60;source src=\'(.*)\' [...]]]></description>
			<content:encoded><![CDATA[<p>For donations I build everything...</p>
<p>Simply put this file on a server where you want and start downloading <img src='http://mariusvw.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> RedTube <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> form<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;form method=&quot;post&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;/form&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> download<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#&lt;h1 class=&quot;videoTitle&quot;&gt;(.*)&lt;/h1&gt;#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$d1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//preg_match('#&lt;source src=\'(.*)\' type=\\\&quot;video/mp4\\\&quot;&gt;#', $content, $d2);</span>
            <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#&lt;source src=\'(.*)\' type=\'video/mp4\'&gt;#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$d2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: application/octet-stream&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition: attachment; filename=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">addslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.mp4'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>       
        <span style="color: #009900;">&#125;</span>       
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> validate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#^http://(www.)?redtube.com/[0-9]+$#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>       
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> fetch<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$stream</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span> 
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$stream</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">echo</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>       
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$buffer</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>       
            <span style="color: #009900;">&#125;</span>       
            <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>       
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$rt</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RedTube<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$rt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">download</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$rt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2011/06/14/download-redtube-movies-with-a-simple-php-class/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

