list meta as txt
parent
768b936910
commit
af1429d6d8
25
posts.sh
25
posts.sh
|
|
@ -23,7 +23,7 @@ flags() {
|
|||
|
||||
posts() {
|
||||
local want=()
|
||||
for b64_json in $(list); do
|
||||
for b64_json in $(list_posts); do
|
||||
local json="$(echo "$b64_json" | base64 --decode)"
|
||||
local filename="$(echo "$json" | jq -r .Name)"
|
||||
want+=("$(imported "$json")")
|
||||
|
|
@ -50,6 +50,9 @@ posts() {
|
|||
}
|
||||
|
||||
meta() {
|
||||
for b64_json in $(list_meta); do
|
||||
echo "$b64_json" | base64 --decode | jq .
|
||||
done
|
||||
false
|
||||
}
|
||||
|
||||
|
|
@ -62,8 +65,12 @@ log() {
|
|||
echo "$(date +%H:%M:%S) > $*" >&2
|
||||
}
|
||||
|
||||
list() {
|
||||
gd list_posts
|
||||
list_posts() {
|
||||
RCLONE_OPTS="$RCLONE_OPTS --drive-export-formats zip" gd list_posts
|
||||
}
|
||||
|
||||
list_meta() {
|
||||
RCLONE_OPTS="$RCLONE_OPTS --drive-export-formats txt" gd list_meta
|
||||
}
|
||||
|
||||
up_to_date() {
|
||||
|
|
@ -163,14 +170,20 @@ metadata() {
|
|||
}
|
||||
|
||||
gd() (
|
||||
list_posts() {
|
||||
rc lsjson "$RCLONE_ALIAS:$RCLONE_FOLDER/$RCLONE_FOLDER_POSTS" \
|
||||
list() {
|
||||
rc lsjson "$RCLONE_ALIAS:$RCLONE_FOLDER/$1" \
|
||||
| jq -c .[] \
|
||||
| grep zip\" \
|
||||
| grep -E '(zip|txt)"' \
|
||||
| while read -r line; do
|
||||
echo "$line" | base64
|
||||
done
|
||||
}
|
||||
list_posts() {
|
||||
gd list "$RCLONE_FOLDER_POSTS"
|
||||
}
|
||||
list_meta() {
|
||||
gd list "$RCLONE_FOLDER_META"
|
||||
}
|
||||
pull_posts() {
|
||||
rc copy "$RCLONE_ALIAS:$RCLONE_FOLDER/$RCLONE_FOLDER_POSTS/$1" "$TMPDIR"/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ client_secret = zCqs6bTjTm6TivvdU4BxhR19
|
|||
scope = drive
|
||||
#team_drive = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj
|
||||
#root_folder_id = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj
|
||||
formats = zip,html,rtf,odt,docx,xlsx,pptx,svg
|
||||
#formats = zip,html,rtf,odt,docx,xlsx,pptx,svg
|
||||
token = {"access_token":"ya29.a0ARrdaM-Ca19JFA2LNKls0IsuLLGEF2M2eytTRxRP-YoS73oJvhDOi_xdw48uu0c8q5wrLglRfPBVZM5h48Oe4fJBVTPMR96b1ySUXWCscuh-GtWHV0iF4JxlIqY3bgR6lg5odyiUvXRFauh0JcZ10ozJ7mUy4g","token_type":"Bearer","refresh_token":"1//04sQD4800FsqyCgYIARAAGAQSNwF-L9IrB1_7BV8ScFnqmIz8FNWgXfr80--6VG6KX1pTnneQKAz6Ss3YtxqmCdf2tRBy2ndkhek","expiry":"2021-11-29T13:47:23.55774-07:00"}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue