Код: Выделить всё
if __name__ == '__main__':
argparser.add_argument("--file", required=True,
help="Video file to upload")
# ...bunch of possible arguments
args = argparser.parse_args()
youtube = get_authenticated_service(args)
try:
initialize_upload(youtube, args)
Код: Выделить всё
It presumes it is run from a command-line application and supports the
following flags:
Код: Выделить всё
def uploadVideo(file, title, description, category):
# this feels hacky (yah think?)
argparser.add_argument("--file", required=True,
help="Video file to upload", default=file)
argparser.add_argument("--title", help="Video title", default=title)
Есть предложения?< /п>
Подробнее здесь: https://stackoverflow.com/questions/791 ... eters-pyth