Closed GoogleCodeExporter closed 8 years ago
Here is my script settings:
outputDirectory = ''
unzipFile = True
verbose = True
daysToDownload = 1
dateToDownload = None
outputFormat = "S_D_%Y_%m_%d.txt.gz"
debug = False
Also on the second bug, here is a run of the program with the custom date and
without:
With:
MacMini-2:Sales johannes$ ./appdailysales.py -D 10/26/2010
-- begin script --
Signing into iTunes Connect web site.
Accessing Sales and Trends reporting web site.
Accessing sales report web page.
Downloading daily sales reports.
Downloading report for: 10/26/2010
Unzipping archive file: S_D_2010_10_26.txt.gz
Traceback (most recent call last):
File "./appdailysales.py", line 476, in <module>
sys.exit(main())
File "./appdailysales.py", line 469, in main
downloadFile(options)
File "./appdailysales.py", line 417, in downloadFile
filebuffer = gzipIO.read()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/gzip.py", line 212, in read
self._read(readsize)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/gzip.py", line 255, in _read
self._read_gzip_header()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/gzip.py", line 156, in _read_gzip_header
raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file
Without (i.e. outputFormat = None):
MacMini-2:Sales johannes$ ./appdailysales.py -D 10/26/2010
-- begin script --
Signing into iTunes Connect web site.
Accessing Sales and Trends reporting web site.
Accessing sales report web page.
Downloading daily sales reports.
Downloading report for: 10/26/2010
10/26/2010 report is not available - try again later.
1 report(s) not available - try again later
Original comment by jonathan...@gmail.com
on 2 Nov 2010 at 8:42
Thanks Jonathan. I'll looking to the problems this evening or tomorrow
(Wednesday) morning at the latest.
Original comment by kirbyt.w...@gmail.com
on 2 Nov 2010 at 9:23
Hi Jonathan,
Thanks for reporting these bugs.
The first, random, bug happens when the vendor default page does not properly
load. My guess to the cause of the problem is something server side. I modified
the script to make up to 3 attempts at redirecting to the vendor default page
before reporting an error. This should eliminate the error as it's been my
experience that the page redirects always works on the second attempt.
The second bug you reported is a good catch. It's possible for the response
from the server to contain HTML and not the actual daily sales report. In the
scenario you gave, the check for the content-disposition was not performed.
This led the script to believe a file was downloaded even when there is no
file. Hence the unzip failure.
Thanks for reporting these. Both issues are fixed in version 2.7 of the script.
-KIRBY
Original comment by kirbyt.w...@gmail.com
on 3 Nov 2010 at 12:28
There is no explaination about how it is fixed.
Original comment by rakeshku...@gmail.com
on 29 Aug 2012 at 10:20
Original issue reported on code.google.com by
jonathan...@gmail.com
on 2 Nov 2010 at 8:35