Compare commits
5 Commits
7d37a8300d
...
997efef64a
Author | SHA1 | Date |
---|---|---|
yosh | 997efef64a | |
yosh | 873ef1fe32 | |
yosh | 0ee7312993 | |
yosh | dc521cfe66 | |
yosh | 5d9fc46e4d |
|
@ -73,11 +73,11 @@ for type in album track; do
|
|||
curl -L -s -o - "$url" | pup 'script[type="application/ld+json"]' 'text{}' > "$json" || continue
|
||||
artist="$(jq -r '.byArtist.name' < "$json")"
|
||||
name="$(jq -r '.name' < "$json")"
|
||||
if [ "$(jq '.numTracks' < "$json")" = "0" ]; then
|
||||
if [ "$(jq '.numTracks' < "$json")" = "0.0" ]; then
|
||||
look_closer="<a href=\"$url\" rel=\"nofollow\">$artist - $name</a><br>$NL$look_closer"
|
||||
errecho "LOOK CLOSER: $url"
|
||||
tmplog="$tmplog$url LOOK_CLOSER$NL"
|
||||
elif [ "$(jq 'if (.inAlbum) then .inAlbum.albumRelease[0].offers.price else .albumRelease[0].offers.price end' < "$json")" = "0" ]; then
|
||||
elif [ "$(jq 'if (.inAlbum) then .inAlbum.albumRelease[0].offers.price else .albumRelease[0].offers.price end' < "$json")" = "0.0" ]; then
|
||||
eval 'contained_'"$type"'s="<a href=\"$url\" rel=\"nofollow\">$artist - $name</a><br>${NL}${contained_'"$type"'s}"'
|
||||
errecho "CONTAINED $type: $artist - $name"
|
||||
tmplog="$tmplog$url CONTAINED$NL"
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
set -ef
|
||||
|
||||
while getopts :s:t:T: OPT; do
|
||||
case "$OPT" in
|
||||
s) start="$OPTARG" ;;
|
||||
t) time="$OPTARG" ;;
|
||||
T) to="$OPTARG" ;;
|
||||
*) : ;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
exec ffmpeg ${start:+-ss "$start"} ${to:+-to "$to"} \
|
||||
-i "$1" -i "$2" ${time:+-t "$time"} \
|
||||
-lavfi "[0:v] setpts=PTS-STARTPTS [ref]; \
|
||||
[1:v] setpts=PTS-STARTPTS [dis]; \
|
||||
[dis][ref] libvmaf=log_fmt=xml:log_path=/dev/stdout:n_threads=$(nproc)" \
|
||||
-f null - \
|
|
@ -0,0 +1,95 @@
|
|||
#!/bin/sh
|
||||
set -euf
|
||||
|
||||
# $@ are resrec urls to things
|
||||
|
||||
cleanup() {
|
||||
[ -f "${tmp_recuri:-}" ] && rm "$tmp_recuri"
|
||||
[ -f "${tmp_json:-}" ] && rm "$tmp_json"
|
||||
[ -f "${tmp_json2:-}" ] && rm "$tmp_json2"
|
||||
[ -f "${tmpfile:-}" ] && rm "$tmpfile"
|
||||
true
|
||||
}
|
||||
|
||||
trap 'cleanup' INT HUP QUIT EXIT
|
||||
|
||||
outdir="$HOME/pics/screenshots/Resonite"
|
||||
|
||||
for resrec; do
|
||||
cleanup
|
||||
|
||||
resrec="${resrec#resrec:///}"
|
||||
recuri="https://api.resonite.com/users/${resrec%%/*}/records/${resrec##*/}"
|
||||
tmp_recuri="$(mktemp)"
|
||||
curl -s -o "$tmp_recuri" "$recuri"
|
||||
|
||||
# asset uri stuff
|
||||
asseturi="$(jq -r '.assetUri | sub("resdb:///(?<x>[^.]+).*";"https://assets.resonite.com/\(.x)")' < "$tmp_recuri")"
|
||||
tmp_json="$(mktemp)"
|
||||
curl -s "$asseturi" | tail -c +10 | brotli -d | bson2 print > "$tmp_json"
|
||||
|
||||
# save the image itself
|
||||
imguri="$(jq -r '.Object.Children[0].Components.Data.[] |
|
||||
select(.Type=="FrooxEngine.StaticTexture2D").Data.URL.Data |
|
||||
sub("@resdb:///(?<x>[^.]+).*";"https://assets.resonite.com/\(.x)")' \
|
||||
< "$tmp_json"
|
||||
)"
|
||||
timestamp="$(jq -r '.tags[] | select(contains("timestamp:")) |
|
||||
sub("timestamp:(?<d>[^T]+)T(?<h>[^:]+):(?<m>[^:]+):(?<s>[^.]+).*";"\(.d)_\(.h)-\(.m)-\(.s)")' \
|
||||
< "$tmp_recuri"
|
||||
)"
|
||||
[ -z "$timestamp" ] && timestamp="$(jq -r '.creationTime | sub("$(?<d>[^T]+)T(?<h>[^:]+):(?>,>[^:]+):(?<s>[^.]+).*";"\(.d)_\(.h)-\(.m)-\(.s)")' < "$tmp_recuri")"
|
||||
|
||||
echo "downloading image $timestamp.webp"
|
||||
tmpfile="$(mktemp)"
|
||||
curl -s -o "$tmpfile" "$imguri"
|
||||
|
||||
outfile="$outdir/$timestamp.webp"
|
||||
if [ -f "$outfile" ]; then
|
||||
if cmp -s "$tmpfile" "$outfile"; then
|
||||
echo "Duplicate file, not saving"
|
||||
continue
|
||||
else
|
||||
echo "WARNING: filename exists in 1st pass, making unique name as safeguard"
|
||||
outfile="${outfile%.webp}_$(uuidgen).webp"
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if photometadata even exists
|
||||
if [ "$(jq '.TypeVersions."FrooxEngine.PhotoMetadata"' < "$tmp_json")" = "null" ]; then
|
||||
echo "no photometadata"
|
||||
else
|
||||
# if it does, we're in business
|
||||
tmp_json2="$(mktemp)"
|
||||
jq '.Object.Children[0].Components.Data.[] | select(.Type=="FrooxEngine.PhotoMetadata")' "$tmp_json" > "$tmp_json2"
|
||||
|
||||
meta_time="$(date -u -d "@$(jq -r '.Data.TimeTaken.Data | sub("{\\$date: (?<x>[0-9]+)[0-9][0-9][0-9]}"; "\(.x)")' < "$tmp_json2")" +'%Y:%m:%d %H:%M:%S')"
|
||||
meta_host="$(jq -r '.Data.LocationHost._userId.Data' < "$tmp_json2")"
|
||||
meta_place="$(jq -r '.Data.LocationName.Data | gsub("<[^<]+>";"")' < "$tmp_json2")"
|
||||
meta_photographer="$(jq -r '.Data.TakenBy._userId.Data' < "$tmp_json2")"
|
||||
meta_presentusers="$(jq -r '[.Data.UserInfos.Data[].User._userId.Data] | @tsv | gsub("\t";", ")' < "$tmp_json2")"
|
||||
|
||||
exiftool -overwrite_original -UserComment="World: $meta_place
|
||||
Host: $meta_host
|
||||
Photographer: $meta_photographer
|
||||
Present Users: $meta_presentusers" "$tmpfile" \
|
||||
-datetimeoriginal="$meta_time"
|
||||
|
||||
# outfile will be in yyyy-mm-dd_hh-mm-ss, UTC TIME!!!
|
||||
outfile="$outdir/$(printf '%s' "$meta_time" | sed -e 's/:/-/g' -e 's/ /_/g').webp"
|
||||
if [ -f "$outfile" ]; then
|
||||
if cmp -s "$tmpfile" "$outfile"; then
|
||||
echo "WARNING: Duplicate file after 2nd pass, not saving"
|
||||
continue
|
||||
else
|
||||
outfile="${outfile%.webp}_$(uuidgen).webp"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
mv "$tmpfile" "$outfile"
|
||||
done
|
||||
|
||||
# note: when converting to png then jxl, sometimes tags get fucked up. do this
|
||||
# for i in *.jxl; do exiftool -tagsfromfile "${i%.jxl}.webp" -usercomment -datetimeoriginal -m "$i"; done
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# DEFAULT OPTIONS
|
||||
INSTANCE="https://translate.tiekoetter.com/"
|
||||
INSTANCE="https://translate.slipfox.xyz"
|
||||
ENGINE="google"
|
||||
FLANG="auto"
|
||||
TLANG="en"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
set -euf
|
||||
|
||||
filename="$(yt-dlp -O '%(upload_date>%Y-%m-%d)s %(title)s.%(ext)s' "$1")"
|
||||
yt-dlp -o "$filename" "$1"
|
||||
|
||||
for ext in json html txt; do
|
||||
twitchdownloader chatdownload -o "${filename%.*}.$ext" -u "$1"
|
||||
done
|
Loading…
Reference in New Issue