added queue subcommand
This commit is contained in:
		
							parent
							
								
									c7ec1f9998
								
							
						
					
					
						commit
						e0d5a9c8a9
					
				
							
								
								
									
										3
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								README
									
									
									
									
									
								
							@ -29,6 +29,9 @@ pick file...
 | 
			
		||||
play uri...
 | 
			
		||||
- Plays a video, caching its title first
 | 
			
		||||
 | 
			
		||||
queue file...
 | 
			
		||||
- Queues a playlist
 | 
			
		||||
 | 
			
		||||
verify file...
 | 
			
		||||
- Verifies that all the videos in a playlist are existent on YouTube, and if
 | 
			
		||||
they aren’t, attempts to replace the URI with one from the Wayback Machine. If
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								yt
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								yt
									
									
									
									
									
								
							@ -92,10 +92,13 @@ pick() { # Pick a video to play from a list of videos
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
play() { # play a video after caching its title
 | 
			
		||||
	cache $@
 | 
			
		||||
	mpv $@
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
queue() {
 | 
			
		||||
	while test -n "$1"; do
 | 
			
		||||
		cache "$1"
 | 
			
		||||
		mpv "$1"
 | 
			
		||||
		shift
 | 
			
		||||
		mpv "$(tr '\n' ' ' <"$1")"
 | 
			
		||||
	done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -188,6 +191,9 @@ case "$com" in
 | 
			
		||||
		shift 2>/dev/null || usage 'uri...'
 | 
			
		||||
		play "$@"
 | 
			
		||||
		;;
 | 
			
		||||
	queue)
 | 
			
		||||
		shift 2>/dev/null || usage 'file...'
 | 
			
		||||
		queue "$@"
 | 
			
		||||
	verify)
 | 
			
		||||
		shift 2>/dev/null || usage 'file...'
 | 
			
		||||
		verify "$@"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user