Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

itchastitch

6
Posts
1
Topics
A member registered Sep 20, 2022

Recent community posts

Everything inside the folder where the script is located. This include subfolders. It does not have access to anything outside the folder. As long as file is a .ts file then it is checked. Name does not matter.

It starts 5 instances of jav-it.exe, each downloading 1 video from ids.txt. I set argument so that they start minimized because popup will set cmd.exe as active window. Once 1 jav-it.exe closes for whatever reason it starts another jav-it download. If it stays at first 5 then they're probably downloading. Downloads usually last 1 hr, which is why i created script, so i wouldn't need to babysit while stuff downloads. The script has no idea what jav-it.exe is doing, it just knows how many jav-it.exes are running. You can always click on the minimized windows which should appear on taskbar. There should be info on what that instance jav-it is doing there. If your list is only 5 then I guess it downloads all at the same time.

The readme.txt is kind of useless. Follow what Download.bat is doing, although you don't really need to understand what the script is doing to use it. Extract and move contents from GUIDE.zip and jav-it_v1.7.3_windows.zip into a single folder. For cookies.txt use this extension for firefox. A little cookie should appear where extensions live. Log into R18 and go to library. Click on the cookie and export from R18.com, the middle one. If that one doesn't work try the top one, you know it fails because jav-it will close pretty quickly. Save and rename to cookies.txt, move file to the folder you put the other stuff. From here double clicking on Download.bat should work. Try downloading something from your library. If that works then you can use my script. Open notepad.exe. Copy and paste code into notepad. File > save as, type "downloadlist.bat" and save. Move the file to the folder with all the other stuff. Double clicking downloadlist.bat should start downloads. Script assumes you're downloading from R18 and grabs the CIDs from ids.txt. Once one file has finished downloading it starts the next until it goes through the entire list. 

All you need to know is

jav-it.exe download /c cookies.txt /i "%Input%" /o %CD%

In the terminal, you first need to get the working directory to be the directory where all the stuff you downloaded is. When you first open CMD.exe or Terminal or PowerShell, it starts at C:\Users\yourUserName. You know where your stuff is but the terminal only sees the stuff inside C:\Users\yourUserName. You can call jav-it.exe from where you are but you need to specify the location. C:\where\javit\is\jav-it.exe.  That's annoying so it is much easier to put everything in 1 folder and make that folder your working directory. Include jav-it.exe, and the cookies.txt. The other stuff is to catalog the videos and aren't really necessary but include them anyways. To change working directory use cd. 

cd C:\where\javit\is

It should now show working directory has changed. Verify stuff is there with dir. Now you can call jav-it.exe without specifying where it is. "Input" is a string of the CID. Replace %Input% with the CID of the video you're interested in downloading. %CD% means current directory, so output will be the folder jav-it.exe is in. Of course you can specify a different location but be sure to put parentheses. "C:\where\javit\is\jav-it.exe". What you type in cmd.exe should be

jav-it.exe download /c cookies.txt /i "intdtb00518" /o %CD%

In Terminal or powershell it looks like

./jav-it.exe download /c cookies.txt /i "intdtb00518" /o .

To call script you can double click but the working directory is the folder the script is in. You can also type it out in the terminal. for CMD:

download.bat

for Terminal or powershell

./download.bat
(3 edits)

Updates were made to script. Video corruption occurs with CIDs with multiple streams so script now checks for and deletes any corrupted videos. If there were corrupted videos, script automatically tries to download list again. Script doesn't care if the video it deleted wasn't  originally in the ids.txt, all .ts files are checked. Script shouldn't disappear suddenly when finished, it now waits for user input. I only bothered to test once in Terminal which doesn't disappear after task is complete.

Script uses ffprobe.exe to check for corruption. Download from here: https://ffmpeg.org/download.html

Extract and place in the same folder as script.

@echo off
setlocal enabledelayedexpansion
title JAV-IT Download List Script
set /a maxProcesses = 5
set count=0
for /f "tokens=*" %%n in (ids.txt) do (
    set /a count+=1
    set cid[!count!]=%%n
)
:beforetheloop
set /a x=1
:loop
if %x% GTR %count% (goto :wait)
for /f %%a in ('tasklist^|find /c "jav-it.exe"') do (set numProcesses=%%a)
if %numProcesses% lss %maxProcesses% (
    call echo "%time% starting %%cid[!x!]%%"
    start /min jav-it.exe download /c cookies.txt /i "!cid[%x%]!" /o %CD%
    set /a x+=1    
    timeout /t 5 /nobreak > nul
) else (
    timeout /t 5 /nobreak > nul
)
goto :loop
:wait
set /a currentProcesses=%numProcesses%
for /f %%a in ('tasklist^|find /c "jav-it.exe"') do (set numProcesses=%%a)
if !numProcesses! == 0 (
    echo "All downloads complete"
    goto :check
) else (
    if %numProcesses% lss %currentProcesses% ( 
    echo "waiting for %numProcesses% processes to finish"
    ) 
    timeout /t 5 /nobreak > nul
    goto :wait
)
:check
set /a numError=0
FOR /F "delims=*" %%G in ('dir /b  *.ts') DO (
    ffprobe -i %%G -show_error -loglevel fatal | findstr /C:"ERROR">nul && (
        Echo "%%G has fatal errors, deleting"
        del %%G
        set /a numError+=1
    ) || (
        Echo "%%G has no fatal errors"
    )
)
if !numError! == 0 (
    echo "no errors found, all downloads complete"
    pause
    goto :eof
) else (    
    echo "errors were found and deleted, starting downloads again"
    goto :beforetheloop
)

OG post:

Since R18 is shutting down I thought it be a good idea to download the videos I purchased from them. However, I didn't know the itch.io version of this program is unbearably slow. I can increase speed by downloading multiple videos at once, but it's annoying to keep track of. To use script, create a file named ids.txt in the same directory as jav-it.exe and cookies with the content IDs you want to download following this format:

jav1
jav2
jav3

Script downloads 5 videos at a time. Some videos are really several videos with the same content ID, those will always download sequentially. Don't run multiple instances of this script. Script does not check if .partial exists, it is possible to have two .exes downloading the same thing at the same location. Increase maxProcesses value to increase number of videos downloaded at once. Copy the following and save as downloadlist.bat and run it like you would Download.bat in the GUIDE.

@echo off
setlocal enabledelayedexpansion
title JAV-IT Download List Script
set /a maxProcesses = 5
set count=0
for /f "tokens=*" %%n in (ids.txt) do (
    set /a count+=1
    set cid[!count!]=%%n
)
set /a x=1
:loop
if %x% GTR %count% (goto :eof)
for /f %%a in ('tasklist^|find /c "jav-it.exe"') do (set numProcesses=%%a)
if %numProcesses% lss %maxProcesses% (
    call echo "%time% starting %%cid[!x!]%%"
    start /min jav-it.exe download /c cookies.txt /i "!cid[%x%]!" /o %CD%
    set /a x+=1    
    timeout /t 5 > nul
) else (
    timeout /t 5 > nul
)
goto :loop
pause

This is my first time writing a batch script so feel free to improve it.

you're using the script. so when it asks for content id you only need to input intdtb00518. if you weren't using the script and cmd was pointed where jav-it.exe is then what you inputted would work. You can edit download.bat to specify cookies.txt and output location since original script expects those to be the same directory.