>seems like he's been more civilized back in the day hm >Yeah I'm going to buy a 12TB drive to unzip a bunch pf.files for no reason > >Go fuck yourself you autistic retard nah OP, you're a dumb kid that's not gonna get far with that attitude
Jaxson Carter
looks like his first recognizable post Might make for some good reading with how he gets deservedly shat on
Cameron Morris
found an earlier one Man, OP's faggotry knows no bounds
Jonathan Cruz
in the 3 months he's trying to do this, he could actually have learned enough programming instead of begging. that's sad.
Nathan Wright
>OP's faggotry knows no bounds I mean just look at this guy >python code >where do i put it and he has the gall to insult the sad bastards that try to help him
absolutely not to mention done the quicker approach - quick and shitty ubongo vm - test shitty code multiple people already wrote *for* him - ask questions when it doesn't work, and gain at least some vague idea about what's happening Could've done it in an evening or two, but he's gonna continue being useless with his 2TB million cbz/cbr files containing PNGs named as .jpg. What I wonder is why he's looking for that shit. There's some juicy retardation hiding behind this requirement.
Camden Gomez
Learn to do it yourself. It'll be a fun experience in figuring out how retarded you are.
Yeah why can't everyone on this planet be a programmer.
Adam Moore
Why are you here again?
Anthony Turner
learn - how to quote - what samefagging means
I wonder if was the same dumbass
Nicholas Murphy
Maybe even is the same fag. >3dpd >anime tiddies >gay Could this be a roastie? Nah, that'd be hitting way too many behavioral stereotypes ITT and in the fag's post history.
Sebastian Anderson
probably some retarded /u/ or /y/ fag
Blake Foster
>Hydra
What
Evan Hernandez
They're schizophrenic and they believe everyone on Jow Forums is OP. It's pretty hilarious.
Brody Jenkins
Have you solved your issue yet?
Kevin Perez
>Heil Hydra obviously Have you heard of hydrus? I'm surprised it's not getting shilled more often here. Or maybe it's simply past its prime.
Evan Diaz
Hydra is awful, have you actually ever used it?
Austin James
OP hasn't solved his problem in 3 months with multiple people writing seemingly working code for him. Make a guess.
Sebastian Ramirez
Heard some "nice" things about its UI/UX, but it seemed like normieposting.
Robert Hernandez
I could tell you how to get rich right now, but you'd still be a poor uneducated mutt. Why's that?
Oliver Lee
?
Michael Russell
Seems like there's more posts with this whole "recursive cbz porn" silliness >How hard would it be to make a bash script that starts at my porn directory, and then checks all folders, if the folder has no other folders, it zips itself up and replaces the folder with a cbz, else it runs itself again on that folder?
Carson Long
It'll probably need powershell, and you'd be better off using python or something.
>Learn how image files work. For PNG, check the docs: No need, the magic number ought to be sufficient.
By the way those smart bastards put a bit more thought than expected into it: libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature >This signature both identifies the file as a PNG file >and provides for immediate detection of common file-transfer problems. >The first two bytes distinguish PNG files on systems that expect the first two bytes to identify the file type uniquely. >The first byte is chosen as a non-ASCII value to reduce the probability that a text file may be misrecognized as a PNG file; >also, it catches bad file transfers that clear bit 7. Bytes two through four name the format. >The CR-LF sequence catches bad file transfers that alter newline sequences. >The control-Z character stops file display under MS-DOS. >The final line feed checks for the inverse of the CR-LF translation problem. The chunking organization was supposedly inspired by IFF, whose history (EA, Amiga) is also pretty interesting if you're into file format autism.
Levi Gonzalez
if i help you, you will upload your hentai collection to mega.nz and share the link with me. deal?
Fuck no, not enough autism nowadays for that. Needed to do some simple shit with PNGs, so I skimmed the format docs.
Josiah Carter
you basically want to extract cbz/cbr archive, rename file.jpg to file.png if it's a png and pack all images back to cbz/cbr, yeah? that should be simple enough.
instead of renaming file.jpg to file.png, i want the name of the cbz/cbr archive added to a list if that's possible, and then it packs everything back to cbz/cbr
John Peterson
what are you trying to achieve?
Owen Harris
some of these images have been corrupted and my previous image viewer changed the files from .png to .jpg, it's a complicated story
Ethan Hernandez
if i would do it i would extract one archive at a time and then look for fucked up images and then pack them together again. shouldn't take too much space. if you don't need to make any changes to files within cbz/cbr then there's no need to repack them again. all you need is a list of archives with png files within them, right?
Luke Morales
yeah pretty much
Camden Powell
I see. Makes sense. If the viewer won't make any changes to the files, would it make sense to make them read-only to prevent such issues in the future - even if using less buggy viewers?
Kevin Turner
>if i would do it i would extract one archive at a time and then look for fucked up images and then pack them together again. shouldn't take too much space. yep, especially given the "million files, over 2TB" titbit. Was the usual objection when folks mentioned extracting the last few times.
Thomas Barnes
Bash/Batch will be fine for this. Pretty simple no matter what OS you're running.
Ayden Martinez
Python's probably a better choice in the Windows scenario, though he'd need something for the RAR files.
#!/bin/bash find . -type f -iregex ".*\.cb[rz]" | while read i; do haspng=0 regex=".* image\/png$" temp="$(mktemp -d)" 7z x -o"$temp" "$i" 1>/dev/null for p in $(find "$temp" -type f); do if [[ "$(file --mime-type "$p")" =~ $regex ]]; then haspng=1 fi done if [ $haspng = 1 ]; then echo File \"$i\" contains a png file. fi rm -rf "$temp" done
>bash >find >mktemp >7z >file >rm windows. OP might need assistance to get WSL running. >while read i does this handle spaces in the path? >if file =~ png didn't we want to find the cb*s that contain PNGs with extension .jpg only (), or does any PNG count ()
Jacob Hughes
also note that it doesn't rely on correct filenames either, since it uses 'type' instead of looking at the filename > file --mime-type actually\ a\ png.jpg actually a png.jpg: image/png
Luis Anderson
>does this handle spaces in the path? nvm, screenshot already has an example
Ayden Sanchez
file*
>does this handle spaces in the path? yes > ./a.sh File "./has a png.cbr" contains a png file. File "./subdir/has a png.cbr" contains a png file. File "./subdir/has a png.cbz" contains a png file. File "./subdir with space/has a png.cbr" contains a png file. File "./subdir with space/has a png.cbz" contains a png file. File "./has a png.cbz" contains a png file. >windows. OP might need assistance to get WSL running. cygwin should be fine, too >didn't we want to find the cb*s that contain PNGs with extension .jpg only (), or does any PNG count ( (OP)) he wrote "any png"
Jack Myers
is there any way to run bash scripts in windows or do i have to format a drive to xfs/ext4 and run it on ubuntu or something
Hudson Martin
you can use WSL, cygwin, a VM, or a livecd i haven't used WSL, so i can't comment on it, but cygwin is pretty easy to use
Jeremiah Torres
I bet their shows suck.
Kevin Brown
note that while this wouldn't be hard to write in batch script/powershell, windows doesn't come with much in the way of command-line tools, it would be just as if not more tedious to gather the necessary tools as it would be to just install cygwin, which has an installer for all the common tools
James Green
just fucking install a vm or run cygwin or run msys or run a live cd/usb holy shit
why do you make this so fucking hard on yourself. people were saying what you need to do tens of times and you still ask those stupid questions.
Charles Evans
frustrating innit at least it seems that OP finally upgraded from being clueless+dick to clueless only, if he keeps it that way he'll get a lot more help in the future
Nicholas Flores
>any way to run bash scripts in windows or do i have to format a drive to xfs/ext4 and run it on ubuntu or something no need to go full loonix, you can either - burn a quick liveCD/USB with ubongo, then just run the script there - create a ubongo VM, share the porn folder with it and run the script in the VM - futz around with cygwin or WSL
by the way, consider buying an extra drive and starting a backup schedule, it's handy for situations like this one - both the data loss that started this, and now running someone's potentially data destroying code/OS/VM/program
worst case scenario: you try some stuff, then you notice all your shit's fucked
Thomas Thompson
>you fucks are actually going to get him to use Linux for a bash script rather than just write the shit in python or something. Senpai
Jason Rodriguez
feel free to write something in python then. i'm familiar with bash, but not python
Hunter Parker
cbz and cbr are literally renamed zips, right? is there any reason I couldn't just zip a folder and rename it .cbr and use that in a reader application?
Kayden Evans
how reliable is wsl compared to cygwin on windows 10
Julian Cruz
also, windows doesn't ship with python either, so what's the difference? install python + the tools vs. install cygwin + the tools
Blake Foster
yes, cbz is a renamed zip, and cbr is a renamed rar
Cooper Torres
thanks dude
Parker Ortiz
>python >rar support if it were only cbzs, sure but supporting cbrs means nig gotta do additional shit besides muh python
Josiah Perez
it totally doesn't subtly rot your bits
Levi White
what packages do i need to run that script with cygwin
Angel Phillips
>you need linux to run bash user, i...
>google "rar python" >literally the first result has the solution what
Brandon Wilson
Install gentoo
Jackson Barnes
bash findutils (find) p7zip (7z) file
Aaron Rogers
>rarfile 3.0 : Python Package Index as in "need to fuck around with the clusterfuck that is Python package management"
Adrian Russell
not only that, but How can I get it work on Windows? On Windows the unrar.exe is not in PATH so simple Popen("unrar ..") does not work. It can be solved several ways:
Add location of unrar.exe to PATH. Set rarfile.UNRAR_TOOL to full path of unrar.exe. Copy unrar.exe to your program directory. Copy unrar.exe to system directory that is in PATH, eg. C:\Windows.
Good work team we almost got a windows user to install Linux
Caleb Garcia
i kinda agree that python packaging is weird to maintain/update (especially on windows), and for some retarded reason pip still isn't included in a default install (i guess). but still this isn't something that 5 minutes of googling won't solve.
yikes.
can you even install cygwin without coreutils? also personally i find msys much simpler and hassle-free. pacman makes things a lot easier.
Aaron Hill
nah, looks like they'll spoonfeed him enough that he'll avoid opening that door at least we got him to be less of a cunt for now
probably easier to reuse some of that python code that people spent effort writing for you in one of the previous threads
Jose Nguyen
>can you even install cygwin without coreutils? not sure all but p7zip would be available ootb in most any linux system, but i'm not sure what cygwin comes with, i just listed everything
Caleb Foster
blow your fucking brains out
>not arch
Gavin Kelly
i got cygwin up and running, so how do i make sure it only checks my two external drives and nothing else with this script and where is the text file made?
Dylan Hernandez
what got you so butthurt, bby
Brandon Diaz
>being this much of an ungrateful cunt and still expecting help holy fuck people here are pathetic if they're still giving you a hand
Alexander Perez
POSIX compliant: #!/bin/sh find . -type f -name '*.cb[rz]' | while read i; do temp="/tmp/${0##*/}.$$" mkdir -p "$temp" 7z x -o"$temp" "$i" 1>/dev/null if find "$temp" -type f -exec file {} + | grep -qsm 1 -e 'PNG'; then echo "File $i contains a png file." fi rm -Rf "$temp" done
Austin Wood
>is it still possible to make it in powershell? possible? sure, with external tools but you're much more likely to find people who can write scripts that aren't specific to windows maintenance in bash than powershell
it works off the current directory, as specified as "." at the start of line 2 just 'cd' into the directory you want to start from you can have it output to a text file with "./a.sh > output.txt", or if you want plain output, change "echo File \"$i\" contains a png file." to just "echo $i"
Andrew Richardson
this is susceptible to false positives, if the filename or extension contains "PNG" you're assuming filenames/extensions won't be uppercase
Carter Johnson
#!/bin/bash find . -type f -iregex ".*\.cb[rz]" | while read i; do haspng=0 regex=".* image\/png$" temp="$(mktemp -d)" 7z x -o"$temp" "$i" 1>/dev/null for p in $(find "$temp" -type f); do if [[ "$(file --mime-type "$p")" =~ $regex ]]; then haspng=1 fi done if [ $haspng = 1 ]; then echo File \"$i\" contains a png file. ./a.sh > output.txt fi rm -rf "$temp" done
would this create "output.txt" with the name of the zip if there is one png that doesn't have .png in the filename
Robert Robinson
-- false negatives, too, since it won't see inputs with uppercase characters in the extension (not relevant in windows scripts, but may be relevant in cygwin)
Jonathan Parker
oof
Jayden Reyes
you've just created a loop by telling the script to run itself with no way to break out of it it'll hit a png, call itself, which will hit a png, call itself, etc, etc no, you run the script with "./a.sh > output.txt", don't put that /in/ the script anywhere
John Jones
-- also, the script lists files that contain any png's, correct extension or not, as per OP
Jeremiah Miller
#!/bin/sh find . -type f -name '*.[cC][bB][rRzZ]' | while read i; do temp="/tmp/${0##*/}.$$" mkdir -p "$temp" 7z x -o"$temp" "$i" 1>/dev/null if find "$temp" -type f -exec file {} + | grep -qsm 1 -e 'PNG'; then echo "File $i contains a png file." fi rm -Rf "$temp" done