SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Urgent Help On Curl

    hi everyone i have this problem which i cannot get the right link to download it seems encoded when i use the curl when i click on the website link to go in i can download the file can anyone slove this ? is this something to do with the useragent ? And can i know how do i make it download manually into the serverit self ? from tube8 ?

    please advise thanks in advanced
    PHP Code:
    $userAgent ='# IE 6 - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)';
    $url "http://www.tube8.com/hardcore/hot-girl-****ed-by-two-cocks/164977/";
    $ch curl_init();    // initialize curl handle
    curl_setopt($chCURLOPT_URL,$url); // set url to post to
    curl_setopt($chCURLOPT_USERAGENT$userAgent);
    curl_setopt($chCURLOPT_FAILONERROR1);
    //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
    //curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
    curl_setopt($chCURLOPT_TIMEOUT3); // times out after 4s
    //curl_setopt($ch, CURLOPT_POST, 1); // set POST method
    //curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL"); // add POST fields
    $result curl_exec($ch); // run the whole process
    curl_close($ch); 
    echo 
    $result
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Dig that url, you've got some balls boy.

    Are we supposed to go and "test" it for you?

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    *looks over shoulder for the wife*

    One link requires authentication and the other is for a .3gp version, which do you require?

    PHP Code:
    <?php
    $oXPath 
    = new DOMXPath(@DOMDocument::loadHTMLFile('http://www.tube8.com/hardcore/hot-girl-****ed-by-two-cocks/164977/'));
    if(
    $oNodes $oXPath->query("//a[contains(@href, '.3gp')]"))
    {
        echo 
    $oNodes->item(0)->getAttribute('href');
    }
    ?>
    He he. "o no he dit-ten"
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    *looks over shoulder for the wife*

    One link requires authentication and the other is for a .3gp version, which do you require?

    PHP Code:
    <?php
    $oXPath 
    = new DOMXPath(@DOMDocument::loadHTMLFile('http://www.tube8.com/hardcore/hot-girl-****ed-by-two-cocks/164977/'));
    if(
    $oNodes $oXPath->query("//a[contains(@href, '.3gp')]"))
    {
        echo 
    $oNodes->item(0)->getAttribute('href');
    }
    ?>
    He he. "o no he dit-ten"

    erm i only need the flv path which is the real one
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I've provided the code you require, barring a little modification.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i tried this but its not working

    $oXPath = new DOMXPath(@DOMDocument::loadHTMLFile('http://www.tube8.com/hardcore/hot-girl-****ed-by-two-cocks/164977/'));
    if($oNodes = $oXPath->query("//a[contains(@videoURL, '.flv')]"))
    {
    echo $oNodes->item(0)->getAttribute('videoURL');
    }
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com

  7. #7
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got this error
    Fatal error: Call to a member function getAttribute() on a non-object in /home/sgreno0/public_html/mydownload2/test.php on line 70
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com

  8. #8
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    That's because the flv source is written dynamically with Javascript, I've gone as far as I'm prepared to go to be honest.

    This isn't your content, I provided the code to acquire the 3gp as the publisher clearly allows direct access to this file.

    Thanks,

    Anthony.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  9. #9
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    That's because the flv source is written dynamically with Javascript, I've gone as far as I'm prepared to go to be honest.

    This isn't your content, I provided the code to acquire the 3gp as the publisher clearly allows direct access to this file.

    Thanks,

    Anthony.
    ok thanks but is there any functions for the dom ? where can i get reference ?
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com

  10. #10
    SitePoint Enthusiast baddot's Avatar
    Join Date
    Nov 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i tried very hard but i still cannot get the flvs? why is that so ? why i kept getting
    403 - Forbidden

    isit being encoded or something ?

    http://media10.tube8.com/flv/ed6da54...f4b48a402c.flv

    Grabbed from my script

    But with the origial website i can download using the link
    http://media08.tube8.com/flv/493b81b...c24c91613e.flv
    can anyone please help me
    Make Friends And Earn Money @ Zonity.com
    Make Money at BadDot.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •