leopsidom/webmaster-tools-downloads

Downloader.py not returning correct JSON object

Opened this issue · 4 comments

What steps will reproduce the problem?
1. Follow installation steps
2. Run example-simple-download.py

What is the expected output? What do you see instead?
Downloader doesn't work -- isn't returning content back in JSON -- instead 
returning some temporarily moved statement

What version of the product are you using? On what operating system?
latest version of the example scripts and latest version of the google data 
python API as of 1/6/12

Please provide any additional information below.

A sample run:

C:\Users\XXXXX\Desktop\GoogleWebAPI>python example-simple-download.py
https://www.google.com/webmasters/tools/downloads-list?hl=en&siteUrl=neurolex.or
g/wiki  <--- spits out URL downloader.py hits
neurolex.org/wiki
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://www.google.com/webmasters/tools/home?hl=
en&amp;siteUrl=neurolex.org/wiki">here</A>.
</BODY>
</HTML> <-- result from the URL given above

Traceback (most recent call last):
  File "example-simple-download.py", line 39, in <module>
    downloader.DoDownload(website, selected_downloads)
  File "C:\Users\slarson\Desktop\GoogleWebAPI\downloader.py", line 94, in DoDown
load
    sites_json = json.loads(available)
  File "C:\Python26\lib\json\__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "C:\Python26\lib\json\decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python26\lib\json\decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded


Original issue reported on code.google.com by stephen....@gmail.com on 7 Jan 2012 at 3:44

[deleted comment]
siteUrl needs to be fully-qualified with a scheme ("http:// or "https://") and 
end with a trailing slash, since GWT now distinguishes between http and https 
versions of a site, and they're requiring a trailing slash.

Original comment by r...@ninebyblue.com on 27 Jul 2012 at 7:02

I am also facing the similar issue. Even after passing the fully qualified 
domain.

Original comment by arihant....@exateam.com on 28 Oct 2014 at 11:01

Attachments:

@stephen did you find the solution to the above problem as I am stuck at the 
similar point. The sites added in the webmaster are added with a 
fully-qualified domain but it is displaying it with www by default. I have 
tried using all the possible combinations but still getting the above issue.

Original comment by arihant....@exateam.com on 28 Oct 2014 at 11:41