Skip to content

Commit f65415d

Browse files
committed
add delete function
2 parents e502c44 + c9cbf70 commit f65415d

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
# fileRemover
22
remove the unused file in common.moegirl.org
3+
4+
python api.py
5+
36
#command line options
7+
48
-s --search: search only mode, no file will be removed
59

610
-n --exportonly: turn off search function, export results to a file. Need to use with -e option
711

812
-e --export <filename>: specify a file for exporting results. If file is not existed, it will be created. If file is existed, it will be overwritten.
13+
14+
e.g. : python api.py -s -e "path/to/saved/list" to get all unused files list saved into a file.
15+
16+
you may need:
17+
18+
apt-get install python-setuptools
19+
20+
easy_install pip
21+
22+
pip install redis futures requests

api.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import time
88
import datetime
99
import sys, getopt
10+
reload(sys)
11+
sys.setdefaultencoding('utf-8')
1012

1113
apiroot = "https://commons.moegirl.org/api.php"
1214
def allimages():
@@ -209,5 +211,4 @@ def main():
209211

210212

211213
if __name__ == '__main__':
212-
main()
213-
214+
main()

config.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import redis
44

55
cookie = None
6+
# set db=1 , if db=0 have data.
67
r = redis.Redis(host="localhost", port=6379, db=0)
7-
botUsername = "CommonsFileDeletionBot"
8-
botPassword = "d19Cwj&ayHUv$u!E"
8+
botUsername = ""
9+
botPassword = ""
910
workers = 20
1011
aistart = datetime.datetime(2018,5,20,0,0,0).strftime("%Y-%m-%dT%H:%M:%SZ")

0 commit comments

Comments
 (0)