@command('url\\s(.*[-_a-zA-Z0-9]{11}.*)')
def yt_url(url, print_title=0):
 url_list = url.split()
 g.model.songs = []
 for u in url_list:
  try:
   p = util.get_pafy(u)
  except (IOError, ValueError) as e:
   g.message = ((c.r + str(e)) + c.w)
   g.content = (g.content or content.generate_songlist_display(zeromsg=g.message))
   return
  g.browse_mode = 'normal'
  v = Video(p.videoid, p.title, p.length)
  g.model.songs.append(v)
 if (not g.command_line):
  g.content = content.generate_songlist_display()
 if print_title:
  util.xprint(v.title)

@ command ( 'url\\s(.*[-_a-zA-Z0-9]{11}.*)' ) def yt_url ( url , print_title = 0 ) : url_list = url . split ( ) g . model . songs = [ ] for u in url_list : try : p = util . get_pafy ( u ) except ( IOError , ValueError ) as e : g . message = ( ( c . r + str ( e ) ) + c . w ) g . content = ( g . content or content . generate_songlist_display ( zeromsg = g . message ) ) return g . browse_mode = 'normal' v = Video ( p . videoid , p . title , p . length ) g . model . songs . append ( v ) if ( not g . command_line ) : g . content = content . generate_songlist_display ( ) if print_title : util . xprint ( v . title )
acess videos by urls .