#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()
网友评论