diff --git a/fish/.config/fish/functions/p-gspw-list-cat.fish b/fish/.config/fish/functions/p-gspw-list-cat.fish new file mode 100644 index 0000000..268472c --- /dev/null +++ b/fish/.config/fish/functions/p-gspw-list-cat.fish @@ -0,0 +1,17 @@ +function p-gspw-list-cat + set -l catid $argv[1] + set -l pages (http https://gaystream.pw/video/channel/$catid \ + | htmlq --attribute href ".nav-links a.page-numbers:nth-last-child(2)" \ + | sed -e "s:.*/\([0-9]*\)\(?.*\)\?:\1:") + + if test -z $pages + set pages 1 + end + + for i in (seq $pages -1 1) + sleep 0,2 + curl --location --silent https://gaystream.pw/video/channel/$catid/page/$i \ + | htmlq --attribute href "main a[rel=bookmark]" \ + | tac + end +end diff --git a/fish/.config/fish/functions/p-gvtu-list-cat.fish b/fish/.config/fish/functions/p-gvtu-list-cat.fish new file mode 100644 index 0000000..c6a59f3 --- /dev/null +++ b/fish/.config/fish/functions/p-gvtu-list-cat.fish @@ -0,0 +1,16 @@ +function p-gvtu-list-cat + set -l catid (echo (curl https://gayvids.tube/studio/$argv[1]/ 2>/dev/null \ + | grep 'rel="alternate" type="application/json"'\ + | sed 's:.*href="\([^"]\+\).*:\1:' \ + | string split "/")[-1]) + set -l pages (curl -v -X HEAD https://gayvids.tube/wp-json/wp/v2/posts?categories=$catid 2>&1 \ + | grep x-wp-totalpages \ + | string trim \ + | string split " " -f 3) + + for i in (seq $pages -1 1) + sleep 0,2 + curl https://gayvids.tube/wp-json/wp/v2/posts?categories=$catid&page=$i 2>/dev/null \ + | jq -r ".[].link" | tac + end +end