| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 | #!/bin/bashPFAD=$(dirname "$(readlink -f "$0")")function beenden {  rm -f $COOKIEFILE  rm -f landingpage.txt  rm -f searchresults.txt  umount /scripts/housofusenet/mount  exit $1}USERAGENT='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0'COOKIEFILE="/tmp/hou-cookie.txt"curl -s -H "${USERAGENT}" 'https://house-of-usenet.com/member.php?action=login' --cookie-jar ${COOKIEFILE} -o ${PFAD}/landingpage.txtPOSTKEY=$(grep -m 1 '<input name="my_post_key"' ${PFAD}/landingpage.txt | cut -d "=" -f 4 | cut -d '"' -f2)#echo "Postkey: $POSTKEY"#cat $COOKIEFILEcurl -s -X POST -H "${USERAGENT}" --referer 'https://house-of-usenet.com/member.php?action=login' -b ${COOKIEFILE} --cookie-jar ${COOKIEFILE} -F "username=bla1bla1" -F "password=bla2bla2" -F "action=do_login" -F "my_post_key=${POSTKEY}" -F "remember=yes" 'https://house-of-usenet.com/member.php'#später curl mit -b cookie benutzen, nachdem eingeloggtSEARCHPREFIX='https://house-of-usenet.com/search.php?action=do_search&keywords='SEARCHPOSTFIX='&postthread=2&author=&matchusername=1&findthreadst=1&numreplies=&postdate=0&pddir=1&threadprefix%5B%5D=any&sortby=lastpost&sortordr=desc&showresults=threads&forums%5B%5D=1865&submit=Suche'mount -t cifs //nhi-to-sw-serv.klenzel.net/Videos$ ${PFAD}/mount -o credentials=${PFAD}/smbcredentials,iocharset=utf8,sec=ntlmssp,vers=2.0,dir_mode=0770if [ $? -ne 0 ] ; then  echo "Error while mounting"  beenden 1fifind ${PFAD}/mount/Filme/h.264\ -\ 1080p/ -type d -printf '%f\n' | while read FILM; do  rm -f ${PFAD}/searchresults.txt  FILMHTML=$(echo $FILM | sed -f ${PFAD}/url_escape.sed)  SEARCHURL=${SEARCHPREFIX}${FILMHTML}${SEARCHPOSTFIX}  echo $FILMHTML  echo $SEARCHURL  curl -s -L -H "${USERAGENT}" -b ${COOKIEFILE} "${SEARCHURL}" -o ${PFAD}/searchresults.txt  grep "keine Ergebnisse gefunden" ${PFAD}/searchresults.txt > /dev/null  if [ $? -eq 0 ] ; then    echo "Nichts gefunden"    continue  fi  grep "kürzer als erlaubt" ${PFAD}/searchresults.txt > /dev/null  if [ $? -eq 0 ] ; then    echo "Suchbegriff zu kurz"    continue  fi  grep "showthread.php" ${PFAD}/searchresults.txt | grep "subject_old" | sed 's@showthread.php@https://house-of-usenet.com/showthread.php@g' > "${PFAD}/results/${FILM}.html"  echo "##############################" >> "${PFAD}/results/${FILM}.html"  echo "Filmtitel auf Festplatte: ${FILM}" >> "${PFAD}/results/${FILM}.html"  echo "##############################"  rm -f ${PFAD}/searchresults.txt  sleep 60donebeenden 0
 |