diff --git a/download.sh b/download.sh index 76cf780..94b5333 100755 --- a/download.sh +++ b/download.sh @@ -64,7 +64,7 @@ sleepbar() echo "Logging in..." curlparams="--no-progress-meter -b ${curl_session_file} -c ${curl_session_file} -k -L" curl ${curlparams} "https://www.heise.de/sso/login" >/dev/null 2>&1 -curl ${curlparams} -F 'forward=' -F "username=${email}" -F "password=${password}" -F 'ajax=1' "https://www.heise.de/sso/login/login" -o ${curl_session_file}.html +curl ${curlparams} --data-urlencode 'forward=' --data-urlencode "username=${email}" --data-urlencode "password=${password}" --data-urlencode 'ajax=1' "https://www.heise.de/sso/login/login" -o ${curl_session_file}.html token1=$(cat ${curl_session_file}.html | sed "s/token/\ntoken/g" | grep ^token | head -1 | cut -f 3 -d '"') token2=$(cat ${curl_session_file}.html | sed "s/token/\ntoken/g" | grep ^token | head -2 | tail -1 | cut -f 3 -d '"') curl ${curlparams} -F "token=${token1}" "https://m.heise.de/sso/login/remote-login" >/dev/null 2>&1 @@ -144,4 +144,4 @@ echo "Summary: ${count_success} files downloaded succesfully, ${count_fail} fail if [ -f "${curl_session_file}" ]; then $verbose && printf "${info} Clearing Session\n" rm ${curl_session_file}.html ${curl_session_file} -fi \ No newline at end of file +fi diff --git a/download_articles.sh b/download_articles.sh index 681cc81..4684c94 100755 --- a/download_articles.sh +++ b/download_articles.sh @@ -64,7 +64,7 @@ sleepbar() echo "Logging in..." curlparams="--no-progress-meter -b ${curl_session_file} -c ${curl_session_file} -k -L" curl ${curlparams} "https://www.heise.de/sso/login" >/dev/null 2>&1 -curl ${curlparams} -F 'forward=' -F "username=${email}" -F "password=${password}" -F 'ajax=1' "https://www.heise.de/sso/login/login" -o ${curl_session_file}.html +curl ${curlparams} --data-urlencode 'forward=' --data-urlencode "username=${email}" --data-urlencode "password=${password}" --data-urlencode 'ajax=1' "https://www.heise.de/sso/login/login" -o ${curl_session_file}.html token1=$(cat ${curl_session_file}.html | sed "s/token/\ntoken/g" | grep ^token | head -1 | cut -f 3 -d '"') token2=$(cat ${curl_session_file}.html | sed "s/token/\ntoken/g" | grep ^token | head -2 | tail -1 | cut -f 3 -d '"') curl ${curlparams} -F "token=${token1}" "https://m.heise.de/sso/login/remote-login" >/dev/null 2>&1