File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ cex=$?; test "$cex" -ne "0" && { log "curl exit error code: $cex"; exit; }
23
23
curl -s --retry $rtry -m $tout -A " $agent " -b " $cookie " -c " $cookie " https://www.packtpub.com/packt/offers/free-learning > packt_daily.html
24
24
cex=$? ; test " $cex " -ne " 0" && { log " curl exit error code: $cex " ; exit ; }
25
25
26
- title=$( grep " dotd-title" -A 2 packt_daily.html | tail -1 | sed ' s/^[^A -Za-z]*//;s/[\t ]*<\/h2>$//' )
26
+ title=$( grep " dotd-title" -A 2 packt_daily.html | tail -1 | sed ' s/^[^0-9A -Za-z]*//;s/[\t ]*<\/h2>$//' )
27
27
echo " Today's free e-book: $title "
28
28
log " Today's free e-book: $title "
29
29
@@ -38,13 +38,13 @@ log "e-Book claimed"
38
38
book=$( echo $claim | sed ' s/.*\/\([0-9]*\)\/.*/\1/' )
39
39
40
40
# PDF download
41
- curl -s --retry $rtry -A " $agent " -b " $cookie " -c " $cookie " " https://www.packtpub.com/ebook_download/$book /pdf" > " $dldir /$title .pdf"
41
+ curl -s -L - -retry $rtry -A " $agent " -b " $cookie " -c " $cookie " " https://www.packtpub.com/ebook_download/$book /pdf" > " $dldir /$title .pdf"
42
42
cex=$? ; test " $cex " -ne " 0" && { log " curl exit error code: $cex " ; exit ; }
43
43
echo " PDF downloaded"
44
44
log " PDF downloaded"
45
45
46
46
# Mobi download
47
- curl -s --retry $rtry -A " $agent " -b " $cookie " -c " $cookie " " https://www.packtpub.com/ebook_download/$book /mobi" > " $dldir /$title .mobi"
47
+ curl -s -L - -retry $rtry -A " $agent " -b " $cookie " -c " $cookie " " https://www.packtpub.com/ebook_download/$book /mobi" > " $dldir /$title .mobi"
48
48
cex=$? ; test " $cex " -ne " 0" && { log " curl exit error code: $cex " ; exit ; }
49
49
echo " Mobi downloaded"
50
50
log " Mobi downloaded"
You can’t perform that action at this time.
0 commit comments