photo / import

Import tool companion for all of the export tools
http://theopenphotoproject.org
Apache License 2.0
16 stars 11 forks source link

Importer getting the wrong filenames #18

Closed ghost closed 11 years ago

ghost commented 11 years ago

Having a strange issue. I used the picasaweb exporter found here https://github.com/olberger/export-picasaweb.git. I was able to export my json files easily.

I have ~/import/import.py and I copied my fetched directory that the picasaweb generated. So my json files are in the correct location. Running import.py from the docs gives the following.

python import.py --host=gregfitz.trovebox.com --consumer-key=*** --consumer-secret=*** --token=*** --token-secret=****

Found a total of 8 files to process
Processing 1 of 8 20120304T200700-5716135985317781906.json ...
Traceback (most recent call last):
  File "import.py", line 91, in <module>
    import_into_openphoto(client)
  File "import.py", line 42, in import_into_openphoto
    resp = client.post('/photo/upload.json', params)
  File "/usr/local/lib/python2.7/dist-packages/openphoto-0.2-py2.7.egg/openphoto/openphoto_http.py", line 87, in post
    return self._process_response(content)
  File "/usr/local/lib/python2.7/dist-packages/openphoto-0.2-py2.7.egg/openphoto/openphoto_http.py", line 128, in _process_response
    response = json.loads(content)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

The reason it fails is because the file doesn't even exist

$ cat fetched/20120304T200700-5716135985317781906.json 
cat: fetched/20120304T200700-5716135985317781906.json: No such file or directory

I tried both trovebox.com and openphoto.me as the hostnames.

_Update:_ It appears it is getting the right file name, but it deletes the json file even if it fails. So, the fact that file doesn't exist isn't the issue. It is actually only failing to parse the json, but then deletes the file.

jmathai commented 11 years ago

I believe the file gets moved and not deleted, correct?

Is the JSON, in fact, invalid? If so paste one of them in here so we can look.

sneakypete81 commented 11 years ago

@gregf: can you please confirm that this is working now?

The openphoto-python library has been renamed to "trovebox", so you'll need to install this first:

   sudo pip install trovebox

See the updated readme for more details.

ghost commented 11 years ago

Sorry about this, but I can't confirm it for you at this point. I have already closed my picasa account and moved everything over to trovebox using another service. Thanks anyways.

sneakypete81 commented 11 years ago

No problem - sorry it took so long to get this resolved.

jmathai commented 11 years ago

@sneakypete81 Thanks for getting around to these!