Browse Source

Fix bug introduced adding comments

Since the whole program is a pipe, we can't have comment at the end of
lines.
Matteo Zeccoli Marazzini 4 years ago
parent
commit
4a75a14a6a
1 changed files with 13 additions and 12 deletions
  1. 13 12
      vaporget

+ 13 - 12
vaporget

@@ -1,18 +1,19 @@
 #!/bin/bash
 
 WEBSITE="https://vaporwave.ivan.moe/list/"
-wget -qO- $WEBSITE 2>/dev/null \		# Retrieve artist list
-	| grep "^<a href" \			# Search for anchor tags
-	| sed -e 's/<a href="//' \		# Remove <a href="
-	      -e 's/">/\n/' \			# Remove > (at the end of <a> tag) and substitute with \n
-	      -e 's/&gt;<\/a>.*/\noff/' \	# Remove &gt;</a> and everything after it (&gt; is used by the website to indicate long names which don't fit on the page)
-	      -e 's/\/<\/a>.*/\noff/' \		# Remove /</a> and everything after it
-	| xargs -d '\n' dialog --title "Test" --checklist "Menu" 0 0 0 3>&1 1>&2 2>&3 3>&- \	# Produce dialog menu to let the user choose artists
-	| sed -e 's/ /\n/g' -e '$a\' \		# Substitute spaces with newlines in the url list and add a newline at the end ot the list (dialog doesn't put if for us)
-	| sed -e 's,^,'"${WEBSITE}"',' \	# Insert base url at the beginning of each line
-	| wget -i - --spider -r -l inf --no-parent --no-directories 2>&1 \	# Get url for all songs of the selected artists
+
+wget -qO- $WEBSITE 2>/dev/null \
+	| grep "^<a href" \
+	| sed -e 's/<a href="//' \
+	      -e 's/">/\n/' \
+	      -e 's/&gt;<\/a>.*/\noff/' \
+	      -e 's/\/<\/a>.*/\noff/' \
+	| xargs -d '\n' dialog --title "Test" --checklist "Menu" 0 0 0 3>&1 1>&2 2>&3 3>&- \
+	| sed -e 's/ /\n/g' -e '$a\' \
+	| sed -e 's,^,'"${WEBSITE}"',' \
+	| wget -i - --spider -r -l inf --no-parent --no-directories 2>&1 \
 	| grep --line-buffered '^--' \
 	| stdbuf -oL cut -d' ' -f4 \
-	| grep --line-buffered '\.\(flac\|mp3\|wav\)$' \	# Select audio file types
+	| grep --line-buffered '\.\(flac\|mp3\|wav\)$' \
 	| tee /dev/stderr \
-	| mpv --no-video --playlist=- "$@"	# Start the party
+	| mpv --no-video --playlist=- "$@"