Class: IdsPlease::Parsers::Youtube

Inherits:
Base
  • Object
show all
Defined in:
lib/ids_please/parsers/youtube.rb

Constant Summary collapse

MASK =
/youtu\.be|youtube/i

Class Method Summary collapse

Methods inherited from Base

interact, to_sym, valid_id_regex

Class Method Details



8
9
10
11
12
13
14
# File 'lib/ids_please/parsers/youtube.rb', line 8

def parse_link(link)
  if link.path =~ /channels|user/
    link.path.split('/')[2]
  else
    link.path.split('/')[1]
  end
end