Announcement

#1 2017-05-10 17:39:08

RogerA
Member
2017-04-06
8

Import Tree and V2.9

Hi,
I have been trying to use the import tree to upload a directory structure to my piwigo.com site and so far have been unable to get it to work.  It is probably a simple mistake but I would be grateful if anyone can point out my error.

I followed the instructions in the wiki and on the official page using the following command line:

perl piwigo_import_tree.pl --base_url=https://mraths.piwigo.com --user=mraths password=xxxxxxxx --directory = "C:/Users/Roger/Documents/History Club/Taged Images/Test1";

I tried several variants of this including adding a parent directory:

perl piwigo_import_tree.pl --base_url=https://mraths.piwigo.com --user=mraths password=xxxxxxxxx --directory = "C:/Users/Roger/Documents/History Club/Taged Images/Test1" --parent_album_id=2;


Test1 is the top directory of the albums I want to transfer and I am running this from the directory with Test1 in.  I read the album id directly from Piwigo.com.


The error I get is:

Cant stat=: No such file or directory
at piwigo_import_tree.pl line 121

Any insights or help anyone can offer on how to proceed would be much appreciated.

Regards

RogerA


Windows 10
Strawberry Perl
Piwigo version: 2.9
Piwigo.com

Piwigo URL: http://mraths.piwigo.com

Offline

 

#2 2017-05-12 21:13:07

RogerA
Member
2017-04-06
8

Re: Import Tree and V2.9

Hi,
After learning a little Perl and investigating I discovered my mistake. The correct command line is as follows:

perl piwigo_import_tree.pl --base_url=https://mraths.piwigo.com --user=mraths password=xxxxxxxx --directory="C:/Users/Roger/Documents/History Club/Taged Images/Test1"

There should be no spaces before or after the =  and no ; is required.

I hope this might be useful to anyway starting to use this tool.

Regards

Roger

Last edited by RogerA (2017-05-12 21:13:38)

Offline

 

#3 2017-05-13 12:20:04

RogerA
Member
2017-04-06
8

Re: Import Tree and V2.9

Hi,
Despite the fact that I now have this perl script running it does not upload any images to the gallery and my investigations so far indicate that this is because it is unable to create albums. I am running a simple test with a parent and child directory on my PC. I created one album on Piwigo.com with a single image in it.

If I run it without -- parent_album_id the first time it loads all the images and trys to create the parent(Album1) and child albums(Album2) but reports Uninitialised  value $params("id") in hash element at piwigo_import_tree.pl severl differen line number(202,206,141,156,165). The images are uploaded as I see a message, completed (701ms, photo) or equivalent for all images. However nothing in the gallery.

The .piwigo_import_tree.txt that is created in each directory confirms the images are uploaded but album_id is not assigned.

If I run this a second time it reports he images are in cache and there is nothing to upload.

If I run it with -- parent_album_id = 5 (The album id of the single album on Piwigo Album1) the error is different - cannot open file MRATHS/Album2/.piwigo_import_tree.txt for writing at piwigo_import_tree.pl at line 515.  Again there are no images uploaded to teh gallery. I assume this is because it cannot create Album2.

The .piwigo_import_tree.txt that is created in each directory confirms the images are uploaded but album_id is not assigned.

The summary is that in my case due to an error on my part or changes in v2.9  I cannot create albums with this script.  Any help or suggestion on how to fix this would be most welcome.

Regards

RogerA

Offline

 

#4 2017-05-19 15:44:57

RogerA
Member
2017-04-06
8

Re: Import Tree and V2.9

Hi,
Ok I finally got to the bottom of this and now know a little bit more Perl and something about the api!  It turned out none of this was really needed though as there is a simple error in the command line call the dashes are missing in front of password and so I was never logged in!  That is why I could never add a an album.

perl piwigo_import_tree.pl --base_url=https://mraths.piwigo.com --user=mraths --password=xxxxxxxx --directory="C:/Users/Roger/Documents/History Club/Taged Images/Test1"

I can confirm that this works fine with 2.9.


Regards

RogerA

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact