Activity Stream
48,167 MEMBERS
6721 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6
  1.     
    #1
    You can call me G

    Default [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($chCURLOPT_URL,  $link);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
            
    $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 == 0)
                    echo 
    "www.youtube.com".$videos."<br />";
                
    $i++;
            }
            
        }
        
        
    getVideos("Playlist Link here..");


    ?>
    Do comment if you have any problems/doubts or you wish to express some gratitude
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Yup, goodwork.

    Defendos BETA3 Released! Thread - Official Website

  4.     
    #3
    Member
    Website's:
    Nerdy-Tutorials.com Mp3viddown.com Filmlab.eu
    Ummmm..... Where To ADD????? Sorry

  5.     
    #4
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    why 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


  6.     
    #5
    Member
    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 .

  7.     
    #6
    Banned
    how to use this? meaning we can download .mp3 from youtube?? using jdownloader?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 17th Nov 2012, 04:54 AM
  2. How Do You Make a Video For YouTube?
    By Ladybbird1 in forum Webmaster Discussion
    Replies: 21
    Last Post: 10th Apr 2012, 02:04 PM
  3. Get a YouTube video URL in PHP
    By JmZ in forum Web Development Area
    Replies: 1
    Last Post: 19th Nov 2011, 09:51 PM
  4. Youtube Video Portal
    By Sponge Bob in forum Webmaster Discussion
    Replies: 6
    Last Post: 27th Aug 2011, 09:38 AM
  5. Replies: 19
    Last Post: 29th Oct 2010, 06:38 AM

Tags for this Thread

BE SOCIAL