๐Ÿ“ฆโž”๐Ÿฆ‹ Store and retrieve files on the Atmosphere
35
fork

Configure Feed

Select the types of activity you want to include in your feed.

various

Ducky 8c8a9bf5 1b8d659c

+8 -98
-26
src/commands/bsky_video.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - function atfile.bsky_video() { 4 - file_or_job_id="$1" 5 - 6 - function atfile.bsky_video.get_job_status() { 7 - app.bsky.video.getJobStatus "$1" 8 - } 9 - 10 - uploaded_video="$(app.bsky.video.uploadVideo "$1")" 11 - 12 - while true; do 13 - status="$(app.bsky.video.getJobStatus "$(echo "$uploaded_video" | jq -r ".jobId")")" 14 - 15 - percentage=$(echo "$status" | jq -r ".jobStatus.progress") 16 - state=$(echo "$status" | jq -r ".jobStatus.state") 17 - 18 - [[ $(atfile.util.is_null_or_empty "$percentage") == 1 ]] && percentage=0 19 - 20 - echo "$state ($percentage%)" 21 - 22 - if [[ $state == "JOB_STATE_COMPLETED" ]]; then 23 - break 24 - fi 25 - done 26 - }
+3 -3
src/commands/help.sh
··· 148 148 * video/*: $_nsid_meta#video 149 149 ${_envvar_prefix}_SKIP_UNSUPPORTED_OS_WARN <boolยน> (default: $_skip_unsupported_os_warn) 150 150 Do not error when running on an unsupported OS\n 151 + ${_envvar_prefix}_ENDPOINT_APPVIEW <url> (default: ${_endpoint_appview_default}$([[ $_endpoint_appview_default == *"zio.blue" ]] && echo "ยฒ")) 152 + Endpoint of the Bluesky (or compatible) AppView 151 153 ${_envvar_prefix}_ENDPOINT_JETSTREAM <url> (default: $_endpoint_jetstream_default) 152 154 Endpoint of the Jetstream relay 153 155 ${_envvar_prefix}_ENDPOINT_PDS <url> ··· 155 157 โ„น๏ธ Your PDS is resolved from your username. Set to override it (or if 156 158 resolving fails) 157 159 ${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY <url> (default: ${_endpoint_plc_directory_default}$([[ $_endpoint_plc_directory_default == *"zio.blue" ]] && echo "ยฒ")) 158 - Endpoint of the PLC directory 159 - ${_envvar_prefix}_ENDPOINT_RESOLVE_HANDLE <url> (default: ${_endpoint_resolve_handle_default}$([[ $_endpoint_plc_directory_default == *"zio.blue" ]] && echo "ยฒ")) 160 - Endpoint of the PDS/AppView used for handle resolving\n 160 + Endpoint of the PLC directory\n 161 161 ${_envvar_prefix}_DEBUG <boolยน> (default: $_debug_default) 162 162 Print debug outputs 163 163 โš ๏ธ When output is JSON (${_envvar_prefix}_OUTPUT_JSON=1), sets to 0
+1 -3
src/commands/something_broke.sh
··· 78 78 $(atfile.something_broke.print_envvar "DIST_USERNAME" "$_dist_username_default") 79 79 $(atfile.something_broke.print_envvar "ENABLE_FINGERPRINT" "$_enable_fingerprint_default") 80 80 $(atfile.something_broke.print_envvar "ENABLE_UPDATE_GIT_CLOBBER" "$_enable_update_git_clobber") 81 - $(atfile.something_broke.print_envvar "ENDPOINT_APPVIEW_BSKY" "$_endpoint_appview_bsky_default") 82 - $(atfile.something_broke.print_envvar "ENDPOINT_APPVIEW_BSKY_VIDEO" "$_endpoint_appview_bsky_video_default") 81 + $(atfile.something_broke.print_envvar "ENDPOINT_APPVIEW" "$_endpoint_appview_default") 83 82 $(atfile.something_broke.print_envvar "ENDPOINT_JETSTREAM" "$_endpoint_jetstream_default") 84 83 $(atfile.something_broke.print_envvar "ENDPOINT_PDS") 85 84 $(atfile.something_broke.print_envvar "ENDPOINT_PLC_DIRECTORY" "$_endpoint_plc_directory_default") 86 - $(atfile.something_broke.print_envvar "ENDPOINT_RESOLVE_HANDLE" "$_endpoint_resolve_handle_default") 87 85 $(atfile.something_broke.print_envvar "FMT_BLOB_URL" "$_fmt_blob_url_default") 88 86 $(atfile.something_broke.print_envvar "FMT_OUT_FILE" "$_fmt_out_file_default") 89 87 $(atfile.something_broke.print_envvar "FORCE_META_AUTHOR")
+2 -9
src/entry.sh
··· 74 74 _dist_username_default="$_meta_did" 75 75 _enable_fingerprint_default=0 76 76 _enable_update_git_clobber_default=0 77 - _endpoint_appview_bsky_default="https://api.bsky.app" 78 - _endpoint_appview_bsky_video_default="https://video.bsky.app" 77 + _endpoint_appview_default="https://bsky.zio.blue" 79 78 _endpoint_jetstream_default="wss://jetstream.atproto.tools" 80 - _endpoint_resolve_handle_default="https://zio.blue" # lol wtf is bsky.social 81 79 _endpoint_plc_directory_default="https://plc.zio.blue" 82 80 _fmt_blob_url_default="[server]/xrpc/com.atproto.sync.getBlob?did=[did]&cid=[cid]" 83 81 _fmt_out_file_default="[key]__[name]" ··· 107 105 _dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_USERNAME" $_dist_username_default)" 108 106 _enable_fingerprint="$(atfile.util.get_envvar "${_envvar_prefix}_ENABLE_FINGERPRINT" "$_enable_fingerprint_default")" 109 107 _enable_update_git_clobber="$(atfile.util.get_envvar "${_envvar_prefix}_ENABLE_UPDATE_GIT_CLOBBER" "$_enable_update_git_clobber_default")" 110 - _endpoint_appview_bsky="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_APPVIEW_BSKY" "$_endpoint_appview_bsky_default")" 111 - _endpoint_appview_bsky_video="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_APPVIEW_BSKY_VIDEO" "$_endpoint_appview_bsky_video_default")" 108 + _endpoint_appview="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_APPVIEW" "$_endpoint_appview_default")" 112 109 _endpoint_jetstream="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_JETSTREAM" "$_endpoint_jetstream_default")" 113 110 _endpoint_plc_directory="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY" "$_endpoint_plc_directory_default")" 114 - _endpoint_resolve_handle="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_RESOLVE_HANDLE" "$_endpoint_resolve_handle_default")" 115 111 _fmt_blob_url="$(atfile.util.get_envvar "${_envvar_prefix}_FMT_BLOB_URL" "$_fmt_blob_url_default")" 116 112 _fmt_out_file="$(atfile.util.get_envvar "${_envvar_prefix}_FMT_OUT_FILE" "$_fmt_out_file_default")" 117 113 _force_meta_author="$(atfile.util.get_envvar "${_envvar_prefix}_FORCE_META_AUTHOR")" ··· 320 316 atfile.bsky_profile "$2" 321 317 fi 322 318 ;; 323 - #"bsky-video") 324 - # atfile.bsky_video "$2" 325 - # ;; 326 319 "cat") 327 320 [[ -z "$2" ]] && atfile.die "<key> not set" 328 321 if [[ -n "$3" ]]; then
-33
src/lexi/app_bsky_video.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - # app.bsky.video.* 4 - 5 - ## Queries 6 - 7 - function app.bsky.video.getJobStatus() { 8 - id="$1" 9 - 10 - atfile.xrpc.bsky_video.get "app.bsky.video.getJobStatus" "jobId=$id" 11 - } 12 - 13 - function app.bsky.video.getUploadLimits() { 14 - atfile.xrpc.bsky_video.get "app.bsky.video.getUploadLimits" 15 - } 16 - 17 - function app.bsky.video.uploadVideo() { 18 - file="$1" 19 - 20 - # shellcheck disable=SC2154 21 - aud="did:web:$(atfile.util.get_uri_segment "$_server" host)" 22 - # shellcheck disable=SC2154 23 - did="$_username" 24 - name="$(basename "$file")" 25 - type="video/mp4" 26 - 27 - # shellcheck disable=SC2154 28 - curl -s -X POST "$_endpoint_appview_bsky_video/xrpc/app.bsky.video.uploadVideo?did=$did\&name=$name" \ 29 - -H "Authorization: Bearer $(atfile.xrpc.bsky_video.jwt "com.atproto.repo.uploadBlob" "$aud")" \ 30 - -H "Content-Type: $type" \ 31 - -H "User-Agent: $(atfile.util.get_uas)" \ 32 - --data-binary @"$file" | jq 33 - }
+1 -1
src/shared/util.sh
··· 1029 1029 1030 1030 if [[ "$actor" != "did:"* ]]; then 1031 1031 # shellcheck disable=SC2154 1032 - resolved_handle="$(atfile.xrpc.bsky.get "com.atproto.identity.resolveHandle" "handle=$actor" "" "$_endpoint_resolve_handle")" 1032 + resolved_handle="$(atfile.xrpc.bsky.get "com.atproto.identity.resolveHandle" "handle=$actor")" 1033 1033 error="$(atfile.util.get_xrpc_error $? "$resolved_handle")" 1034 1034 1035 1035 if [[ -z "$error" ]]; then
+1 -23
src/shared/xrpc.sh
··· 61 61 type="$3" 62 62 63 63 atfile.http.get \ 64 - "$_endpoint_appview_bsky/xrpc/$lexi?$query" \ 64 + "$_endpoint_appview/xrpc/$lexi?$query" \ 65 65 "" \ 66 66 "$type" | jq 67 67 } 68 - 69 - ## Bluesky Video 70 - 71 - function atfile.xrpc.bsky_video.jwt() { 72 - lxm="$1" 73 - aud="$2" 74 - 75 - [[ -z "$aud" ]] && aud="did:web:$(atfile.util.get_uri_segment "$_endpoint_appview_bsky_video" host)" 76 - 77 - atfile.xrpc.pds.get "com.atproto.server.getServiceAuth" "aud=$aud&lxm=$lxm" | jq -r ".token" 78 - } 79 - 80 - function atfile.xrpc.bsky_video.get() { 81 - lexi="$1" 82 - query="$2" 83 - type="$3" 84 - 85 - atfile.http.get \ 86 - "$_endpoint_appview_bsky_video/xrpc/$lexi?$query" \ 87 - "Bearer $(atfile.xrpc.bsky_video.jwt "$lexi")" \ 88 - "$type" | jq 89 - }