Modify a few scripts
This commit is contained in:
parent
09d6eff912
commit
e4fe89d4d5
3 changed files with 35 additions and 2 deletions
6
fish/.config/fish/functions/p-xhamster-getpdl.fish
Normal file
6
fish/.config/fish/functions/p-xhamster-getpdl.fish
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
function p-xhamster-getpdl
|
||||||
|
p-xhamster-list https://fr.xhamster.com/users/piwafuwoz/favorites/videos/611e372b05295713901598a3-collection \
|
||||||
|
| tac \
|
||||||
|
| tee /dev/stderr \
|
||||||
|
| pdl --batch-file -
|
||||||
|
end
|
28
fish/.config/fish/functions/p-xhamster-list.fish
Normal file
28
fish/.config/fish/functions/p-xhamster-list.fish
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
function p-xhamster-list
|
||||||
|
set -l url $argv[1]
|
||||||
|
set -l page 1
|
||||||
|
set -l links
|
||||||
|
set -l count 1
|
||||||
|
|
||||||
|
if test -z "$url"
|
||||||
|
echo "ERROR: no URL given"
|
||||||
|
return 3
|
||||||
|
end
|
||||||
|
|
||||||
|
while test $count -gt 0
|
||||||
|
echo -n "Getting page $page: " >&2
|
||||||
|
set -l pagelinks (wget -O - "$url/$page" 2>/dev/null \
|
||||||
|
| sed "s:>:>\n:g" \
|
||||||
|
| grep "<a" \
|
||||||
|
| sed -n 's|.*\(https://fr.xhamster.com/videos/[^"]\+\).*|\1|p' \
|
||||||
|
| uniq | string split ' ')
|
||||||
|
|
||||||
|
set count (count $pagelinks)
|
||||||
|
echo "$count links found" >&2
|
||||||
|
set -a links $pagelinks
|
||||||
|
set page (math $page + 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -e (string join "\n" $links)
|
||||||
|
|
||||||
|
end
|
|
@ -1,11 +1,10 @@
|
||||||
# Defined in /tmp/fish.ib9W00/p-xnxx-all.fish @ line 2
|
|
||||||
function p-xnxx-all
|
function p-xnxx-all
|
||||||
set -l search $argv[1]
|
set -l search $argv[1]
|
||||||
set -l page $argv[2]
|
set -l page $argv[2]
|
||||||
|
|
||||||
if test -z "$search"
|
if test -z "$search"
|
||||||
echo "ERROR: no search given"
|
echo "ERROR: no search given"
|
||||||
exit 3
|
return 3
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -z "page"
|
if test -z "page"
|
||||||
|
|
Loading…
Add table
Reference in a new issue