diff --git a/clipper.py b/clipper.py index 6a2281f..532ce66 100644 --- a/clipper.py +++ b/clipper.py @@ -5,7 +5,7 @@ import json import urllib.request as dl import sys -from os.path import isfile, isdir, realpath +from os.path import isfile, isdir, realpath, basename from os.path import join as pjoin from os import remove, makedirs, listdir from datetime import datetime, timedelta @@ -136,7 +136,8 @@ def dl_progress(count, block_size, total_size): args = parser.parse_args() filepath = realpath(__file__) - filedir = "/".join(filepath.split("/")[:-1]) + "/" + filename = basename(filepath) + filedir = filepath[:-len(filename)] gdrive_credentials = pjoin(filedir, "credentials.txt")