ImageFAP direct images++

By darodi Last update Sep 28, 2011 — Installed 62,106 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 53 posts, 30 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
synce User

Thank you. Seriously. THANK YOU!

It took me a while to figure everything out, so if you're like me and plan on using this script to batch download HCB galleries with the correct page order, here's what you do.

1. Open up DownThemAll
2. Set preferences to download only one file at a time
3. Set renaming mask to *num*.jpg
4. ???
5. Profit

 
Nips9901 Scriptwright

Funny thing, I had already made it work for simple and one-page and accidentally deleted it before you updated it :D
Anyway, IMHO it should also provide the link to the intermediate page (the "[Std]" link), here's the diff if you're fine with it (can you read diffs BTW? Well, this one is simple anyway)

EDIT: Corrected diff :|

@@ -179,11 +179,15 @@
 		var il = document.createElement("A");
 		il.href = oldref;
 		il.innerHTML = "[Std]";
-		if (i >= FileNames.snapshotLength) continue;
 		var fn = FileNames.snapshotItem(i);
-		if (fn==null) continue;
-		fn.parentNode.insertBefore(il, fn.nextSibling);
-		fn.parentNode.insertBefore(document.createTextNode("\u00a0"), il);//nbsp
+		if (fn!=null) {
+			fn.parentNode.insertBefore(il, fn.nextSibling);
+			fn.parentNode.insertBefore(document.createTextNode("\u00a0"), il);//nbsp
+		}
+		else {
+			anchor.parentNode.insertBefore(il, anchor.nextSibling);
+			anchor.parentNode.insertBefore(document.createElement("br"), il);
+		}
 	}
 }

 
darodi Script's Author

merged :)

 
Nips9901 Scriptwright

@darodi: Hey, let's play cat and mouse :D. I updated my version before noticing you had alreeady adopted it so take a look at the changes (mostly because it fixes a certain bug I had with unnamed images... ;)

 
Nips9901 Scriptwright

@darodi:

Answered in mine's page :)

 
darodi Script's Author

@nips9901:

could you explain me what is the point of keeping those random unsorted filenames?
I don't really get this...

 
Nips9901 Scriptwright

First of all thank you, it has been saving me a lot of trouble, clicks and time :)

Feel free to consider the text below spam but IMHO some users might be interested ;)
I've modified the script to suit my needs better (http://userscripts.org/scripts/show/35672) if you think my modifications are worthy, please incorporate them, otherwise just forget about them ^^.
I've focused on tweaking the wget script (my priority was to maintain the original filename) and also added back an optional link to the intermediate page.

 
Limer User

great script - thanks
but with some small changes and an additonal batchfile it's awesome!

If you make theese changes to darodis script the output can be used to download all images with my batchfile:
1. var wgetCommand = "image-xxx^ext^file";
2. var wgetScriptSleep = '0';
3. var wgetScriptInclude = true;

The output below any gallary will look similar to "image-021^jpg^http://cache.imagefap.com/images/full/xx/xxx/xxxxxxxxxx.jpg".
If you save the whole output into a textfile (C:\Downloads\narf\000\test.ifdl for example) and then open it with my batchfile all images will be downloaded in the same directory (in this case C:\Downloads\narf\000\) and they will be correctly numbered.
If a download of an image was unsuccessful the batchfile will try to download it again (up to five times) and in case the 5th try was unsuccessful too, the corresponding link and filename will be saved in a logfile.

You just need to save the following code to C:\Downloads\IFap\ifapdler.cmd for example.
Additionaly you can put a link to this batchfile in your 'SendTo'-directory (%userProfile%\SendTo) or tell Windows to open .ifdl-files with it.
Drag'n'Drop is possible too.

@echo off
if not "%OS%"=="Windows_NT" echo   Das Betriebsystem ist nicht WinNTx && pause && exit /b
VERIFY OTHER 2>nul
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 echo   Befehlserweiterungen konnten nicht aktiviert werden - quiting... && pause && exit /b
setlocal
set IFDver=v0.4
set globTryCnt=0
set globMCnt=0
set globDlCnt=0
REM ImageListFile
set ILF="%~1"
REM MissingListFile
set MLF=missing
set wgetlog=ifapdlog
set limitTryCnt=5
set limitFSize=1000

title ImageFap Downloader %IFDver% by Limer
echo.
if %ILF%=="" set /P ILF= ImageListFile: 
for /F "usebackq tokens=*" %%i in ('%ILF%') do set ILF="%%~i"
REM Change working directory
FOR %%I IN (%ILF%) do (
	%%~dI
	cd "%%~pI"
)
echo Workingdir: "%CD%"
if not exist %ILF% goto :EOF
if exist "%MLF%.log" (
	if exist "%MLF%.bak" del "%MLF%.bak"
	ren "%MLF%.log" "%MLF%.bak"
)
if exist "%wgetlog%.log" (
	if exist "%wgetlog%.bak" del "%wgetlog%.bak"
	ren "%wgetlog%.log" "%wgetlog%.bak"
)
FOR /F "usebackq tokens=1,2,3 delims=^^" %%M in (`type %ILF%`) do call :dler "%%M" "%%N" "%%O"
echo. >>"%wgetlog%.log"
echo.
echo %globDlCnt% images successfuly downloaded to "%CD%".>>"%wgetlog%.log"
echo (%globTryCnt% retrys and %globMCnt% missing files)>>"%wgetlog%.log"
echo %globDlCnt% images successfuly downloaded to "%CD%".
echo (%globTryCnt% retrys and %globMCnt% missing files)
set ccl=%CMDCMDLINE%
for /F "usebackq" %%I in (`echo %ccl% ^| %SystemRoot%\System32\find.exe /I /C "/C"`) do if "%%I"=="1" (
	title fin. "%CD%"
	pause
)
goto :EOF


:dler
REM %1=FileName %2=Ext %3=Adress
set spacer= &&echo.
REM In case the file extension is .jpeg it is replaced with .jpg
if /I "%~2"=="jpeg" (set dlf=%~1.jpg) ELSE set dlf=%~1.%~2
set /A trycnt=0
:retry
set /A trycnt+=1
echo  dler: "%dlf%" - Try%spacer%%trycnt%
start /BELOWNORMAL /MIN /WAIT wget -b -nv -a "%wgetlog%.log" -O "%dlf%" "%~3"
FOR %%I IN ("%dlf%") do if %%~zI LSS %limitFSize% (
	if %trycnt% LSS %limitTryCnt% (
		set /A globTryCnt+=1
		set spacer= %spacer%
		goto :retry
	) ELSE (
		set /A globMCnt+=1
		echo %~1^^%~2^^%~3>>"%MLF%.log"
		echo  dler: "%dlf%" - Failed (look at "%MLF%.log")
	)
) ELSE (
	set /A globDlCnt+=1
)
echo. >>"%wgetlog%.log"
goto :EOF

I almost forgot: you'll need wget somewhere in your %PATH%

 
Slakoblanco User

To save images in downthemall without getimg.php click on "remaining mask" and type *name*.jpg or whatever file extension your using. also remember to click on "rename" for the option (if a file name already exists) in main preferences

 
Good To Too Scriptwright

request

Tie into the extension DownThemAll -- it can pass a referer back to the webhost
https://addons.mozilla.org/en-US/firefox/addon/201

 
cyberonin User

@r0ssar00

How could .js executable?
It always prompt "Open with" options.

Thank you very much

 
darodi Script's Author

as requested, I also added a wget script generator.
You can always inlude the script in the end of the gallery if you set 'wgetScriptInclude' to true,
or just use the gease monkey menu command to generate it.

 
r0ssar00 User

tip for everyone: you can download the entire galery by installing cruiser, then the latest version of imagefap direct images++ (i think it will only work in that order but i haven't tried anything else)
finally, get the version of wget for your operating system and install it into your path
eg. on windows, put it into your windows\system32 folder

when they are installed, go tools->greasemonkey->manage user scripts...
then click cruiser, then change the allowed sites to h t t p : / / w w w . i m a g e f a p . c o m / g a l l e r y . p h p ? g i d = *
(remove the spaces)
i did that because cruiser stepped in on other web sites where it wasn't 18+ type images(pr0n) that had a lot of images but accompanying(spelling?) text.
it's easier to whitelist the sites you want it to work on then blacklist everything else

when cruiser loads the gallery, scroll all the way to the bottom and click "Click here to generate a script" blah blah blah.
copy and paste everything under that line into a new text file with the extension bat(this creates a batch script file)
create a folder somewhere on your computer and save that text file in there
double-click on the bat file and the gallery will download

my system: i created a jscript script to insert a sleep every 10 pics so that a million wget's won't be open and your net connection will still work with decent speed
you must get a windows version of sleep.exe

// sleeptime controls the amount of seconds between 10 pic downloads
var sleeptime = 3;
var fs,fs2,infile,outfile,ForReading;
var Args = WScript.Arguments;
ForReading = 1;
fs = new ActiveXObject("Scripting.FileSystemObject");
fs2 = new ActiveXObject("Scripting.FileSystemObject");
infile = fs.OpenTextFile(Args(0),1,false);
outfile = fs2.OpenTextFile(Args(1),2,true);
var counter = 0;
var line = "";
outfile.WriteLine("@echo off")
while (infile.AtEndOfStream==false)
{
	counter = counter + 1;
	if (Args(2)=="startsleep") {
		line = "start /min " + infile.ReadLine();
	}
	if (Args(2)=="startnosleep") {
		line = "start /min " + infile.ReadLine();
	} 
	if (Args(2)!="startsleep" && Args(2)!="startnosleep") {
		line = infile.ReadLine();
	}
	if (counter==10)
	{
	outfile.WriteLine("@echo on");
	outfile.WriteLine(line);
	outfile.WriteLine("@echo off");
		if (Args(2)=="startsleep") {
			outfile.WriteLine("sleep " + sleeptime);
		}
		if (Args(2)=="nostartsleep") {
			outfile.WriteLine("sleep " + sleeptime);
		}
		counter = 0;
	} else {
	outfile.WriteLine(line);
	}
}

theres probably extra stuff in there but i don't care, it works.
usage: addsleep.js origdownload.bat newdownload.bat mode
where mode is one of:
startsleep - adds a start /min in front of each wget call and adds a sleep for sleeptime every 10 pics
startnosleep - adds a start /min in front of each wget call and does not add a sleep
nostartsleep - doesn't add a start /min but sleeps for sleeptime every 10 pics
anything else - doesn't sleep or add a start
mode has to be something, if you don't want a sleep or a start, use asdf or something
change the sleeptime for what you want the delay between 10 pics to be
i named it addsleep.js and put it in my windows\system32 folder

i also set up another batch script called ddownload.bat in my windows\system32 folder

@echo off
notepad download.bat
addsleep download.bat real.bat nostartsleep
del download.bat
move real.bat download.bat
download.bat

which opens notepad with a new file called download.bat, adds the sleeps, but no starts, and starts the download

my process: 1) find a gallery
2) copy the generated script
3) open a cmd in my directory
4) exec ddownload and paste the script
5) sit back and wait for it to finish
6) whatever floats your boat
there you have it, free imagefap gallery downloads

 
jkdamacy User

Is there any way to save these images without them being renamed to getimg.php? Particularly when using a mass downloader like DownThemAll?

 
SpeedyJ User

Thanks but I can't get this to work properly. I keep ending up with missing images and incomplete truncated pics (like half a pic and then garbage in the bottom bit).

I've been using the free version of Bulk Image Downloader to download from imagefap and it doesn't seem to have any of these problems. Any ideas?

 
bipsync User

script working great.. thanks..

 
darodi Script's Author

bipsync:
Thanks for the info.
I added
@include http://*imagefap.com/gallery/*
It should work now.

 
bipsync User

hi.. your script is nice.. but now.. it only works when i click the one page or simple view function on imagefap page.. have to switch between the view.. any help.. sorry for my english..

 
darodi Script's Author

VoodooGlowSkull:
I updated the script to change the first page too.
juste change ajax_mode to true.

 
VoodooGlowSkull User

Thanks for the nice script. I have replaced the "gallery.php" with "ajax_gallery_display" and like the results. Clicking on a gallery link in a browse gallieries page or user gallery page obviously still takes me to the first 'gallery.php' page instead of the ajax page. How do I modify the script so that I never see the first 'gallery.php' page but rather go straight to the ajax one from a gallery list page?

 
darodi Script's Author

oops .. I forgot...
you should also add
http://*imagefap.com/ajax_gallery_display.php?*
in the included pages
if you replace "gallery.php?" with "ajax_gallery_display.php?" in the script

 
darodi Script's Author

grokis:
try replacing "gallery.php?" with "ajax_gallery_display.php?" in my script, you won't see anything on the page except images. No scripts, no banners...
See if that's ok for you.

for you second question, if you are too tired to press back why don't you just open the gallery in a new tab and keep the gallery list in the first one? :)

 
grokis User

Ah and also another problem that comes from the complete site reloading; when I clicked through to page 5 e.g. I have to use the 'back' function 6 times to be on the gallery overview page again, that sucks a bit, because on the original site you only have to click once...
Any way to change this?

Thanks!

 
grokis User

Hello,
when I use you script and klick on the "next" or "previous" link the whole page is reloaded and I'm again at the top, so that I have to scroll - is there a way to use this normal frame (or however imagefap does this)?

Also I tried to write a script but didn't had that much success - I wanted to modify your script so that all Javascript is removed from the site and all those stuff at the top is removed; is that possible?

Thank you

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel