1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone knows a tool to scrape youtube links?

Discussion in 'YouTube' started by eunicemartinez_21, Feb 27, 2012.

  1. eunicemartinez_21

    eunicemartinez_21 Senior Member

    Joined:
    Oct 8, 2009
    Messages:
    801
    Likes Received:
    202
    Can anyone suggest me a tool that can scrape youtube links?

    For example I want to scrape all the youtube links for a certain channel then save it.

    Is there any free tool that can do this?

    Thanks
     
  2. Sm_Art

    Sm_Art Junior Member

    Joined:
    May 23, 2009
    Messages:
    147
    Likes Received:
    43
    Location:
    Kepler 22b
    what you mean links? links from the descriptions of videos or what links?
     
  3. kmzlink

    kmzlink Junior Member

    Joined:
    Feb 11, 2009
    Messages:
    125
    Likes Received:
    15
    Occupation:
    SEO WEBMASTER
    Location:
    Google Malaysia
    i can make a tools to scrape youtube video id from any channel that you want
    pm me if you really want this bot...
     
  4. mic22

    mic22 Newbie

    Joined:
    Apr 3, 2010
    Messages:
    37
    Likes Received:
    10
    Code:
    #!/usr/bin/ruby
    require 'rubygems'
    require 'mechanize'
    
    agent=Mechanize.new
    output=File.new("#{ARGV[0]}.txt", 'w')
    
    i=1
    loop do
    	page=agent.get("hXXp://youtube.com/user/#{ARGV[0]}/videos", {'sort'=>'dd', 'view'=>'u', 'page'=>i})
    	links=page.links_with(:href=>/watch/).map { |link| link="hXXp://youtube.com#{link.href.gsub(/&.*$/, '')}\n" }
    	links.uniq!
    	if links.size>2
    		links.each { |link| output.write(link) }
    	else
    		break
    	end
    	i+=1
    end
    
    output.close
     
    • Thanks Thanks x 1
  5. bartono

    bartono Regular Member

    Joined:
    May 18, 2009
    Messages:
    413
    Likes Received:
    139
    How I can use this code? Tell me please
     
    • Thanks Thanks x 1