Comments (7)
+1
from tgmount.
ATM I did workaround, but It's not satisfying ;/
#!/bin/bash
shopt -s nullglob
ID="$1"
DIR="$2"
TGDIR="$DIR/tg"
ZIPDIR="$DIR/zips"
mount_zip(){
zip="$1"
zipd="$ZIPDIR/$(basename "$zip")"
mkdir -p "$zipd"
echo Mounting $zip
archivemount -o readonly "$zip" "$zipd"
echo Mounted $zip
}
mount_zips(){
for zip in $TGDIR/*.zip; do
mount_zip "$zip" &
done
}
cleanup(){
for dir in $ZIPDIR/*; do
umount "$dir"
rmdir "$dir"
done
}
trap cleanup EXIT
mkdir -p "$TGDIR"
./tgmount.py --all-files --reverse --id $ID --mount "$TGDIR" |&
while read line; do
echo tgmount: $line
if [[ "$line" =~ "Mounting " ]]; then
sleep 1
echo Mounted telegram, starting mounting zips.
mount_zips &
fi
if [[ "$line" =~ "New file: " ]]; then
mid="$(awk 'match($0, /message_id'\'': [0-9]+?,/) { print substr($0, RSTART + 13, RLENGTH - 14) }' <<< $line)"
fname="$(echo $TGDIR/$mid\ *)"
echo New file: $fname
[[ "$fname" = *.zip ]] && mount_zip "$fname"
fi
done
from tgmount.
You forgot to mention that https://github.com/cybernoid/archivemount is used to mount the zip files
from tgmount.
I found project better fitting use case: https://github.com/openscopeproject/ZipROFS
If you'd like to integrate this feature in tgmount - it seems to be pretty good base for your work.
If not, I'll just use this as next layer ;)
from tgmount.
I'm currently working on the the feature :) thank you for the link. It is going to be useful to me
from tgmount.
@nktknshn any updates? I see only master branch
from tgmount.
I added this feature in the new version of tgmount. Try it out
https://github.com/nktknshn/tgmount-ng
from tgmount.
Related Issues (13)
- Bot support HOT 4
- Block on file open request HOT 2
- new file detection doesn't work in non-supergroup groups
- New file doesn't trigger inotify event HOT 2
- Blocks any reads after few hours of operation HOT 42
- Keep the same naming scheme HOT 1
- Way to specify file types to mount HOT 2
- Sometimes file's are corrupted HOT 1
- timeout raises IOError
- Crash when trying to use latest telethon
- Could not find the input entity for PeerUser
- TypeError: 'Message' object is not subscriptable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tgmount.