Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on Python 3.5 #12

Open
hershiyer opened this issue Nov 27, 2015 · 3 comments
Open

Not working on Python 3.5 #12

hershiyer opened this issue Nov 27, 2015 · 3 comments

Comments

@hershiyer
Copy link

Hi,

I tried to port this to 3.5 and can't get it to work after porting. I keep getting the error "You have exceeded today's quota". If you have a workaround or suggestion, please let me know. I can share the code too if you want.

Thanks,

@pedrofaustino
Copy link
Owner

Hi @hershiyer
Unfortunately I'm not actively supporting the code. If you've ported to 3.5, please don't hesitate to make a pull request since it seems the code is working.
That error message comes from a very "dumb" check on the return response on L139. I propose you print out all the headers before L141 to understand if that's indeed the error reported by Google.

@hershiyer
Copy link
Author

Hi @pedrofaustino ,

Thanks for the reply. I did check the content in r.info() on L139 and it seems to be different than what we get in the original version which runs on 2.7. I have included the data below for both versions. I am not able to figure out why I am seeing different responses. If you can think of something I can check, please let me know.

-------------------3.5---------------------------------------------------------------------
Content-Type: text/html; charset=utf-8
Strict-Transport-Security: max-age=10893354; includeSubDomains
X-Frame-Options: DENY
Cache-control: no-cache, no-store
Pragma: no-cache
Expires: Mon, 01-Jan-1990 00:00:00 GMT
P3P: CP="This is not a P3P policy! See https://support.google.com/accounts/answer/151657?hl=en for more info."
Content-Encoding: gzip
Date: Thu, 26 Nov 2015 05:19:45 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Server: GSE
Set-Cookie: GoogleAccountsLocale_session=en; Path=/; Secure; HttpOnly
Set-Cookie: GAPS=1:Ca-VdJS6vxDFrK05IaseVdJAgpJhEw:6OMo9BVgBQqpOG4J;Path=/;Expires=Sat, 25-Nov-2017 05:19:45 GMT;Secure;HttpOnly;Priority=HIGH
Set-Cookie: SID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: HSID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: SSID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: APISID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: SAPISID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: LSID=EXPIRED;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Set-Cookie: NID=73=g5KnYT-Y1jT43_DDTC3Q874RFPyvVf-xE31uhTbN_-HW0TpgMXkUQph4FGu5Ee33OwPEZVxdoZEWFRxRiHhTXIYsRLZKx9ATaNGMD9eEy55OGynSft7bAYqsAdOODPQb;Domain=.google.com;Path=/;Expires=Fri, 27-May-2016 05:19:45 GMT;HttpOnly
Set-Cookie: TAID=EXPIRED;Domain=.google.com;Path=/ads/measurement;Expires=Mon, 01-Jan-1990 00:00:00 GMT
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Connection: close
Transfer-Encoding: chunked

----------------------------2.7-----------------------------------------------------
Content-Type: text/csv; charset=UTF-8
Content-Disposition: Attachment; Filename="report.csv"
Content-Encoding: gzip
Transfer-Encoding: chunked
Date: Thu, 26 Nov 2015 06:38:05 GMT
Expires: Thu, 26 Nov 2015 06:38:05 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Set-Cookie: S=izeitgeist-ad-metrics=HGSkPcf5NYc; Domain=.google.com; Path=/; HttpOnly
Connection: close

@pedrofaustino
Copy link
Owner

The idea of the script is that it allows the download of a CSV file, which would be downloaded in any case with the help of a browser if it weren't for the script. The response that you're getting with 3.5 is text/html so it's not a CSV. Maybe an idea to further troubleshoot would be to save the response body to a file and then open it on a browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants