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
