vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Import External Images (https://vborg.vbsupport.ru/showthread.php?t=253309)

andy626 07-03-2017 07:33 AM

Quote:

Originally Posted by Kane@airrifle (Post 2588078)
Bad news, in testing I have found that the image is replace with the PB shakedown thumbnail

Oh crap, disaster!

But a million thank you's for testing this for me!

I think I still need this mod for Tapatalk and Forum Runner, etc.

Does it completely ruin the thread if I was to somehow find a script to find and replace photobucket.com/member/image123.jpg to myforum.com/member/image123 etc.

i.e: is the localised image link still the correct name/folder format of the original image or is the new image name the 3rd party thumbnail image link..... <--- Not even sure that will make sense to you :confused:

Appreciate your help though!

andy626 07-03-2017 07:52 AM

This is a bit of a disaster for me and I'm sure hundreds of forums out there surely?

What would be good if you can somehow get members to download their albums and photos off PB.

Then you upload it your server and somehow (???) run an attachment URL find and replace PB.com/member/ to yourforum.com/member/

Once that's been done, you don't need PB and then run this script here for the rest of the 3rd party hosting.

I never knew how vulnerable we are as forum owners when companies can suddenly change their ways and charge $399 per year to show your photos on 3rd party, crazy!

Kane@airrifle 07-03-2017 09:41 AM

This product will only download and replace images in the post table that are between the [img] [ /img] tags so I don't t think it can help you with member profile pics and member albums.

The localised path will be designated by you on setup, you have a choice whether or not to keep the original filenames or to have the mod change them to a numeric value name.

It is a disaster and I am sure there are millions of websites affected. I am pretty glad I installed this mod shortly after Imageshack pulled the same stunt that Photobucket is doing now.

andy626 07-04-2017 05:43 AM

Thanks again kane, I'm running this mod now excluding PB and its working great!

Can't believe I didn't have this on my forum earlier!!!

I'm asking for any help to somehow run an attachment find and replace URL script in this thread below if anyone can help I would be extremely grateful...

https://vborg.vbsupport.ru/showthread.php?p=2588046

The_Hawk 07-12-2017 11:03 PM

I'm in the same boat as everyone else since the photobucket issues. Sadly this mod has been on my todo list for almost a year and I never quite got there :(

It's now installed and running nicely (excluding photobucket at the moment), although with a shade under 1.1 million posts to trawl through it's going to take a while. I'm on a dedicated box so have pushed it up to 1000 posts per run and it seems to be coping (although I had to disable URL caching as it ran out of memory very quickly).

On the photobucket side there are a range of plugin for Chrome which claim to get around the issue, some are marked as dead already but at lease one is working for me.

While I'm sure that Photobucket will be killing these sorts of work around off as quickly as they can, I do wonder if this sort of approach could be built into this mod, even if it's only short lived, giving us all a chance to pull as many images as we can, while we can.

I have no idea what this would take, but I'd happily put in some $$ for the time it takes to get this up and running.

https://chrome.google.com/webstore/d...alioapbifiaedg

The_Hawk 07-13-2017 02:50 AM

Actually I spoke too soon, the cron job seems to have stopped running for no apparent reason. Even trying to tell it to "run now" seems to not work.

I did hit the "Allowed memory size exhausted" error, but turned off caching... then cleared the iei_img table as well. Still no luck.

I've set the number of posts back down to 10, re-imported the mod, checked the permissions on the folders, rebooted the server... still no clue.

Other tasks still appear to be running automatically or using the "run now" button (which then shows "done"), just not this one.

I can't seem to find any error message anywhere that would point to why this is failing. Any suggestions are welcome.

The_Hawk 07-15-2017 01:44 AM

So I've had a few messages back and forth with y2ksw, which has been brilliant.

The latest advice was the PHP might be silently crashing and wanted more memory. I've been slowly upping the max_memory (as I didn't want to go unlimited just yet) and it's running again. I'm somewhere north of 40,000 images checked so far (excluding photobucket) and I'm currently running at only about 40% of links being found. To be fair this is
2005 - 2011 so it's less of a surprise but really does ram home the need to run a script like this one if possible.


Quote:

We had this issue in the past with very large images (like 10.000x20.000 pixel) and PHP silently crashing upon insufficient memory. If you are on a dedicated box, you may try to assign "-1" (=any) to max memory. Else, you may try to sign the first unscanned post as scanned to skip over the post which creates this problem.

Kane@airrifle 07-16-2017 11:16 AM

A work around for the PB issue. edit /includes/cron/iei_cron; after line 268 add:

Code:

if (is_numeric(stripos($url, 'photobucket')))
    {
        curl_setopt($ch, CURLOPT_REFERER, 'http://www.photobucket.com/');
    }

I have tested it on a few known blocked PB images and it imports them just fine.

*not my code, was posted elsewhere by "IA1"

fwulfers 07-19-2017 07:11 PM

Thanks so much for this plugin and the code update for Photobucket. I installed in on our forum (vB 4.2.5), made the change to the code and it downloads the PB images just fine. Many tutorials and other important threads will now be useful again.

y2ksw 07-20-2017 07:23 AM

... and most of all, you never lose them again :)

BadgerDog 07-20-2017 08:01 AM

Quote:

Originally Posted by Kane@airrifle (Post 2588518)
A work around for the PB issue. edit /includes/cron/iei_cron; after line 268 add:

Code:

if (is_numeric(stripos($url, 'photobucket')))
    {
        curl_setopt($ch, CURLOPT_REFERER, 'http://www.photobucket.com/');
    }

I have tested it on a few known blocked PB images and it imports them just fine.

*not my code, was posted elsewhere by "IA1"

For my clarity ... :)

I donated via PayPal and have run y2ksw's for many many years. It's been fantastic and one of the most popular add-ons our members comment on.

My question ... since it's been running for so long and we already have thousands of PB pics imported onto our server, am I correct in assuming that this code change permits members to continue IMG'ing PB pics and they will still import?

In other words, this code fix works around PB's block and returns us to the status quo of what it used to be?

Thanks for any feedback?

Regards,
Doug

Edit: I don't have a line counter in my editor, so what does the code that appears before this look like so I'm sure to put this in the right place, if I do i... thanks ..

Kane@airrifle 07-20-2017 12:12 PM

Doug, the PB fix will work until such time as they find a means to obfusticate it again.

In the iei_cron.php file look for the following code and add the PB code directly after it:

Code:

@curl_setopt($ch, CURLOPT_REFERER, IEI_BBURL);
In the long run it would assist you greatly if you used something like Notepad++ to edit your files with: https://notepad-plus-plus.org/

BadgerDog 07-20-2017 12:16 PM

1 Attachment(s)
Quote:

Originally Posted by Kane@airrifle (Post 2588702)
Doug, the PB fix will work until such time as they find a means to obfusticate it again.

In the iei_cron.php file look for the following code and add the PB code directly after it:

Code:

@curl_setopt($ch, CURLOPT_REFERER, IEI_BBURL);
In the long run it would assist you greatly if you used something like Notepad++ to edit your files with: https://notepad-plus-plus.org/

Thank you partner.... :)

Appreciate the quick response .. :up:

Regards,
Doug

ps: I'm on a MacBook Pro OSX operating system ..

pss: Ok, I've now inserted it for testing and it looks like this... seem like the right place?

Code:

  if(USE_CURL)
    {
        $ch = @curl_init($url);
        @curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
        @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        @curl_setopt($ch, CURLOPT_FAILONERROR, 1);
        @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, IEI_CONNECTTIMEOUT);
        @curl_setopt($ch, CURLOPT_TIMEOUT, IEI_CURL_TIMEOUT);
        @curl_setopt($ch, CURLOPT_REFERER, IEI_BBURL);
if (is_numeric(stripos($url, 'photobucket')))
    {
        curl_setopt($ch, CURLOPT_REFERER, 'http://www.photobucket.com/');
    }
        //@curl_setopt($ch, CURLOPT_USERAGENT, IEI_FORUMDOMAIN);
        $contents = @curl_exec($ch);
        @curl_close($ch);
    }

psss: Well I ran it anyway and it didn't crash (see pic), so I guess I have to wait now until I can get someone to try a PB pic, as I don't use their service...

y2ksw 07-20-2017 12:24 PM

Quote:

Originally Posted by BadgerDog (Post 2588695)
For my clarity ... :)

I donated via PayPal and have run y2ksw's for many many years. It's been fantastic and one of the most popular add-ons our members comment on.

My question ... since it's been running for so long and we already have thousands of PB pics imported onto our server, am I correct in assuming that this code change permits members to continue IMG'ing PB pics and they will still import?

In other words, this code fix works around PB's block and returns us to the status quo of what it used to be?

Thanks for any feedback?

Regards,
Doug

Edit: I don't have a line counter in my editor, so what does the code that appears before this look like so I'm sure to put this in the right place, if I do i... thanks ..

Sooner or later they will elaborate more and will not accept only their base url as a referrer. Until then, this code modification should work.

Kane@airrifle 07-20-2017 12:25 PM

Quote:

ps: I'm on a MacBook Pro OSX operating system ..
Try something like Atom then: https://atom.io/

BadgerDog 07-20-2017 12:27 PM

Quote:

Originally Posted by Kane@airrifle (Post 2588706)
Try something like Atom then: https://atom.io/

Thanks again .. :up:

Regards,
Doug

The_Hawk 07-21-2017 05:41 AM

Quote:

Originally Posted by Kane@airrifle (Post 2588518)
A work around for the PB issue. edit /includes/cron/iei_cron; after line 268 add:

Code:

if (is_numeric(stripos($url, 'photobucket')))
    {
        curl_setopt($ch, CURLOPT_REFERER, 'http://www.photobucket.com/');
    }

I have tested it on a few known blocked PB images and it imports them just fine.

*not my code, was posted elsewhere by "IA1"

You Sir, are a legend! (and so is IA1 for this remarkably simple fix!!)

It's ticking away nicely pulling images as we speak! I'm sitting on the edge of my seat watching it and testing images as they pull down to make sure they are continuing to work... LOVE IT!!

Quote:

Originally Posted by Kane@airrifle (Post 2588706)
Try something like Atom then: https://atom.io/

I like BBEdit on the Mac and Notepad++ on Windows. My old job used to use EM Editor which was great for very large files (1M+ lines files dumped from finance systems), but Notepad++ works fine for my coding needs.

BBEdit:
http://www.barebones.com/

EM Editor:
https://www.emeditor.com/

BadgerDog 07-25-2017 09:22 AM

Quote:

Originally Posted by Kane@airrifle (Post 2588518)
A work around for the PB issue. edit /includes/cron/iei_cron; after line 268 add:

Code:

if (is_numeric(stripos($url, 'photobucket')))
    {
        curl_setopt($ch, CURLOPT_REFERER, 'http://www.photobucket.com/');
    }

I have tested it on a few known blocked PB images and it imports them just fine.

*not my code, was posted elsewhere by "IA1"

Just a follow up and again, a huge thank you for this quick fix (for now)... :up:

It's working beautifully and being a research site for over 29,000 retired veterans, is extremely valuable to our members... much appreciated...

We've been using y2ksw's outstanding add-on for over 7 years and the accumulated amount of important Photo Bucket research pics that have been preserved (saved) by his mod over the years is measured in the 10's of thousands.

Your temporary fix allows that to continue with new pics, at least until Photo Bucket catches up with it. :)

Regards,
Doug

rkrenicki 07-25-2017 12:34 PM

I think I am missing something real simple here.. but I am not finding a log entry for this mod. Does this not have logging functions, or am I missing where to enable it?

EDIT: Nevermind, i found it and it is logging now.

Kane@airrifle 07-25-2017 01:10 PM

It's not set to log the cron action by default but it does write the imports (old_url - new_url) to a DB table called "iei_img"

M4T VW 08-02-2017 05:28 PM

Doesn't seem to be working with photobucket again? It just downloads a load of "no external hosting allowed" images.

y2ksw 08-02-2017 09:01 PM

Quote:

Originally Posted by M4T VW (Post 2589096)
Doesn't seem to be working with photobucket again? It just downloads a load of "no external hosting allowed" images.

Yeah, they might keep an eye on it or eventually apply a firewall rule to keep people from downloading the images.

y2ksw 08-03-2017 11:26 AM

Quote:

Originally Posted by y2ksw (Post 2589108)
Yeah, they might keep an eye on it or eventually apply a firewall rule to keep people from downloading the images.

Maybe you better give up on them. I tried to get to the point where an image shows up, but no success.

It seems they have disabled public images and were "sold" to an unnamed third party which now made it an advertising hog. It's a pity how deep certain services may fall ;)

Kane@airrifle 08-03-2017 04:44 PM

I did a PB import today for somebody and got 96/100 imported.

unitedpunjab 08-14-2017 06:03 PM

Is it possible to 'reverse' the ignore option ?
So that only the url specified can be cached.

I will try to toggle some true/false but it will be helpful if someone has already done this.

Gizmo99 08-29-2017 06:45 AM

just found that if you add ~original after the .jpg the image of the photobucket [IMG] link and the image appears :)

can or will this script do this ?

Giz

The_Hawk 09-03-2017 09:58 PM

The fix still appears to be working for me with images imported as late as yesterday without issues. I do note that I have *very* few images coming through from photobucket as people have moved onto other things. It could be that those last couple are paid accounts and that's why it's working... For one main user it probably is, for the other couple it's unlikely.

Again, brilliant little fix that the community is loving.

VCCN 10-10-2017 07:25 PM

Very good plugin, works exellent, thank you :)
One question; is it possible to have the plugin to fetche photobucket-links only?

VCCN 10-11-2017 06:10 AM

Update: seems like PB has blocked this now. Alot of PB-pictures is not changed according to log, when i check the actual post, and add ~ behind the .jpg the picture works fine :-(

Edit: checked the table and many PB-pictures is downloaded, and some is not. hmm

y2ksw 10-11-2017 08:25 AM

Quote:

Originally Posted by VCCN (Post 2590378)
Very good plugin, works exellent, thank you :)
One question; is it possible to have the plugin to fetche photobucket-links only?

No. The idea is to download all images.

y2ksw 10-11-2017 08:26 AM

Quote:

Originally Posted by VCCN (Post 2590387)
Update: seems like PB has blocked this now. Alot of PB-pictures is not changed according to log, when i check the actual post, and add ~ behind the .jpg the picture works fine :-(

Edit: checked the table and many PB-pictures is downloaded, and some is not. hmm

If some images do not download, it may be that some PB accounts are simply moved elsewhere.

VCCN 10-11-2017 08:40 AM

Quote:

Originally Posted by y2ksw (Post 2590392)
If some images do not download, it may be that some PB accounts are simply moved elsewhere.

Don't think so.
If i check a post that is "Not changed" according to log - i find the "you must upgrade your PB" picture. If i copy the URL and open it up in a browser, picture is showing up.
Not sure why, maybe because of the time out?
Anyway, how can i rerun this plugin on the whole forum? Let's say the plugin has scanned and downloaded all pictures and i want to start over - how do i do it?

y2ksw 10-12-2017 07:05 AM

Quote:

Originally Posted by VCCN (Post 2590393)
Don't think so.
If i check a post that is "Not changed" according to log - i find the "you must upgrade your PB" picture. If i copy the URL and open it up in a browser, picture is showing up.
Not sure why, maybe because of the time out?
Anyway, how can i rerun this plugin on the whole forum? Let's say the plugin has scanned and downloaded all pictures and i want to start over - how do i do it?

The point is, in any case, a server is not a browser. When simple attempts to fake a browser fail, then you have two options: you develop a software which handles that specific case and repair it every time something changes, or you say: impossible.

I do not have time to watch PB developers, so to me it's the second option :)

BGObsession 10-23-2017 02:53 PM

Quote:

Originally Posted by The_Hawk (Post 2588474)
So I've had a few messages back and forth with y2ksw, which has been brilliant.

The latest advice was the PHP might be silently crashing and wanted more memory. I've been slowly upping the max_memory (as I didn't want to go unlimited just yet) and it's running again. I'm somewhere north of 40,000 images checked so far (excluding photobucket) and I'm currently running at only about 40% of links being found. To be fair this is
2005 - 2011 so it's less of a surprise but really does ram home the need to run a script like this one if possible.

I believe I am experiencing this as well. I installed this mod in order to overcome the 'mixed content' warnings and so far it is not working for me. I see a few images have been added to the 'imported' image folder, but just a few, and I also get the 'Done' (and only 'Done') message when I manually run the cron.job.

When you say you are 'upping the max_memory' (or to set it to 'unlimited') - where are those adjustments done - is that within the vB admin panel somewhere, or are you talking about a server setting. How can I adjust this in order to get the cron job to completely run. And I'm assuming if this is working 100% correctly, that I should see the mixed content warnings disappear immediately - is that right?

y2ksw 10-24-2017 09:03 AM

Quote:

Originally Posted by BGObsession (Post 2590653)
I believe I am experiencing this as well. I installed this mod in order to overcome the 'mixed content' warnings and so far it is not working for me. I see a few images have been added to the 'imported' image folder, but just a few, and I also get the 'Done' (and only 'Done') message when I manually run the cron.job.

When you say you are 'upping the max_memory' (or to set it to 'unlimited') - where are those adjustments done - is that within the vB admin panel somewhere, or are you talking about a server setting. How can I adjust this in order to get the cron job to completely run. And I'm assuming if this is working 100% correctly, that I should see the mixed content warnings disappear immediately - is that right?

As far as I know the only place to lay hands on, is the php.ini file and physical memory.
Code:

# cat /etc/php5/apache2/php.ini | grep memory_limit

Emad ELsayed 10-25-2017 01:24 PM

my dear
Does not work on 4.2.5
php 5.6.31
mysql 5.6.37
any help ..
Best Regards

y2ksw 10-26-2017 06:20 AM

Quote:

Originally Posted by Emad ELsayed (Post 2590746)
my dear
Does not work on 4.2.5
php 5.6.31
mysql 5.6.37
any help ..
Best Regards

for me it works

Afrika 11-14-2017 08:55 AM

Is it possible to import images from a specific path from the own forum? The own forum is not imported by default

y2ksw 11-15-2017 03:45 PM

Quote:

Originally Posted by Afrika (Post 2591089)
Is it possible to import images from a specific path from the own forum? The own forum is not imported by default

Not without changing the code base.

But in reality, you may move the files directly and then change their path with a simple query in all of your posts. This is much more effective than importing and storing the images elsewhere.

Code:

UPDATE post SET pagetext=REPLACE(pagetext, 'old_url', 'new_url');
where old_url is the path as found in one in you posts now, and new_url the path as you wish to have as the new destination.

Keep in mind that the db connection may time out, but you can repeat as often as needed, since UPDATE is smart enough not to change the records which already have been changed. Best of course is to call mysql from the shell.

gerryvz 11-17-2017 02:33 PM

1 Attachment(s)
Hi Giovanni,

Great mod, and thank you so much for creating it. I am running 4.2.4 and installed the mod yesterday. I have around 7,300 users and 150,000 total posts, with a relatively small number of overall posts that would require images to be downloaded (I would say the majority of images on my forum are directly attached and residing already in the file system).

Server - Linux + Apache
vbulletin - 4.2.4
php - 5.6.31
php max post size - 64MB
php max upload size - 64MB
php memory limit - 256MB
mySQL - 5.5.7
mySQL packet size - 10MB

The mod started downloading and it got through about 4 of the 9 years of posts on my forum. Now it has frozen since last night. I turned on the logging this morning and only came across this single entry in the log since I turned it on, which is attached. The offending post has some images attached to it, using the external host home.btconnect.com

The images seem to be small in size and pixels, and I downloaded them manually and attached them to the post to see if I could have the mod continue downloading other posts. So far, I haven't been able to get it started again.

Attached is the error, as well as my settings screens.

Also, I have now received two times the mySQL error as attached, which I read appears to be the database server "timing out."

The mod is definitely enabled and running, download folder and sub-folders are 777 permissions, etc.

Does it look to you that there is an image that is too large, or do you have other ideas as to what is causing the mod to stop indexing and downloading?

EDIT: A new post that was made by one of my users today was indexed and the external images were replaced, so I know the code is working. However, it seems stalled and won't continue indexing beyond a certain point in the past. It must be hanging up on something that is keeping it from continuing past indexing. Please advise :)

SECOND EDIT: I emptied the table in the database (it has a few more than 3,000 records in it) and the code executed again, but then stopped, and it had seven new records in the database. I emptied the table again and it sent through one more cycle of downloading a few more images, and putting seven new records in the database again.

So, something related to the database and/or php memory seems to be preventing the code from executing correctly.

Any thoughts?

Thanks
Gerry







All times are GMT. The time now is 02:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02263 seconds
  • Memory Usage 1,874KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete