def main(s_argv): argv = s_argv argv["user"] = "******" argv["album"] = "youjung_ioi"#"chungha_ioi" argv["dump"] = "dump.txt" argv["save_path"] = "./save_list.txt" argv["complete_path"] = "./complete.txt" name_list = [] img_oriUrl_list = [] board_url = "" count = 1 name_flag = False #img_upload(access, refresh) _access_token, _refresh_token = get_access_token() print(_access_token) print(_refresh_token) client = ImgurClient(client_id, client_secret) client.set_user_auth(_access_token, _refresh_token) client.mashape_key = x_mash_key #print(client.credits["ClientLimit"]) #print("usr : %s, album : %s" % (argv["user"], argv["album"])) # album_id = get_album_id(client, argv["user"], argv["album"]) x_mash_info = get_x_mash_limit(client) remain = int(x_mash_info[0])
def img_upload(_access_token, _refresh_token): client = ImgurClient(client_id, client_secret) client.set_user_auth(_access_token, _refresh_token) client.mashape_key = x_mash_key conf = {"album" : "JtebE", "description": "Hello World", "title" : "Hi"} res = client.upload_from_path("./image_1_2.gif", config = conf, anon = False) print(res) print(res["link"])