Merge pull request #1 from chhantyal/master

use https
This commit is contained in:
Dan Lenski 2016-08-04 15:31:18 -07:00 committed by GitHub
commit 33040a6c56
1 changed files with 3 additions and 3 deletions

View File

@ -51,15 +51,15 @@ def main():
# Connect to site with mwclient # Connect to site with mwclient
if args.site is not None: if args.site is not None:
scheme, host, path = urlparse.urlparse(args.site, scheme='http')[:3] scheme, host, path = urlparse.urlparse(args.site, scheme='https')[:3]
if path=='': if path=='':
path = '/w/' path = '/w/'
elif not path.endswith('/'): elif not path.endswith('/'):
path += '/' path += '/'
elif args.lang is not None: elif args.lang is not None:
scheme, host, path = 'http', '%s.wikipedia.org' % args.lang, '/w/' scheme, host, path = 'https', '%s.wikipedia.org' % args.lang, '/w/'
else: else:
scheme, host, path = 'http', 'wikipedia.org', '/w/' scheme, host, path = 'https', 'wikipedia.org', '/w/'
site = mwclient.Site((scheme, host), path=path) site = mwclient.Site((scheme, host), path=path)
print('Connected to %s://%s%s' % (scheme, host, path), file=stderr) print('Connected to %s://%s%s' % (scheme, host, path), file=stderr)