美文网首页
网易云视频下载

网易云视频下载

作者: Joyner2018 | 来源:发表于2019-11-16 15:07 被阅读0次

    #encoding=utf-8

    import os

    import sys

    import time

    class LOG(object):

    """docstring for LOG"""

    def __init__(self, dataformat="[%Y-%m-%d %H:%M:%S]  "):

    super(LOG, self).__init__()

    self.dataformat = dataformat

    def info(self, out_put):

    headtime = time.strftime(self.dataformat, time.localtime())

    message = headtime + str(out_put)

    print(message)

    log = LOG()

    def main():

    number = 2530

    with open('passed_number.txt','rb') as frb:

    content = frb.read().decode()

    content = content.split('\n')

    while len(content) > 0 and len(content[-1]) == 0:

    content = content[:-1]

    number = content[-1]

    number = int(number.split(' ')[0])

    for i in range(number,number + 1000):

    try:

    cmd = "cd video && you-get -f https://music.163.com/#/mv?id="+str(number)

    os.system(cmd)

    except:

    log.info("download video "+ cmd + " filed!")

    finally:

    log.info("the number is: " + str(i))

    with open('passed_number.txt','ab') as fab:

    fab.write((str(i).encode()))

    fab.write('\n'.encode())

    main()

    相关文章

      网友评论

          本文标题:网易云视频下载

          本文链接:https://www.haomeiwen.com/subject/tmyyictx.html