Remote Images Grabber

This plugin fetches images on the list of URLs, save them into the blog media directory, and attaches to the appointed post.

Use it instead of tiresome saving images from the internet and uploading them to your blog.

Installation

  1. Unzip the plugin archive and upload the ‘remote-images-grabber’ folder to the plugins directory, usually ‘wp-content/plugins’ (or use the native wordpress plugin installation interface).
  2. Activate the plugin through the ‘Plugins’ menu in WordPress, then ‘Images Grabber’ link appears in the Mediafiles submenu.
  3. On the ‘Images Grabber’ page, specify the post ID where images should be attached (if such post doesn’t exist, images stay unattached), a list of images you wish to grab, one link by line, and push ‘Go!’ button. That’s all!

(I recommend to use [gallery] or other gallery shortcode in those appointed post, then grabbed images will appear in the post automatically).

Changelog

Version 0.6

  • more changes in recognizing image URLs (thanks to Thomas who reported a bug)
  • base URL field value is kept in cookies now and filled in automatically until you change it or close your browser.

Version 0.5.

  • now grabber works from a tab in the upload box and attaches grabbed files autamatically to the post you are editing;
  • lower file size limit added (ignoring icons etc.);
  • base URL for grabbing images from relative paths;

Version 0.2. Now can grab images by links on a given web page.
Version 0.1. It’s simple but it works.

Download Remote Images Grabber

from WordPress Plugin Directory

Please leave your comments (English or Russian).

70 комментария на «Remote Images Grabber»

  1. Hello,
    first thank you for the plug in.
    I tried it, hopwever it doesn’t work for me, because I have wordpress installed in a subfolder. So I get a 404 when I try to get some images.Please can you tell me wich part I have to edit so the wp-admin/upload.php can be found? (mine is in /x/x/wp-admin/upload.php
    Thank you :)

  2. Hello, Peet,
    I’m not sure but I believe the wordpress installation path does not matter, and you have not edit anywhere in the plugin code. When the remote server replies with 404 error it means the URL you request is incorrect, but nevertheless the server may output some content that you can see in a browser. If you provide me some URLs where 404 errors occure I test them from my server.

  3. Hello Andrey,
    It is not the remote server that gives the error,it’s my own server because it searches the upload.php in the wp-admin wich is not there.My wp admin is in url/x/x/wp-admin/upload.php and not in url/wp-admin/upload.php.Thanks for the reply :)

  4. Peet, try to replace the line 142 in remote-images-grabber.php with the following:

    <form method="post" action="http://<?php echo
    $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ?>" name="rigr_form"
    id="rigr_form">

  5. I fixed it with adding the two subfolders to action=»/x/x/wp-admin/upload.php?page=remote_images_grabber and it works like a charm :) Thank you very much for this great plugin and your support!

  6. this looks like what i need. do you have shortcodes that i can use for this so i can do this programmatically. my site have 30-40k posts and inserting them manually will take a long time. i prefer to use this with a shortcode that will accept variable names. thanks.

  7. Teodolfo, this plugin does not modify the content of existing posts. I did consider a function like insert shortcodes into posts when writing this plugin, but it may add you a work if you decide to delete inserted shortcodes later.

    You can modify posts «wholesale» by MySQL query like that:
    UPDATE wp_posts SET post_content= CONCAT('[gallery] ', post_content) WHERE ID IN(1,3,5,6,7,9);

  8. It worked, but how can I posted the images automaticly the post?

    I’ve read the intruction but I am not understand yet? heres explaination fro you «(I recommend to use [gallery] or other gallery shortcode in those appointed post, then grabbed images will appear in the post automatically).»

    Can you please put screenshot(step by step) how to use it? so I can grab the images and post automatically

  9. Second question, How do you make your script can grab Big pictures only?? because when I run the script…all the pictures even very small,thumbnail was included and I don’t want the script grab the small pictures.

    I want your script grab «big pictures only», lets say the script grab pictures with «minimal size of limit 30 kb»<<< in this case your script only grab pictures that "bigger than 30kb"

    The reason I want this because your script grabbed all the pictures from very small to very big, which is kind of mess.

    If your script can grab only big original pictures (not thumbnail pictures), it will be very great.

    Whats code should I add?

    Or can you customized your script litle bit and send it to my email please..

  10. mika, I agree, your idea to set the minimum filesize of images is good. I add this option in the next version.

    Now plugin checks maximun filesize (234-239 lines in the plugin.php); try to add after 234th line
    $file_size= filesize($upload2['file']);
    the following lines:
    if ( $file_size < 10240 ) {
    @unlink($upload2['file']);
    return new WP_Error( 'import_file_error', 'Remote file is less than 10K' );
    }

  11. Андрей, добрый день,
    мог бы ты ответить на мой мейл. Очень нужна помощь по настройки галереи под WP.
    С уважением, Алексей.

  12. Андрей, сорь, допишу. Я просто не нашел на твоем сайте как с тобой связаться. Напиши плз что-нибудь на ######
    Я отвечу и опишу какая проблема есть.\
    Спасиб)

  13. Thanks for your work — so far. It’s great start, but it has one flaw (at least for me):

    It doesn’t appear where I would like it to appear: Right at the point where I usually upload pictures :)

    Is it possible to add a «grab from url» option in the box that is used to upload pictures when we write blogposts? That would be absolutely fabulous!

  14. Thank you for an idea, Dominik. I’m not sure is it possible to add a field for «Grabber» just into the upload box. I try to find out.

  15. странно, но у меня стабильная ошибка
    Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home2/test/wp-content/plugins/remote-images-grabber/remote-images-grabber.php on line 65

    Warning: unlink() [function.unlink]: Unable to access in /home2/test/wp-content/plugins/remote-images-grabber/remote-images-grabber.php on line 70

    Nothing to grab.

  16. Stan, можете уточнить, это у вас наблюдается только с некоторыми сайтами, с которых выкачиваете картинки, или с любыми?

  17. Hi Andrey and thank you for the plugin.
    I wonder if there is a way to automatically have the link URL of the grabbed images set to «Link to image». At the moment the field is left empty.
    Is there some code I can add and where exactly? (I can ONLY follow instructions and know nothing of php, sorry).
    thank you in advance

  18. Привет!
    Классный плагин
    Раньше пользовался другим но поставив этот к первому уже не возвращался!
    хорошо бы еще добавить функции замены оригинальных имен
    1 — изменять имена файлов по «Заголовок для файла или группы файлов:» и номера по порядку пример rim-1, rim-2, rim-3
    2 — генерировать случайные пример 354780025.

  19. Привет, спасибо за плагин, но советую вам вылаживать скрины, очень уж удобно со скринами, сразу представляешь с чем имеешь дело, Спасибо)

  20. Thanks so much for your plugin! Its been really helpful so far. I’ve run into a problem using it and I don’t know what to do. It was working just fine for a while but now it has started giving me errors like this every time I try to use it:

    http://jonglassberg.lt11.com/files/2011/04/Screen-shot-2011-04-01-at-11.42.14-AM1.png — error: You have 12041 KB diskspace used but 10240 allowed.

    I can’t find any restrictions anywhere that would be limiting this. I can add new media files no problem. I’ve set maximum file size upload limits to 0 (unlimited). Any help would be appreciated! Thank you so much!

  21. Hi Jordan,

    it’s look like you are using WPMU/Multisite installation of wordpress that has an option to limit per blog allowed diskspace — default is 10M; in case you are not superadmin usual upload will return errors too.

    The plugin checks allowed diskspace size and interrupts grabbing when it is exceeded.

    I guess there are some ways to solve the problem:

    1. Increase the default per blog allowed diskspace in the site settings section (site superadmin level required).
    2. Increase the allowed diskspace for a specific blog by adding an option ‘blog_upload_space’, e. g. via phpMyAdmin:

    INSERT INTO wp_XXX_options (option_id, option_name, option_value) VALUES (0, 'blog_upload_space', '100');

    where XXX is the id of a blog, 100 — the diskspace value for this blog, megabytes.

    3. In the plugin source remote-images-grabber.php: comment or delete checkup of limitation (lines from 256 to 267).

    To keep order I recommend #1 or #2. )

  22. was just checking images on my site, and when you open the original image, it points you to the original image from another site where I grabbed the image.

    That means that if the other site is offline, my images will be offline too.

    Is there a way that the images would be downloed to my server?

  23. Hello Jack, this plugin copies images from another site to your WP based site but does not change HTML-code of your pages/posts.

  24. remote image grabbing by url (.html) doesnt seem to work, gices up a no response from server, when infact when doing a wp_get_http manually it gives a response, looks like its trying to parse the .jpg/.gif etc before the http get. should be done after shoudlnt it?

  25. your plugin is great
    one flow is it is not able to download from blogspot

    try this url (remove spaces):
    http :// 1.bp.blogspot .com/-JgtGnV0hPs0/TsueLiOQ-MI/AAAAAAAABEc/O2ldIrWMX1I/s1600/%25D8%25B9%25D8%25AF%25D9%2586+%25D8%25B6%25D8%25AF+%25D9%25811.jpg

  26. your plugin is great

    just one flow
    it didnt work for images from blogspot

  27. Dear Sir,
    thanks for this useful plugin.

    We want to echo the image url for the grabbed image,
    that leads to the full image gallery.

    So is it possible to create a single post for every grabbed image and
    insert the image in the post directly including image url?

    Thanks for support

    Best Regards

  28. Hello Cartman,

    please look at your uploaded images list at http:// yoursite.com/wp-admin/upload.php — grabbed images are saved in your wordpress site as posts of ‘attachment’ type and every image has it’s ID (unique number), and WordPress can display any uploaded image as a post at http:// yoursite.com/?attachment_id=ID, e.g. http://andrey.eto-ya.com/?attachment_id=913 — it’s WordPress built-in feature.

    Another way is to add this code: [gallery] into usual post, then click on the Upload button above the post editor textarea, then click on Image Grabber tab and grab an image — it will be attached to the post you are editing now. After saving your post, WordPress will display this image instead of [gallery] code.

  29. Dear Sir,
    we want to display external site galeries on our post.

    However we have a hard time displaying large image galleries, because of the loading time.

    Is there a way that all imported images will be linked to the image owner’s server?
    In other words, to import the images url directly into wordpress posts.

    Its like the WPeMatico plugin by Esteban Truelsegaard, which we highly recommend anyone
    who wants to import rss feeds.

    Anyway thanks for your support and this wonderful piece of work

    Best Regards

  30. Dear Sir,

    we have a hard time displaying large image galleries, because of the loading time.

    Is there a way, that all grabbed images will be linked to the image owner’s server?
    In other words, so that just the image url will be added into wordpress posts, without
    attachement or saving them directly into the blog media directory.

    Its like the WPeMatico by Esteban Truelsegaard, which we highly recommend anyone
    who wants to import rss feeds.

    Anyway thanks for your support and your great plugin

    Best Regards

  31. Hello Cartman, do you mean you have a list of image URLs like:
    http://externalsite.com/image1.jpg
    http://externalsite.com/image2.jpg
    http://externalsite.com/image3.jpg
    and you need to embed all these images into your wp post?

    I guess you need to create or find some plugin that converts this list into html code. I do not know about appropriate plugins but (imho) creatiting such plugin is not very hard task for a php programmer acquainted with wordpress.

  32. this plugin not work for me, «error: Remote server did not respond». it’s from CDN, how could server did not response.
    any solutions ?

  33. Joachim, that is because image files in IMG tags are presented via relative path, like this: <img src='_MG_9129.jpg' width='946' height='709'>, but the plugin does not recognize relative paths by default.
    To grab these images, just enter http://knotan.com/pics/lost/ into the «Base URL» field.

  34. i have the same problem as john.
    when having
    http://###
    http://###
    http://###
    http://###
    http://###
    only the first image is grabed (ok) and all others are «lost» / not displayed to be grabed and so on

    haven’t looked in this plugin — when there is a 404 or an image-protection cause of a missing refferer (hope you insert one with the image-url^^) — maybe the plugin can show the error.

  35. Hi,

    I also use «Custom Upload Dir» plugin and I setup the upload folder to look like this : wp-content/uploads/%year%/%monthnum%/%day%

    Your plugin uses media directory and the files are uploaded to wp-content/uploads/%year%/%monthnum%/

    My question is: How can I modify the media directory to look like wp-content/uploads/%year%/%monthnum%/%day%

  36. Hello, Aihi,
    try to change these lines (72-75) in the custom_upload_dir.php:

    function cud_pre_upload($file){
        add_filter('upload_dir', 'cud_custom_upload_dir');
        return $file;
    }

    to:

    function cud_pre_upload($file){
        return $file;
    }
    add_filter('upload_dir', 'cud_custom_upload_dir');

    Then Custom Upload Dir will work correctly with Remote Images Grabber (not sure it is a best solution but I see it works).

  37. it works! Thank you!

    I have one more question:
    I want to set a title for more files. for example: Name_file 1,Name_file 2,Name_file 3, etc
    The pluging save them like that: Name_file , Name_file 1, Name_file 2

    I want to start remane from Name_file 1

  38. Just add URL of some dummy image in the top of html code that you grab, and then delete this unnecessary image. I agree, it is not cool, but the plugin follows wordpress file naming scheme.

  39. Здравствуйте, Андрей!
    У меня такая проблема. На локальном сервере плагин работает хорошо. А вот на хостинге при попытке загрузить картинки с любого URL, пишет что размер файла 0 байт и выдает «Nothing to grab».
    Не подскажите в чем может быть проблема?

  40. Когда загружаю картинку, пишет что загрузил успешно. В галерее появляется название картинки, а в папке картинки нет. Может надо на какой-то папке проставить права? На папке wordpress с изображениями стоят права 777.

  41. Я чаще всего использую хостинги, в которых не нужно устанавливать права 777 (обычно 755, и всё работает отлично). Попробуйте закачать на сайт картинку с компьютера.

  42. Попробуйте включить в вордпресс debug-режим и посмотрите, какие ошибки возникают при добавлении картинки.

  43. Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File(/var/tmp) is not within the allowed path(s): (/home/weez/data:.) in /home/weez/data/www/site.com/wp-content/plugins/remote-images-grabber/remote-images-grabber.php on line 64

    Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/weez/data/www/site.com/wp-content/plugins/remote-images-grabber/remote-images-grabber.php on line 72

  44. Чего-то подобного я и ожидал. Спросите у своего хостера, почему не работает функция tempnam().

  45. Oh my god, you saved me so much time. Thank you so so much for writing this plugin. If only there were an easy way to replace all the existing URL’s to point to the new files….

  46. Nice plugin. I am actually looking for a plugin that will automatically fetch and post image based on a selected category.

  47. Plugin is not working, please check…

    Error:

    can not create attachment for Array[file]

    can not create attachment for Array[file]

    can not create attachment for Array[file]

    can not create attachment for Array[file]

Комментирование закрыто.