Beispiel #1
0
def execute_command(args=sys.argv[1:]):
    if not args:
        usage()
        sys.exit(1)

    command = args[0]
    if command.startswith('-'):
        if command in ('-h', '--help'):
            usage(bddown_help.show_help())
        elif command in ('-V', '-v', '--version'):
            print 'V1.54'
        else:
            usage()
            sys.exit(1)
        sys.exit(0)

    commands = {
        'help': bd_help,
        'login': login,
        'download': download,
        'd': download,  # alias download
        'export': export,
        'show': show,
        'config': config
    }

    if command not in commands.keys():
        usage()
        sys.exit(1)
    elif '-h' in args or '--help' in args:
        bd_help([command])
        sys.exit(0)
    else:
        commands[command](args[1:])
Beispiel #2
0
def execute_command(args=sys.argv[1:]):
    if not args:
        usage()
        sys.exit(1)

    command = args[0]
    if command.startswith('-'):
        if command in ('-h', '--help'):
            usage(bddown_help.show_help())
        elif command in ('-V', '-v', '--version'):
            print 'V1.54'
        else:
            usage()
            sys.exit(1)
        sys.exit(0)

    commands = {
        'help':         bd_help,
        'login':        login,
        'download':     download,
        'd':            download,   # alias download
        'export':       export,
        'show':         show,
        'config':       config
    }

    if command not in commands.keys():
        usage()
        sys.exit(1)
    elif '-h' in args or '--help' in args:
        bd_help([command])
        sys.exit(0)
    else:
        commands[command](args[1:])
Beispiel #3
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = Pan()
            info = pan.get_dlink(url)
            print(u"{0}\n{1}\n\n".format(info.filename, info.dlink).encode('utf-8'))
    sys.exit(0)
Beispiel #4
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = BaiduDown(url)
            filename = pan.filename
            link = pan.link
            print "%s\n%s\n\n" % (filename, link)
    sys.exit(0)
Beispiel #5
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = Pan()
            info = pan.get_dlink(url)
            print(u"{0}\n{1}\n\n".format(info.filename,
                                         info.dlink).encode('utf-8'))
    sys.exit(0)
Beispiel #6
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = Pan(url)
            count = 1
            while count != 0:
                link, filename, count = pan.info
                print "%s\n%s\n\n" % (filename, link)
    sys.exit(0)
Beispiel #7
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = Pan(url)
            count = 1
            while count != 0:
                link, filename, count = pan.info
                print "%s\n%s\n\n" % (filename, link)
    sys.exit(0)
Beispiel #8
0
def show(links):
    if not len(links):
        bd_help('show')
    else:
        for url in links:
            pan = Pan(url)
            count = 1
            while count != 0:
                link, filename, count = pan.info
                print("{0}\n{1}\n\n".format(filename, link))
    sys.exit(0)