Coder Social home page Coder Social logo

fetch-external-images's People

Contributors

v12mike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fetch-external-images's Issues

Regex img src URLs

extract_external_links.php

img src example: https://www.bing.com/th?id=ON.39C32F43EC4B01E928A7C0637186511F&pid=News&h=367&w=700

(phpBB 3.2 format)

will not be extracted by regex:

"if (preg_match_all('~<img src="(http[^\/]+?//([^\/]+)?/.+?[^\.]+?.([a-z]+?))">~i', $post_text, $matches))"

I've a lot more of these "dynamic image" urls which are not cached/harvested locally because they are not fetched, because this regex will fail.

I tried to modify it but later it requires tables filled like link and ext. Its a valid image within src="" or tag [img]src[/src].

Can you improve that the fetcher will really get all images between tags/srces - while ignoring the extensions and url format? That way it would support about 10-20% more images on my board which are currently not fetchable because of specified links. Maybe get rid of $link and $ext completely and just regex * between src="" and [img]src[/img] tags?

Not just photobucket

The most recent version all external images, not just those hosted on PhotoBucket. Yet the description of extract_external_links.php still mentions PhotoBucket:

/**

  • This script will scan all of the text in posts looking for
  • inline images which link to photobucket.com and add them to
  • tables in the database.
    */

Running download script on a shared server results in an error.

I've had success in using this script on various VPS's with phpBB installed, but sadly I can't get it to work on a virtual shared server. When running the download script on a shared server it produces the following output (limited to 1 MAXIMUM_FILES_TO_FETCH):

[phpBB Debug] PHP Warning: in file [ROOT]/scripts/download_external_images.php on line 107: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
status 0 FAIL : http://i60.photobucket.com/<rest_of_url>.jpg

I believe it's common practice to set an open_basedir on shared servers, so this probably affects more servers then just the one I'm trying to fix now. Removing line 107 or setting it to 0 instead of 1 doesn't work either, since the script then can't fetch the image from the 3rd party hosting site.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.