#Its possibile via bash to create a auto login
1 messages · Page 1 of 1 (latest)
And why bash?
I have a nextcloud on my raspberry pi
and the guy how rent my flat send me pdfs https://portal.leg-wohnen.de/
but how I can catch the pdfs? that they auto upload to my nextcloud
I read something about cron jobs but this is only the time interval how often this bash script should run
@light zodiac @hidden summit
I don't see the point in doing this with bash but sure, you can just send the same request your browser would send
yeah I build this but the link is changeing
and I don't know how to get the generated link
And my main goal is to log in to this portal + go to the download area and download the PDF datein and load it into my nextcloud
and then I create a cron job that the bash run ever 6hours
Yes so do that?
jeah but if I try it it say my access is denied
I think its because the auth part ist missing
So then properly copy the auth part from your browser?
You'll have to make the login request of course
and then take that token?
this is the url I use
but my browser do a link forward to
I think this is the reason why it doesnt work
#!/bin/bash
# URL der Authentifizierungsseite
AUTH_URL="https://portal.leg-wohnen.de/app/"
# Benutzerdaten
USERNAME="dein_benutzername"
PASSWORD="dein_passwort"
# Cookies-Datei
COOKIES_FILE="cookies.txt"
> $COOKIES_FILE
# Authentifizierungsanfrage senden
response=$(curl -s -c $COOKIES_FILE -d "username=$USERNAME&password=$PASSWORD" -X POST $AUTH_URL)
# Überprüfen, ob die Authentifizierung erfolgreich war
if echo "$response" | grep -q "success"; then
echo "Authentifizierung erfolgreich"
else
echo "Authentifizierung fehlgeschlagen"
fi
the only thing that can be is that the link is wrong
but I cant find something like https://..../login
Did you ChatGPT that
Go log in in your browser and check the network tab?
yes I do it but the link is the same
Yeah but that's not the actual log in?
You need the actual request that logs you in wdym
Do it with another language you're more comfortable in then
no idea why you want to use bash
I want to integrate it in my nextcloud
and if there is a api or a ftp server that is easy
just use whatever language you're most comfortable with
wait u mean the comunication between us or programming lanuage?
Programming language💀
kann es sonnst auch auf deutsch schreiben
nimm einfach irgendeine sprache die du kannst und nicht bash💀💀
hahahah ich kann c# php js nur ales semi gut
was mich nervt ist das ich nicht raffe wie ich mich in diese website einloggen kann
Mach halt den Login normal und schau welche request abgeschickt wird beim login
POST irgendwas
ach ne dasist ne get
einfach nur copy paste?
Die Request musst du in deinem Code nachbauen dann kriegst du den token zurück
!