From b1ce45b1700866dabc4b6b802bd028f57b9f7787 Mon Sep 17 00:00:00 2001 From: PiRSquared17 Date: Mon, 2 Mar 2015 04:13:44 +0000 Subject: [PATCH] Try using URL without index.php as index --- dumpgenerator.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dumpgenerator.py b/dumpgenerator.py index 5980a6d..e38dc19 100644 --- a/dumpgenerator.py +++ b/dumpgenerator.py @@ -1280,8 +1280,15 @@ def getParameters(params=[]): session=session): print 'index.php is OK' else: - print 'Error in index.php, please, provide a correct path to index.php' - sys.exit(1) + index = '/'.join(index.split('/')[:-1]) + if index and checkIndex( + index=index, + cookies=args.cookies, + session=session): + print 'index.php is OK' + else: + print 'Error in index.php, please, provide a correct path to index.php' + sys.exit(1) # check user and pass (one requires both) if (args.user and not args.password) or (args.password and not args.user): @@ -1394,6 +1401,11 @@ def checkIndex(index=None, cookies=None, session=None): raw) and not cookies: print "ERROR: This wiki requires login and we are not authenticated" return False + if re.search( + r'(page-Index_php|"wgPageName":"Index.php"|"firstHeading">Index.php)', + raw): + print "Looks like the page called Index.php, not index.php itself" + return False if re.search( r'(This wiki is powered by|

|meta name="generator" content="MediaWiki)', raw):