Download script for google drive shared links 

    Thank you @turdus-merula and Andrew Hundt! 
    https://stackoverflow.com/a/39225039/623735

def download_file_from_google_drive(driveid, filename=None, destination=os.path.curdir):
    """ Download script for google drive shared links 

    Thank you @turdus-merula and Andrew Hundt! 
    https://stackoverflow.com/a/39225039/623735
    """
    if '&id=' in driveid:
        # https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfM1BxdkxVaTY2bWs  # dailymail_stories.tgz
        driveid = driveid.split('&id=')[-1]
    if '?id=' in driveid:
        # 'https://drive.google.com/open?id=14mELuzm0OvXnwjb0mzAiG-Ake9_NP_LQ'  # SSD pretrainined keras model
        driveid = driveid.split('?id=')[-1]

    URL = "https://docs.google.com/uc?export=download"

    session = requests.Session()

    response = session.get(URL, params={'id': driveid}, stream=True)
    token = get_response_confirmation_token(response)

    if token:
        params = {'id': driveid, 'confirm': token}
        response = session.get(URL, params=params, stream=True)

    filename = filename or get_url_filename(driveid=driveid)

    full_destination_path = save_response_content(response, filename=fileanme, destination=destination)

    return os.path.abspath(destination)