Click here to Skip to main content
13,504,308 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked
Posted 23 Mar 2011

One Line of code to download youtube's flv file in php

, 25 Mar 2011
Rate this:
Please Sign up or sign in to vote.
One Line of code to download youtube's flv file in php
$video_id is the id of youtube video
$video_path is the saving path

<br />
exec('wget -t 2  --cookies=on --keep-session-cookies --save-cookies=/home/cookie.txt'.$video_id.' -qO- | sed -n "/fmt_url_map/{s/[\\&]/\\n/g;p}" | sed -n \'/^fmt_url_map=/p\'  | sed -n "s/\\%7C/\\n/g;p"  | sed -n \'/itag%3D5/p\'|  sed \'s/%3A/:/g;s/%2F/\\//g;s/%3F/\\?/g;s/%3D/=/g;s/%26/\\&/g ;s/%25/%/g \' | wget  --cookies=on --load-cookies=/home/cookie.txt  -i - -O '.$video_path);


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 5 it works Pin
mraiur7-Apr-11 3:28
membermraiur7-Apr-11 3:28 
GeneralReported Pin
Trollslayer26-Mar-11 1:32
mentorTrollslayer26-Mar-11 1:32 
QuestionWhy one line? Pin
Indivara23-Mar-11 20:43
subeditorIndivara23-Mar-11 20:43 
AnswerRe: Why one line? Pin
Henry Minute24-Mar-11 4:56
mvpHenry Minute24-Mar-11 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180417.1 | Last Updated 25 Mar 2011
Article Copyright 2011 by gxtiou
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid