![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
. . .
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
|
is it possible to use php to extract a youtube video?
I am wondering if it is possible to use a very short php script to download the flv of a youtube video straight to my server. Just want to do one video, so I can hardcode the youtube url in the short script, doesn't have to be any fancy interface or anything
anyone have any ideas on this? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
do you have access to the shell?
theirs a good python script called youtube_dl
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Biker Gnome
Industry Role:
Join Date: Mar 2004
Location: cell#324
Posts: 23,200
|
Use Firefox, right click, view page info, click on media and then click on the swf file and save
__________________
Carbon is not the problem, it makes up 0.041% of our atmosphere , 95% of that is from Volcanos and decomposing plants and stuff. So people in the US are responsible for 13% of the carbon in the atmosphere which 95% is not from Humans, like cars and trucks and stuff and they want to spend trillions to fix it while Solar Panel plants are powered by coal plants think about that |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
here is youtube_dl in action Code:
[chris@jumbo ~]$ youtube-dl https://youtube.com/watch?v=SbasOIcGjqs [youtube] Setting language [youtube] SbasOIcGjqs: Downloading video webpage [youtube] SbasOIcGjqs: Downloading video info webpage [youtube] SbasOIcGjqs: Extracting video information [download] Destination: SbasOIcGjqs.mp4 [download] 100.0% of 3.61M at 559.66k/s ETA 00:00
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,054
|
Sites like clipnabber.com require you to paste the source code in... Makes me believe there must be an easy formula to pull the mp4 url from the code.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Biker Gnome
Industry Role:
Join Date: Mar 2004
Location: cell#324
Posts: 23,200
|
Quote:
Put it on your desktop, upload to your server, nothing complicated
__________________
Carbon is not the problem, it makes up 0.041% of our atmosphere , 95% of that is from Volcanos and decomposing plants and stuff. So people in the US are responsible for 13% of the carbon in the atmosphere which 95% is not from Humans, like cars and trucks and stuff and they want to spend trillions to fix it while Solar Panel plants are powered by coal plants think about that |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
. . .
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
Code:
<?php class youtube { var $cookies; var $mgr; var $req; var $debug = true; var $auth = false; function youtube() { } function download($video_id) { $url = "https://youtube.com/watch?v=" . $video_id; $this->req =& new HTTP_Request($url); $response = $this->req->sendRequest(); if (PEAR::isError($response)) { $response->getMessage() . "\n"; } else { $page = $this->req->getResponseBody(); $vpattern = '/v=(.*?)&/'; preg_match($vpattern, $page, $mv); echo "<br />Video ID:" . $v_id = $mv[1]; $tpattern = '/&t=(.*?)&/'; preg_match($tpattern, $page, $tickets); echo "<br />Token ID:" . $token = $tickets[1]; $curl = "video_id="; $curl .= $v_id; $curl .= "&t="; $curl .= $token; $url = "https://youtube.com/get_video?" . $curl; if ($this->debug) return $url; } } } function getPatternFromUrl($url) { $url = $url . '&'; $pattern = '/v=(.+?)&+/'; preg_match($pattern, $url, $matches); return($matches[1]); } function GrabFlvFromYoutube($pattern) { $tube = new youtube(); $flv_http_path = $tube->download($pattern); echo "<br/>Complete URL:" . $flv_http_path; set_time_limit(0); $data = file_get_contents($flv_http_path); $new_flv_path = dirname(_FILE_) . '/flvs/' . $pattern . '-' . time() . '.flv'; echo "<br />File uploaed:"; file_put_contents($new_flv_path, $data); return $new_flv_path; } // here is url of youtube video $url = $_POST['url']; $pattern = getPatternFromUrl($url); $flv_path = GrabFlvFromYoutube($pattern); echo "File Successfully Downloaded at:" . $flv_path . "<br/>"; ?> ![]()
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
Try scraping the youtube URL for the appropriate data and dropping it into this URL structure, then downloading. http://www.ehow.com/how_4685059_youtube-mp-video.html
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
lol
Industry Role:
Join Date: Jan 2002
Posts: 15,969
|
Where's all the heros bitching about stealing content? lol @ this thread
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
GFY HALL OF FAME DAMMIT!!!
Join Date: Jan 2002
Location: that 504
Posts: 60,840
|
5+ years ago this woulda be a 6 page thread of shit flinging
![]()
__________________
![]() Want an Android App for your tube, membership, or free site? Need banners or promo material? Hit us up (ICQ Fletch: 148841377) or email me fletchxxx at gmail.com - ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
well as long as you dont use the videos dl'd from youtube for profit, i dont see any reason why you cant download them for offline viewing, i use an app called mxtube on my ipod which lets me grab yt vids for offline viewing.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
lol
Industry Role:
Join Date: Jan 2002
Posts: 15,969
|
Quote:
![]() and ![]() ![]() ![]() ... but it's ok, I clicked this thread to learn too! thanks everyone. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
. . .
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
|
Quote:
I'm playing with it but still getting 500 errors, is there something I am missing if trying to run the above as it is? and I'm not doing this to "steal" any content for those that voiced concern ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |