Drop dependency on xxd

This commit is contained in:
bgh 2025-08-16 12:56:21 +10:00
commit b2c7d8fef4
2 changed files with 9 additions and 9 deletions

View file

@ -95,11 +95,11 @@ If curious, you're encouraged to inspect commands before running them.
# host program
cat > "${host_dir}/${host_program}" << 'EOF'
#!/bin/bash
#!/usr/bin/env bash
message_byte_length=$(od --address-radix=n --read-bytes=4 --format=dL | tr --delete " ")
message=$(od --address-radix=n --read-bytes="${message_byte_length}" --format=x1 | xxd --plain --revert)
message=$(echo "${message}" | sed --expression='s/^"\(.*\)"$/\1/')
message_byte_length=$(od --address-radix=n --read-bytes=4 --format=dL)
message=$(head --bytes="${message_byte_length}")
message=$(echo "${message}" | sed --expression='s|^"\(.*\)"$|\1|')
streamlink ${message} > /dev/null 2>&1
EOF
@ -187,7 +187,7 @@ If curious, you're encouraged to inspect commands before running them.
Review [requirements](#requirements). Though not specifically mentioned, it's assumed relatively recent versions of the following are installed
* Firefox (for desktop)
* On Linux/(macOS?) - core utilities, namely `od` and `xxd`
* On Linux/(macOS?) - core utilities, namely `od`
* On Windows - tested against Windows PowerShell 5.1 ([installed by default](https://learn.microsoft.com/previous-versions/powershell/scripting/windows-powershell/install/windows-powershell-system-requirements#windows-powershell-51) on Windows 10+)
To avoid unnecessary context menu clutter, the Streamlink Handoff entry is set to display only in link, (open) page and tab [contexts](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType) that match URLs sourced from Streamlink's [plugins article](https://streamlink.github.io/plugins.html). An example link that can be used for testing is below:

View file

@ -1,7 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
message_byte_length=$(od --address-radix=n --read-bytes=4 --format=dL | tr --delete " ")
message=$(od --address-radix=n --read-bytes="${message_byte_length}" --format=x1 | xxd --plain --revert)
message=$(echo "${message}" | sed --expression='s/^"\(.*\)"$/\1/')
message_byte_length=$(od --address-radix=n --read-bytes=4 --format=dL)
message=$(head --bytes="${message_byte_length}")
message=$(echo "${message}" | sed --expression='s|^"\(.*\)"$|\1|')
streamlink ${message} > /dev/null 2>&1