本文整理汇总了Python中builder.Builder.get_number_of_images方法的典型用法代码示例。如果您正苦于以下问题:Python Builder.get_number_of_images方法的具体用法?Python Builder.get_number_of_images怎么用?Python Builder.get_number_of_images使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类builder.Builder
的用法示例。
在下文中一共展示了Builder.get_number_of_images方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from builder import Builder [as 别名]
# 或者: from builder.Builder import get_number_of_images [as 别名]
def main():
global debug
if (len(argv) == 2) and argv[1] == "--debug":
debug = True
else:
debug = False
print "\r"
print "******************************************************************"
print "Instagram downloader v0.5 \t author: Černý Jan \t 2016-2017"
print "******************************************************************"
user = raw_input('user account: ').strip()
#internet connection test
if test_connection():
pass
else:
exit("app down")
#account exists test
if account_exists(user):
pass
else:
exit("Account does not exist")
url = "https://www.instagram.com/" + user + "/media/"
start_time = timeit.default_timer()
ib = Builder(user, debug)
ib.set_images()
if debug:
print "found " + str(ib.get_number_of_images()) + " photo(s)"
w = Worker(ib.get_images(), user, debug)
w.work()
elapsed = round((timeit.default_timer() - start_time), 2)
path = user
print "\nTotal: " + str(len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))])) + " photo(s) " + "in " + str(elapsed) + " seconds"
exit("--successfully finished--")