summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-09-07 17:36:36 -0700
committerxyz <gky44px1999@gmail.com>2021-09-07 17:36:36 -0700
commitd7a80e6f6c61f4ef11f33faf2cfe0b94a3ae1bf7 (patch)
tree7344e764f96f17fb4d83acf23ffd8a59564199c1 /.local/bin
parented8cf0d51437a8ab819a3e9a84433a7b0c652c94 (diff)
upd, integrate ref2, updgall and others
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/curlkg2
-rwxr-xr-x.local/bin/curlncm2
-rwxr-xr-x.local/bin/ref23
-rwxr-xr-x.local/bin/upd52
-rwxr-xr-x.local/bin/updgall3
5 files changed, 54 insertions, 8 deletions
diff --git a/.local/bin/curlkg b/.local/bin/curlkg
index 9924d209..d517fee7 100755
--- a/.local/bin/curlkg
+++ b/.local/bin/curlkg
@@ -39,5 +39,5 @@ for i in $(seq 2 $(((ugc_total_count+num-1)/num))); do
done
# how to show less aria2c stdout?
-jq -r '.data.ugclist[]|"'"$music_url"'?shareid=\(.shareid)\n out=\(.title)_\(.time).m4a"' "$tmp_json_file" | aria2c -d "$download_dir" --auto-file-renaming=false -i-
+jq -r '.data.ugclist[]|"'"$music_url"'?shareid=\(.shareid)\n out=\(.title)_\(.time).m4a"' "$tmp_json_file" | aria2c -d "$download_dir" --auto-file-renaming=false --console-log-level=warn -i-
rm "$tmp_json_file"
diff --git a/.local/bin/curlncm b/.local/bin/curlncm
index 484fe8c1..b8ddb168 100755
--- a/.local/bin/curlncm
+++ b/.local/bin/curlncm
@@ -83,5 +83,5 @@ curl -s -A "$user_agent" -d params="$encrypted_params" 'https://interface3.music
# using user_agent, content-type header, cookie header, referer are not necessary? but feels faster
# not sure about cookie header format for aria2c, this link shows that it's kinda messy, so I didn't use it
# https://github.com/aria2/aria2/issues/545#issuecomment-650070869
-echo "$data" | awk -F'\t' '{printf(" out=%s_%s.mp3\n",$2,$1)}' | paste "$dl_urls_tmp" - -d '\n' | aria2c -U "$user_agent" --header='Content-Type: application/x-www-form-urlencoded' --referer='https://music.163.com' -d "$download_dir" --auto-file-renaming=false -i-
+echo "$data" | awk -F'\t' '{printf(" out=%s_%s.mp3\n",$2,$1)}' | paste "$dl_urls_tmp" - -d '\n' | aria2c -U "$user_agent" --header='Content-Type: application/x-www-form-urlencoded' --referer='https://music.163.com' -d "$download_dir" --auto-file-renaming=false --console-log-level=warn -i-
rm "$dl_urls_tmp"
diff --git a/.local/bin/ref2 b/.local/bin/ref2
deleted file mode 100755
index 2a849028..00000000
--- a/.local/bin/ref2
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sudo reflector --save /etc/pacman.d/mirrorlist --latest 200 --sort rate
diff --git a/.local/bin/upd b/.local/bin/upd
new file mode 100755
index 00000000..dbc7b6b6
--- /dev/null
+++ b/.local/bin/upd
@@ -0,0 +1,52 @@
+#!/bin/sh
+# may need mkdir -p for some of the dirs? kg and ncm no need, how about refl and gall
+
+refl ()
+{
+ sudo reflector --save /etc/pacman.d/mirrorlist --latest 200 --sort rate
+}
+
+gall ()
+{
+ gallery-dl --download-archive "$XDG_DOCUMENTS_DIR/database/gallery-dl.sqlite3" -d "$XDG_PICTURES_DIR/anime" -i "$XDG_CONFIG_HOME/myconf/gallery_urls"
+}
+
+kg ()
+{
+ curlkg -u649b9e82272a348b "$XDG_MUSIC_DIR/not_pure/lan_lan/kg/"
+ curlkg -u64949d822c25328c "$XDG_MUSIC_DIR/not_pure/cheng_ruan/kg/"
+}
+
+ncm ()
+{
+ curlncm -a48860966 "$XDG_MUSIC_DIR/not_pure/lan_lan/ncm/artist/"
+ curlncm -a46703185 "$XDG_MUSIC_DIR/not_pure/cheng_ruan/ncm/artist/"
+ curlncm -r793052426 "$XDG_MUSIC_DIR/not_pure/lan_lan/ncm/djradio/"
+ curlncm -r792968433 "$XDG_MUSIC_DIR/not_pure/cheng_ruan/ncm/djradio/"
+}
+
+pac ()
+{
+ sudo pacman -Syu
+ paru -Syu
+ sudo pacman -Fy
+}
+
+if [ $# -eq 0 ]; then
+ pac
+ ncm
+ kg
+ refl
+ gall
+else
+ while getopts rgknp opt; do
+ case $opt in
+ r)refl;;
+ g)gall;;
+ k)kg;;
+ n)ncm;;
+ p)pac;;
+ \?)exit 1;;
+ esac
+ done
+fi
diff --git a/.local/bin/updgall b/.local/bin/updgall
deleted file mode 100755
index fdbc0dd2..00000000
--- a/.local/bin/updgall
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-gallery-dl --download-archive "$XDG_DOCUMENTS_DIR/database/gallery-dl.sqlite3" -d "$XDG_PICTURES_DIR/anime" -i "$XDG_CONFIG_HOME/myconf/gallery_urls"