Closed Shir01 closed 8 years ago
While this doesn't help with your Gelbooru issue, just a suggestion for someone who's tried the Gelbooru route. Gelbooru's source is old and they haven't made a new source release in quite a while.
If you do not already have images added to gelbooru consider setting up https://github.com/moebooru/moebooru instead.
You can then use curl -F "login=username" -F "password_hash=passwordhash" -F "post[tags]=%allo%" -F "post[file]=@%path%" -F "post[rating]=%rating%" localhost:8080/post/create
as your image command to add the images through the API. This generates thumbnails properly and correctly adds tags to each image. Since you're running windows you'll likely also need to get curl for windows, but that shouldn't be too difficult.
This works fine with the tutorials in the wiki: https://github.com/zixaphir/gelbooru-fork, although I execute the SQL manually.
@barryanders
This works fine with the tutorials in the wiki: https://github.com/zixaphir/gelbooru-fork, although I execute the SQL manually.
Frankly speaking, I wasn't able to find any tutorial by following the link above, except maybe a small readme file in the "install" folder. None the less, I tried gelbooru-fork, the gelbooru itself works fine, but it is still impossible to add data to MySQL database using Grabber. Thanks anyway.
@Flat
You can then use curl -F "login=username" -F "password_hash=passwordhash" -F "post[tags]=%allo%" -F "post[file]=@%path%" -F "post[rating]=%rating%" localhost:8080/post/create as your image command to add the images through the API. This generates thumbnails properly and correctly adds tags to each image. Since you're running windows you'll likely also need to get curl for windows, but that shouldn't be too difficult.
Thanks for the suggestion. Could you explain to me in more detail where does this command get corresponding tags and file paths?
The command is run through Grabber as seen here
The variables in brackets are replaced by grabber before the command is run. Curl then makes an http post request to the API of moebooru where it uploads the image along with all tags. I have Grabber set to download all images to /tmp/ which in linux is just RAM (so I don't have duplicates of every photo) the downside to this is you can't check for existing images after a reboot.
Sorry for #577, I totally missed it.
The only possible cause for the Error while initializing commands
is failing to open the connection to the database with the credentials provided in Grabber's settings. Either they are incorrect, or the MySQL server is not accessible (if it's a vanilla WampServer installation, it should be).
with the exception of this line in config.php: $mysql_user = "root"; It is not mentioned in the original manual, though without this change Gelbooru can't create new database or access an existing one
It used to be in the default config file, I'll update the wiki accordingly.
But from the fact you created issue #601, it seems you went with Flat's suggestion and started using moebooru. As it seems very easy to setup (more than Gelbooru), I'll add a wiki page for it too.
@Flat Again thanks for the idea and clarification, I wasn't aware of some Grabber variables, before you pointed them out. I think I will stick with the method that you provided above, though at the moment it doesn't work on Windows( #601 )
@Bionus
The only possible cause for the Error while initializing commands is failing to open the connection to the database with the credentials provided in Grabber's settings. Either they are incorrect, or the MySQL server is not accessible (if it's a vanilla WampServer installation, it should be).
I verified credentials, and it seems that they are correct just as MySQL is accessible.(screenshots below) Could you check the setup from wiki on your PC on Windows?
It used to be in the default config file, I'll update the wiki accordingly.
There are more lines that I corrected in order to make gelbooru work as it should, but I forgot to write all of them here. Sorry.
$site_url = "http://localhost/gelbooru/";
$thumbnail_url = "http://localhost/gelbooru/thumbnails/";
instead of
$site_url = "http://localhost/gelbooru";
$thumbnail_url = "http://gelbooru.com/thumbnails/";
Without this correction you'll get "The requested URL /gelbooruindex.php was not found on this server" error.
But from the fact you created issue #601, it seems you went with Flat's suggestion and started using moebooru. As it seems very easy to setup (more than Gelbooru), I'll add a wiki page for it too.
Actually, it's the opposite, it is much easier to deploy Gelbooru than Moebooru, at least for me. The main reason is Ruby and the way it works on Windows. I encountered numerous errors during Moebooru installation. "Bundle install" failed due to SSL error so I had to download appropriate SSL cert file and add it to environment variables, ExecJS returned weird errors so I had to install Node.js in order to change the runtime that ExecJS uses, "bundle exec rake db:create" and several other commands failed so I had to edit "Gemfile" and cherry-pick suitable version of Ruby, repeating "uninstall->install->check if everything works" cycle several times. Eventually, I got fed up with Ruby and installed Moebooru port to PHP called Myimouto, and it works like a charm. Appropriate cURL command that is needed to upload images to Myimouto can be found in #601 .
I verified credentials, and it seems that they are correct just as MySQL is accessible.(screenshots below) Could you check the setup from wiki on your PC on Windows?
As I can see in your screenshots, it seems you added superflous quotes in your settings. Instead of "localhost"
, use only localhost
, same goes for other fields. Double quotes are not supposed to be put in the settings (same goes for your empty ""
start command that should be totally empty).
Remove these quotes and it should work.
There are more lines that I corrected in order to make gelbooru work as it should, but I forgot to write all of them here. Sorry.
No problem, I'll update the wiki and try to set a Gelbooru up on my computer from scratch soon.
Actually, it's the opposite, it is much easier to deploy Gelbooru than Moebooru, at least for me. The main reason is Ruby and the way it works on Windows.
Indeed, if it's Ruby it's much harder on Windows than Linux.
Eventually, I got fed up with Ruby and installed Moebooru port to PHP called Myimouto, and it works like a charm. Appropriate cURL command that is needed to upload images to Myimouto can be found in #601 .
In that case I'll add a MyImouto tutorial instead, if Gelbooru is being too old. As for #601, it'll be fixed in the next 4.7.0 update I'm working on now. It should be released soon (supposedly by the end of the week).
@Bionus
As I can see in your screenshots, it seems you added superflous quotes in your settings. Instead of "localhost", use only localhost, same goes for other fields. Double quotes are not supposed to be put in the settings (same goes for your empty "" start command that should be totally empty).
Sorry I screwed up so badly. :pensive: And I seriously thought that quotation marks are necessary. Again I'm really sorry for wasting your time.
In that case I'll add a MyImouto tutorial instead, if Gelbooru is being too old. As for #601, it'll be fixed in the next 4.7.0 update I'm working on now. It should be released soon (supposedly by the end of the week).
That is great! Thanks a lot.
Ah, I just realized this was for Windows. I'm sorry, if I had realized that, I could have confirmed that the SQL definitely works directly. Now on Mac, I haven't gotten it to work properly, but I also haven't tried recently. That's why when I answered above, I said I execute the SQL manually. Anyway, glad to see you got your problem solved.
Hi Bionus.
Though, it seems that the previously mentioned issue(#577) is solved with the update to 4.6.0 version, Grabber is still unable to add images to the local version of gelbooru. To be exact, Grabber is not adding appropriate data(tags, etc) to the database for some reason. Grabber log shows that there was an error([18:09:57.367] line) while initializing commands and that's all. Here is full log:
Could you please investigate this?
What steps will reproduce the problem?
$mysql_user = "root";
It is not mentioned in the original manual, though without this change Gelbooru can't create new database or access an existing one.What is the expected behavior? What do you get instead?
According to the WIKI every time I download a pack of images, they will be added to local version of Gelbooru running on the WampServer, but Grabber only copies images to the image directory in Gelbooru folder without adding any records to the database.
What version of the program are you using? On what operating system?
Guest OS running on VMware Windows 8.1(9600) x64 Grabber 4.6.0 WampServer 2.2e x64 (https://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.2/wampserver2.2e/wampserver2.2e-php5.4.3-httpd-2.4.2_PATCH001-x64.exe/download) Gelbooru 0.1.11
Host OS Windows 7 SP1(7601) x64 Grabber 4.6.0 WampServer 3.0.4 x64 apache2.4.18 mysql5.7.11 php5.6.19 (https://sourceforge.net/projects/wampserver/files/WampServer%203/WampServer%203.0.0/wampserver3.0.4_x64_apache2.4.18_mysql5.7.11_php5.6.19-7.0.4.exe/download) Gelbooru 0.1.11