Results 1 to 6 of 6
-
19th Jan 2011, 03:09 PM #1OPYou can call me G
[CODE]Extracting Video Links from YouTube Playlist
Made this since I needed to download Crysis Walkthrough and jDownloader wouldn't parse Playlists
.
Note: If you find that a link is incomplete please fix the RegEx accordingly and PM me, I'll be more than glad to add updates
Here's the Code:
PHP Code:<?php
function getVideos($link){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
preg_match_all("/\/watch\?v=[a-zA-Z0-9\-_]+/", $data, $matches);
$i = 0;
foreach($matches[0] as $videos){
if($i % 2 == 0)
echo "www.youtube.com".$videos."<br />";
$i++;
}
}
getVideos("Playlist Link here..");
?>Gaurav Reviewed by Gaurav on . [CODE]Extracting Video Links from YouTube Playlist Made this since I needed to download Crysis Walkthrough and jDownloader wouldn't parse Playlists xD. Note: If you find that a link is incomplete please fix the RegEx accordingly and PM me, I'll be more than glad to add updates ;) Here's the Code: <?php function getVideos($link){ $ch = curl_init(); Rating: 5
My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz
-
19th Jan 2011, 03:10 PM #2MemberWebsite's:
Elite.SO Defendos.com Motionite.comYup, goodwork.
-
25th Jan 2011, 04:16 PM #3MemberWebsite's:
Nerdy-Tutorials.com Mp3viddown.com Filmlab.euUmmmm..... Where To ADD????? Sorry
-
25th Jan 2011, 10:30 PM #4MemberWebsite's:
litewarez.net litewarez.com triniwarez.comwhy not use the api ?
PHP Code:$url="http://gdata.youtube.com/feeds/api/videos/KHLrEF9tHjw/related";
$comments=simplexml_load_file($url);
foreach($videos->entry as $video)
{
echo $video->title . "<br />";
}
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
26th Jan 2011, 03:38 AM #5Member
Good job
but when a service is offering an API , the best and easy way to perform a task is by using the API.
btw ,regex is not the best way to parse html .Coding Horror Fan
I don't read PM's frequently .
-
26th Jan 2011, 03:41 AM #6Banned
how to use this? meaning we can download .mp3 from youtube?? using jdownloader?
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] Rank Your Video On No 1 Position Of Google & YouTube Now - [Video Ranking Domination]
By AcidH4X in forum ServicesReplies: 4Last Post: 17th Nov 2012, 04:54 AM -
How Do You Make a Video For YouTube?
By Ladybbird1 in forum Webmaster DiscussionReplies: 21Last Post: 10th Apr 2012, 02:04 PM -
Get a YouTube video URL in PHP
By JmZ in forum Web Development AreaReplies: 1Last Post: 19th Nov 2011, 09:51 PM -
Youtube Video Portal
By Sponge Bob in forum Webmaster DiscussionReplies: 6Last Post: 27th Aug 2011, 09:38 AM -
[Selling] YouTube Video Shoutout, On a "famous" YouTube Account [Great for Advertising Sites]
By Goob3r in forum Completed TransactionsReplies: 19Last Post: 29th Oct 2010, 06:38 AM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...