set time
This commit is contained in:
parent
65ff5d5e32
commit
3fcaaf9081
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,8 @@ for i in range(10):
|
|||
shutil.copyfileobj(r.raw, fd)
|
||||
ox.avinfo('%s.tmp' % name)['duration']
|
||||
shutil.move('%s.tmp' % name, name)
|
||||
mtime = time.mktime(datetime.datetime.strptime(r.headers.get("Last-Modified"), "%a, %d %b %Y %X GMT").timetuple())
|
||||
os.utime(name, (mtime, mtime))
|
||||
ox.avinfo(name)['duration']
|
||||
except:
|
||||
print(url, 'failed')
|
||||
|
|
Loading…
Reference in a new issue