Hack Forums
[Python] Python CCleaner V 0.2! - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Python CCleaner V 0.2! (/showthread.php?tid=4344662)



Python CCleaner V 0.2! - SIM-1866423 - Jul 17, 2014

Deleting all temp files
Chrome caches & history
* More faster than ccleaner 😉



PHP Code

<?php 
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import threading
import platform
import shutil

#Coding by B3mB4m
#[email protected] 
#Tested on XP SP3 

def temp():
    
klasor = "C:\\DOCUME~1\\"+platform.node()+"\\LOCALS~1\\Temp\\"
    
for i in os.listdir(klasor):
        
dosya = os.path.join(klasor,i)
        
#Temp dosyalarını sıfırla
        
if os.path.isfile(dosya):
            try:
                
os.remove(klasor+i)
                print 
"[+]Removed File " + i 
            except
:
                
pass    
        elif os
.path.isdir(dosya):
            try:
                
shutil.rmtree(klasor+i)
                print 
'[+] Removed Folder ' + i
            except
:
                
pass        
def chrome
():
    
#Cache(önbellek) dosyalarını temizle
    
klasor = "C:\\Documents and Settings\\"+platform.node()+"\\Local Settings\\Application Data\\Google\\Chrome\\User Data\\Default\\Cache\\"
    
klasor2 = "C:\\Documents and Settings\\"+platform.node()+"\\Local Settings\\Application Data\\Google\\Chrome\\User Data\\Default\\Local Storage\\"
    
klasor3 = "C:\\Documents and Settings\\"+platform.node()+"\\Local Settings\\Application Data\\Google\\Chrome\\User Data\\Default\\Media Cache\\"
    
klasor4 = "C:\\Documents and Settings\\"+platform.node()+"\\Local Settings\\Application Data\\Google\\Chrome\\User Data\\Default\\"

    
for i in os.listdir(klasor):
        
dosya = os.path.join(klasor,i)
        if 
os.path.isfile(dosya):
            try:
                
os.remove(klasor+i)
                print 
"[+] Chrome Cache File Deleted " + i
            except
:
                
pass    

    
#Yerel Depolama (Local Storage) dosyalarını temizle    
    
for i in os.listdir(klasor2):    
        
dosya = os.path.join(klasor2,i)    
        if 
os.path.isfile(dosya):
            try:
                
os.remove(klasor2+i)
                print 
"[+] Chrome Local Strage File Deleted " + i
            except
:
                
pass        
    
#Media Cache(önbellek) dosyalarını temizle
    
for i in os.listdir(klasor3):
        
dosya = os.path.join(klasor3,i)
        if 
os.path.isfile(dosya):
            try:
                
os.remove(klasor3+i)
                print 
"[+] Chrome Media Cache File Deleted " + i
            except
:
                
pass    
    
#İnternet geçmişi temizle            
    
for i in os.listdir(klasor4):
        
dosya = os.path.join(klasor4,i)
        if 
os.path.isfile(dosya):
            try:
                if 
"Archived History" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"Current Tabs" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"History Provider Cache" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"Last Tabs" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"Network Action Predictor" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"Top Sites" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
                elif 
"Visited Links" == i:
                    
os.remove(klasor4+i)
                    print 
"[+] Chrome History File Deleted " + i
            except
:
                
pass            


temp 
= threading.Thread(name='temp', target=temp)
chrome = threading.Thread(name='chrome', target=chrome)

temp.run()
chrome.run() 






Sorry about my english .. I hope you guys like it 😉


* - SIM-1858092 - Jul 17, 2014

Spoiler (Click to View)

Nice... but ccleaner does more :P

Still a good tool for a quick clean haha...

Dafull97 🤝


* - SIM-1866423 - Jul 17, 2014

(Jul 17, 2014 11:56 AM)dafull97 Wrote:  Spoiler (Click to View)

Nice... but ccleaner does more :P

Still a good tool for a quick clean haha...

Dafull97 🤝

İ just made it to day bro :) I can improve it 🤝


* - anay - Jul 17, 2014

(Jul 17, 2014 12:34 PM)b3mb4m Wrote:  İ just made it to day bro :) I can improve it 🤝

yes that's helpful if you want to be done in quick. thanks


* - SIM-1866423 - Jul 17, 2014

(Jul 17, 2014 01:07 PM)anay Wrote:  yes that's helpful if you want to be done in quick. thanks

Yes and thak you ✌

I want update for version 3-4 all windows versions 😉

Much faster than ccleaner 🤣


* - glob - Jul 17, 2014

(Jul 17, 2014 01:40 PM)b3mb4m Wrote:  Yes and thak you ✌

I want update for version 3-4 all windows versions 😉

Much faster than ccleaner 🤣

It's faster because it does much less work.


* - SIM-1866423 - Jul 18, 2014

Well .. i dont think so i tested on

chrome files with ccleaner and python ccleaner so python win .. 😠


* - chrisn - Jul 18, 2014

thanks for the share buddy !
its a good try