lan Nomar avatar lan Nomar committed 536a95e

added broken net/youtube-browse

Comments (0)

Files changed (1)

net/youtube-browse.brc

+#!/bin/brc
+
+# support
+# more sites! everything quvi supports!
+# doesnt work at times... why? ( bad grep? )
+
+fn DEBUG { echo $* }
+
+fn youtube { DEBUG $^link/^$^search^$^*
+		# Next page
+		# http://www.youtube.com/results?search_query=a&page=2
+  link		= 'http://www.youtube.com'
+  search	= 'results?search_query='
+
+  *=$* { *=`{ urlencode $^* } }
+
+  for ( * in `` ( $ifs(3) ) { w3m -dump_source $^link/^$^search^$^* | grep 'video-long-title' } ) {
+
+	ifs="	{ * = `{ echo $* }	} 
+	ifs=()	{	title = `{ urldecode $10 | sed -e 's/\&/\&/g' -e 's/"/"/g' }	}
+	
+	ifs=('=' ';' '&') { watch = `{ echo -n $4 }	; watch=$watch(2)	}
+	
+	select = ( $select $watch )
+	
+	echo -n $#select^'	'^$title
+}  }
+
+
+#	~ $#* 0 || youtube $*
+#	while ( ! ~ $* *^[A-z]^* ) {
+		youtube $*
+		echo -n 'Select link:	'; *=`{ask}
+#	}
+#	~ $#* 0 && exit 0
+	
+	file = `{ cclive $link^'/watch?v='^$select($*) --exec 'echo %f' }
+	dlpid = $apid
+	mplayer $^file
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.