Skip to content

Commit

Permalink
wemeet: fix update script on github action
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Apr 19, 2024
1 parent a02a7df commit d134508
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkgs/wemeet/update.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
writeShellApplication,
python3,
curl,
jq,
urlencode,
moreutils,
}:

writeShellApplication {
name = "update-wemeet";
runtimeInputs = [
python3
curl
jq
urlencode
moreutils
];
text = ''
while [[ $# -gt 0 ]]; do
Expand All @@ -30,12 +34,17 @@ writeShellApplication {
# query.json is taken from https://meeting.tencent.com/download using browser debugger
query_param=$(jq --raw-output @uri ./query.json)
nonce_param=$(set +o pipefail; tr -dc 'a-zA-Z' </dev/urandom | fold -w 16 | head -n 1)
nonce_param=$(python3 <<EOF
import secrets
import string
print('''.join(secrets.choice(string.ascii_letters) for i in range(16)))
EOF
)
query_url="https://meeting.tencent.com/web-service/query-download-info?q=$query_param&nonce=$nonce_param"
echo "query url: $query_url"
echo "curl"
curl "$query_url" | jq '.' >raw_source.json
curl --verbose "$query_url" | jq '.' >raw_source.json
if [[ -n "$commit_message_file" ]]; then
if [[ -f "$commit_message_file" ]]; then
Expand Down

0 comments on commit d134508

Please sign in to comment.