Page 1 of 2 12 LastLast
Results 1 to 25 of 39

Thread: wget google

  1. #1
    Join Date
    Apr 2005
    Posts
    697

    wget google

    Anybody here know how to use wget within linux to get this link from google?

    PHP Code:
    http://vp.video.google.com/videodownload?version=0&secureurl=tAAAAMM7Pe6fxq34m-dckO2jE0ctIb3TsxAaQpTAQwfLQ-7B3oZS4CxvKAEtGG_17cKnSyqYfNqD8Ui6r-zB6-70dJInlUEHH-tFd299eiDCC70xBionQvW9m-eILudzhw6bL1y7zpr-fHKL2UoeamkrW7kSG622hBYjUP9pZJEiSyxok237-ffF2uvgR_HSKFf79rCdrhPzqgx8x6iW-rsiire_OwQR14BMLpDK6IpsRJ7Tf3vg_uSh2OpG3jS5AY-rVQ&sigh=Id4VMzKKDSqHvTJ0X7Zjoi5UHNU&begin=0&len=388160&docid=5147852388396123647 
    We can download this directly from iexplorer, but not through:
    PHP Code:
    wget http://vp.video.google.com/videodownload?version=0&secureurl=tAAAAMM7Pe6fxq34m-dckO2jE0ctIb3TsxAaQpTAQwfLQ-7B3oZS4CxvKAEtGG_17cKnSyqYfNqD8Ui6r-zB6-70dJInlUEHH-tFd299eiDCC70xBionQvW9m-eILudzhw6bL1y7zpr-fHKL2UoeamkrW7kSG622hBYjUP9pZJEiSyxok237-ffF2uvgR_HSKFf79rCdrhPzqgx8x6iW-rsiire_OwQR14BMLpDK6IpsRJ7Tf3vg_uSh2OpG3jS5AY-rVQ&sigh=Id4VMzKKDSqHvTJ0X7Zjoi5UHNU&begin=0&len=388160&docid=5147852388396123647 
    in linux...

    Please help if you can...

  2. #2
    Join Date
    Apr 2006
    Location
    NJ, USA
    Posts
    258
    What distro are you running?


  3. #3
    Join Date
    Apr 2005
    Posts
    697
    just Centos 4.3...

  4. #4
    Join Date
    Oct 2004
    Location
    San Francisco, CA
    Posts
    2,455
    Probably better here, since you're using wget and not a programming language persay.
    Tyler Cole
    Eeek, a Blog

  5. #5
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,681
    try this instead

    wget "http://vp.video.google.com/videodownload?version=0&secureurl=tAAAAMM7Pe6fxq34m-dckO2jE0ctIb3TsxAaQpTAQwfLQ-7B3oZS4CxvKAEtGG_17cKnSyqYfNqD8Ui6r-zB6-70dJInlUEHH-tFd299eiDCC70xBionQvW9m-eILudzhw6bL1y7zpr-fHKL2UoeamkrW7kSG622hBYjUP9pZJEiSyxok237-ffF2uvgR_HSKFf79rCdrhPzqgx8x6iW-rsiire_OwQR14BMLpDK6IpsRJ7Tf3vg_uSh2OpG3jS5AY-rVQ&sigh=Id4VMzKKDSqHvTJ0X7Zjoi5UHNU&begin=0&len=388160&docid=5147852388396123647" -O file
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  6. #6
    Join Date
    Apr 2005
    Posts
    697
    Thanks! that works perfect!

  7. #7
    Join Date
    Apr 2005
    Posts
    697
    how would we put that into a php code:

    wget "\"http......\"";

    is that so?

  8. #8
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    Quote Originally Posted by ti_nhatrang
    how would we put that into a php code:

    wget "\"http......\"";

    is that so?
    Yes, exactly.

    Something like:

    PHP Code:
    system('wget -O file "http://blahblah.com/url?dsds=3434&hop=7" '); 
    I put the -O file at the start, makes it more obvious. Bear in mind if that crazy URL is time or session based, it will stop working in a while; if that happens, you may have to look at some refinements to make it keep working.

  9. #9
    Join Date
    Apr 2005
    Posts
    697
    I've tried

    PHP Code:
    <?

    exec
    ('wget -P/home/domix/public_html/video http://vp.video.google.com/videodownload?version=0&secureurl=swAAAFxHENxoED_R-3UsXxv5YNc7RQhgjXIn5-LgTF2bOgd2_QIq86fGuHTqXkiw-f2vNa0P0cK_YCRW5sHHgq23NT5Bi2QKjIHzvD5u88RhJu0PEdSdXJhf1p-gWh_qjd1Rb4G02dFuXayqx5J848Vwol70EkxNNdM6hxMnhOd6fTJnoQO0xiBkLok-kFlwWZP2hDddsGr9m8F8rS-nDLz2zmu5xgNNO62_ua9fWH2xI-lEPU2AFp8vtGHruhctqJEf6g&sigh=Z1MX2wPv7qA8Vs07wAZ311L4Xgg&begin=0&len=69866&docid=4526819805867391097 -O $filename.mp4');

    ?>
    And it didn't seem to work... please help?

  10. #10
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    No problems, I'll put on my tinfoil telepathy hat and work out what the error message was so I can solve it for you ...

  11. #11
    Join Date
    Apr 2005
    Posts
    697
    Thanks! I appreciate it! I eve try putting the -O infront of the link itself and still doesn't work... Thanks for trying, I will wait for your reply.

  12. #12
    Join Date
    Jul 2006
    Location
    Switzerland
    Posts
    97
    I think you will have to wait for a while then, biranoz is trying to tell you that you need to explain what kind of error messages you are receiving, instead of just stating that i does not work.

    Have you tried putting your URL in quotes? like

    Code:
    exec('wget -P "/home/domix/public_html/video http://vp.video.google.com/videodownload?version=0&secureurl=swAAAFxHENxoED_R-3UsXxv5YNc7RQhgjXIn5-LgTF2bOgd2_QIq86fGuHTqXkiw-f2vNa0P0cK_YCRW5sHHgq23NT5Bi2QKjIHzvD5u88RhJu0PEdSdXJhf1p-gWh_qjd1Rb4G02dFuXayqx5J848Vwol70EkxNNdM6hxMnhOd6fTJnoQO0xiBkLok-kFlwWZP2hDddsGr9m8F8rS-nDLz2zmu5xgNNO62_ua9fWH2xI-lEPU2AFp8vtGHruhctqJEf6g&sigh=Z1MX2wPv7qA8Vs07wAZ311L4Xgg&begin=0&len=69866&docid=4526819805867391097" -O $filename.mp4');
    I am not that familiar with php, but if it has same behaviour as bash the & sign will give you problems without the quotes.

  13. #13
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    Yes, I hadn't noticed the lack of quotes in the example - that would probably
    destroy any chance of it working in one hit! (but I'll leave you wondering whether
    I actually own a tinfoil telepathy hat... )

  14. #14
    Join Date
    Apr 2005
    Posts
    697
    Wolle, I've tried yours and still didn't download via php, however, if I do any of these via SSH, then it works...

    I do not get any errors, it just simply does not download.

  15. #15
    Join Date
    May 2004
    Location
    Singapore
    Posts
    374
    You should escape the URL using PHP's escapeshellarg() function.

    Code:
    exec('wget -P /home/domix/public_html/video '.escapeshellarg('http://vp.video.google.com/videodownload?version=0&secureurl=swAAAFxHENxoED_R-3UsXxv5YNc7RQhgjXIn5-LgTF2bOgd2_QIq86fGuHTqXkiw-f2vNa0P0cK_YCRW5sHHgq23NT5Bi2QKjIHzvD5u88RhJu0PEdSdXJhf1p-gWh_qjd1Rb4G02dFuXayqx5J848Vwol70EkxNNdM6hxMnhOd6fTJnoQO0xiBkLok-kFlwWZP2hDddsGr9m8F8rS-nDLz2zmu5xgNNO62_ua9fWH2xI-lEPU2AFp8vtGHruhctqJEf6g&sigh=Z1MX2wPv7qA8Vs07wAZ311L4Xgg&begin=0&len=69866&docid=4526819805867391097').' -O $filename.mp4');
    Make sure $filename has a valid value.

  16. #16
    Join Date
    Apr 2005
    Posts
    697
    that's right, I even remove the $filename and just try it movie.mp4 and it still doesn't download... Have you tried it on your own server? Does it work? If it does, then I guess it's me internally then rather than the script itself...

  17. #17
    Join Date
    May 2004
    Location
    Singapore
    Posts
    374
    If the same command works in shell but not in PHP, then you may want to check that the apache's user has permission to run wget, and apache can find wget (use full path instead).

  18. #18
    Join Date
    Apr 2005
    Posts
    697
    I can download say from url: wget http://www.yahoo.com/file.zip fine... just that the long crazy url doesn't work... also, if I use tinyurl.com to shorten the url, then it works fine as well with any the quotations marks etc... I'm just hoping there's another solution rathern than going through tinyurl.com....

  19. #19
    Join Date
    May 2004
    Location
    Singapore
    Posts
    374
    There is no reason wget will fail with long URLs.

    Have you tried the code I suggested? I tried it on my own server and it works.

  20. #20
    Join Date
    Apr 2005
    Posts
    697
    I certainly have, infact this is my exact php code:

    PHP Code:
    <?

    exec
    ('wget -P /home/domix/public_html '.escapeshellarg('http://vp.video.google.com/videodownload?version=0&secureurl=swAAAFxHENxoED_R-3UsXxv5YNc7RQhgjXIn5-LgTF2bOgd2_QIq86fGuHTqXkiw-f2vNa0P0cK_YCRW5sHHgq23NT5Bi2QKjIHzvD5u88RhJu0PEdSdXJhf1p-gWh_qjd1Rb4G02dFuXayqx5J848Vwol70EkxNNdM6hxMnhOd6fTJnoQO0xiBkLok-kFlwWZP2hDddsGr9m8F8rS-nDLz2zmu5xgNNO62_ua9fWH2xI-lEPU2AFp8vtGHruhctqJEf6g&sigh=Z1MX2wPv7qA8Vs07wAZ311L4Xgg&begin=0&len=69866&docid=4526819805867391097').' -O filename.mp4');


    ?>
    no go...

  21. #21
    Join Date
    Apr 2005
    Posts
    697
    can anybody else help me with this? Thanks in advance!

  22. #22
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    Try my version, with the double quotes inside the single quotes, does that work?

    It's almost certainly a quoting problem biting you here.

  23. #23
    Join Date
    Apr 2005
    Posts
    697
    I definately have for the past 2 days, and it still does not download... Have you tried it yourself? Are you getting any errors or what kind of success are you getting from that particular link?

  24. #24
    Join Date
    Apr 2005
    Posts
    697
    I mean, I obviously do not need to use wget if you have another solution, anything to download the file is fine...

  25. #25
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    I think the problem is the ridiculous URL. Maybe you could use tinyurl.com to solve that problem.

    ... ah ... tested and works beautifully.

    PHP Code:
    system("wget -O file.mp4 http://tinyurl.com/z66ls"); 
    In any case, it turns out that's not the actual problem - the problem is that you put a -P option in there which breaks the -O option. Perhaps be a little more careful next time around, don't just go sticking extra options in without understanding what they do.

Page 1 of 2 12 LastLast

Posting Permissions

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