Downloading single file works fine, why then does this script not download? It seems the credentials are not being loaded.
It should be a matter of bug fixing why Unable to download from bitbucket cloud with Python requests - #3 by Therewasatime this works and why the following does not but I cannot seem to get it to work. Any ideas here?
I try:
client = Client(ClientConfig(), auth=(‘username’, ‘password’))
requests.get(‘https:slashslashapi.bitbucket.org/2.0/repositories/username/repo/downloads’, auth=(‘username’, ‘password’))
Code:
#!/usr/bin/env python3
from __future__ import print_function
import time
import argparse
import os
import signal
import sys
import logging
from selenium import webdriver
import requests
logging.basicConfig(level=logging.DEBUG)
from client_config import ClientConfig
from pyupdater.client import Client, AppUpdate, LibUpdate
def check_for_update():
client = Client(ClientConfig(), refresh=True)
app_update = client.update_check(ClientConfig.APP_NAME, ClientConfig.APP_VERSION, channel='stable')
if app_update is not None: # is there a new update
if app_update.download(): # the update download is made here
if isinstance(app_update, AppUpdate): # you should freeze it
app_update.extract_restart()
return True
else:
app_update.extract()
return True
return False
def main():
print('Current version is ', ClientConfig.APP_VERSION)
if check_for_update():
print('there\'s a new update :D')
print('hi')
if __name__ == "__main__":
main()
Client downloader - PyUpdater/downloader.py at main · Digital-Sapphire/PyUpdater · GitHub
Client downloader @365
try:
data = self.http_pool.urlopen('GET', file_url,
preload_content=False,
retries=max_download_retries)
except urllib3.exceptions.SSLError:
log.debug('SSL cert not verified')
continue