예제 #1
0
if args.command is not None and args.video is True:
    safe_commands = ["ffmpeg", "avconv", "youtube-dl"]
    command = shlex.split(args.command)
    if command[0] not in safe_commands:
        print(colors.error("Refusing to execute this."))
        sys.exit(0)
elif args.command is None and args.video is True:
    command = args.command
elif args.command is not None and args.video is False:
    print(colors.warning("The --command option only works for video."))

"""
Resolution
"""

resolutions = [r.lower() for r in resolutions.keys()]

if args.resolution is None:
    resolution = args.resolution
elif args.resolution.lower() in resolutions:
    resolution = args.resolution.lower()
else:
    print(colors.error("Supported resolutions are: "))
    for res in resolutions:
        if res is not False:
            print("- %s." % res)
    sys.exit(0)

"""
Bitrate
"""
예제 #2
0
if args.command is not None and args.video is True:
    safe_commands = ['ffmpeg', 'avconv', 'youtube-dl']
    command = args.command.split(' ')
    if command[0] not in safe_commands:
        print(colors.error('Refusing to execute this.'))
        sys.exit(0)
elif args.command is None and args.video is True:
    command = args.command
elif args.command is not None and args.video is False:
    print(colors.warning('The --command option only works for video.'))

"""
Resolution
"""

resolutions = [r.lower() for r in resolutions.keys()]

if args.resolution is None:
    resolution = args.resolution
elif args.resolution.lower() in resolutions:
    resolution = args.resolution.lower()
else:
    print(colors.error('Supported resolutions are: '))
    for res in resolutions:
        if res is not False:
            print('- %s.' % res)
    sys.exit(0)

"""
Bitrate
"""