summaryrefslogtreecommitdiff
path: root/bin/extra
diff options
context:
space:
mode:
Diffstat (limited to 'bin/extra')
-rwxr-xr-xbin/extra/trl33
-rwxr-xr-xbin/extra/ytplay7
2 files changed, 10 insertions, 30 deletions
diff --git a/bin/extra/trl b/bin/extra/trl
index 55d65ee..957d0fb 100755
--- a/bin/extra/trl
+++ b/bin/extra/trl
@@ -5,33 +5,7 @@
# returns available languages
languages () {
- cat <<-EOF
- arabic
- dutch
- french
- german
- polish
- english
- portuguese
- spanish
- romanian
- hebrew
- swedish
- italian
- turkish
- japanese
- ukrainian
- korean
- chinese
- czech
- hungarian
- danish
- persian
- greek
- slovak
- hindi
- thai
- EOF
+ printf 'arabic\nchinese\nczech\ndanish\ndutch\nenglish\nfrench\ngerman\ngreek\nhebrew\nhindi\nhungarian\nitalian\njapanese\nkorean\npersian\npolish\nportuguese\nromanian\nslovak\nspanish\nswedish\nthai\nturkish\nukrainian\n'
}
if [ -z "${word:=$1}" ]
@@ -47,11 +21,12 @@ primary="$(languages | fzf --prompt="from:")"
secondary="$(languages | fzf --prompt="to:")"
[ "$secondary" ] || exit 1
-curl -s "https://context.reverso.net/translation/$primary-$secondary/$word" \
+# url="https://www.reverso.net/text-translation#sl=$primary&tl=$secondary&text=$word"
+url="https://context.reverso.net/translation/$primary-$secondary/$word"
+curl -s "$url" \
--compressed \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
- -H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' |
pup 'a.link_highlighted em text{}' |
sed 's/.*/\L&/' |
diff --git a/bin/extra/ytplay b/bin/extra/ytplay
index 5243364..4b23732 100755
--- a/bin/extra/ytplay
+++ b/bin/extra/ytplay
@@ -1,4 +1,9 @@
#!/bin/sh
url="$(ytlink)"
herbe "playing: $url" &
-yt-dlp -o - "$url" | mpv -
+yt-dlp "$url" \
+ --embed-chapters \
+ -f "b" \
+ -S "res:1080" \
+ -o - |
+ mpv -