Kcminer: Difference between revisions

From chaoswiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
<pre>
<pre>
#!/bin/bash
#!/bin/bash
# Mar@chaostreff.ch , last version 04.08.2010 vers.0.7
# Mar@chaostreff.ch , last version 13.08.2010 vers.0.7
# mars Collector for krautchan Pic's with orginal name
# mars Collector for krautchan Pic's with orginal name


Line 33: Line 33:
##### #####
##### #####


# For coments , google.com
# For coments , man $prog
# Auswahl , aber /all gibts nicht ist blos für alles.
# Auswahl , aber /all gibts nicht ist blos für alles.



Revision as of 13:03, 13 August 2010

KC Miner

Bash tool um die Images ausm Imageboards zu sichern bei sich daheim.

Rechtliches

Vorab

Bash ist legal und daher kann jeder diesen code verwenden, nur sollte sich überlegen ob das Runtergeladene Legal ist.

!!!!! Achtung, gewisse Bilder können in deinem Land nicht Legal sein !!!!!
!!!!! May conntent could be illegal in your country !!!!!

Ich empfehle auf jeden fall den Inhalt auf eine Cryptoplatte zu schreiben.

Quellcode

aufruf

user@rechner:~$ bash kcminer


#!/bin/bash
# Mar@chaostreff.ch , last version 13.08.2010 vers.0.7
# mars  Collector for krautchan Pic's with orginal name 

#####									   #####
# !!!!!  Achtung, gewisse Bilder können in deinem Land nicht Legal sein !!!!! #
#####									   #####
#	 !!!!! May conntent could be illegal in your country !!!!!             #
#####                                                                       #####

# For coments ,  man $prog
# Auswahl , aber  /all gibts nicht ist blos für alles.

## Wget KC-Mörder Automatik 
## Tested with 100Mbit but krautchan performe less
## Achtung KC blockt bei zu schnellen downloaden peer ip euch für 10 min

## weget linksammelung und Download der Bilder ohne auf wget zu warten

function GET1 ()
	{
	## Download von Kc
	wget http://www.krautchan.net/$1/ -nc
		
	## Auslesen von den links zwischen den Anführungszeichen
	## 2mal daher in einem grep download 2 links kommen
	cat index.html | grep download* | cut -d '"' -f 2 | grep "/" >> marc.col0
	cat index.html | grep download* | cut -d '"' -f 4 | grep "/" >> marc.col0

	## Anzahl zählen damit wir wissen wie viele durchläufe die for schleife braucht
	AZN=$(cat marc.col0 | wc -l | cut -f 3)
	mkdir $1
	cd $1
	for I1 in `seq 1 $AZN`;do
	        PIC=$(sed -n -e''$I1'p' ../marc.col0)
		wget www.krautchan.net$PIC -nc &
	done
	cd ../
	rm marc.col0
	rm index.html

########################### 1-9.html
	for E1 in `seq 1 9`; do
		wget http://www.krautchan.net/$1/$E1.html -nc -O $E1.html$1
		cat $E1.html$1 | grep download* | cut -d '"' -f 2 | grep "/" >> marc.col
		cat $E1.html$1 | grep download* | cut -d '"' -f 4 | grep "/" >> marc.col
		AZN=$(cat marc.col | wc -l | cut -f 3)
	cd $1
	for I1 in `seq 1 $AZN`; do	
		PIC=$(sed -n -e''$I1'p' ../marc.col)
		wget www.krautchan.net$PIC -nc &
	done
	cd ../
	rm marc.col
	rm $E1.html$1
	done
	echo "------------------------------------------"
	echo "----------Done, KC is robbed--------------"
}

## All funktion , ruft alle bekannten Krautchan unterforen ab 

function ALL1 ()
	{
	GET1 b  
	GET1 int &  
	GET1 vip & 
	GET1 a  
	GET1 c &
	GET1 d &
	GET1 e 
	GET1 f &
	GET1 fb &
	GET1 fit  
	GET1 jp &
	GET1 k &
	GET1 l
	GET1 li &
	GET1 m &
	GET1 p 
	GET1 ph &
	GET1 t &
	GET1 tv 
	GET1 w & 
	GET1 we &
	GET1 wp 
	GET1 sp &
	GET1 x &
	GET1 h 
	GET1 s &
	GET1 kc &
}


## begin des Userinfaces
## 

echo " KC Miner ver 0.7				"
echo " Mar@chaostreff.ch 			"
echo " https://wiki.chaostreff.ch/kcminer/	"
echo "b   	      	for /b  		"
echo "int		for /int		"
echo "vip		for /vip		"
echo "						"
echo "	----and so on-----			"
echo "all  		for all 		"

## Auslesung
read case ;

case "$case" in
        all)	ALL1 	 	;;
	*)	GET1 $case 	;;
esac